Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a command to add a checksum to an opam file? #5932

Open
Khady opened this issue Apr 24, 2024 · 2 comments
Open

is there a command to add a checksum to an opam file? #5932

Khady opened this issue Apr 24, 2024 · 2 comments
Assignees

Comments

@Khady
Copy link
Contributor

Khady commented Apr 24, 2024

There's a command which is able to check if an opam file has a correct checksum

opam lint --check-upstream path/to/the/file

But is there one to add a checksum to an opam file?

For the record it would be convenient at ahrefs where we have a repo with overlays or unreleased versions of packages. We can usually start from opam show --raw name-of-the-package > patch/to/the/file and set the url of the archive we want to use. But then we need to do something by hand to compute and add the checksum, which people tend to forget about.

echo "checksum: [ \"sha512=$(curl -L $(opam show -f url.src --raw path/to/the/file | sed 's/^"\(.*\)"$/\1/') | sha512sum | awk '{print $1}')\" ]"
@rr0gi
Copy link

rr0gi commented Apr 30, 2024

(ftr doing curl | checksum is kind of meh from the not trusting the infrastructure pov, should be doing checksum on the local file before uploading)

@Khady
Copy link
Contributor Author

Khady commented May 1, 2024

This part already exists as part of tools like dune-release and opam publish I believe. The use case here is a bit different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants