Skip to content

use sb-md5 if on sbcl, otherwise improve error if missing md5sum#10

Merged
rudolfochrist merged 3 commits intorudolfochrist:masterfrom
bo-tato:improved-md5
Feb 12, 2024
Merged

use sb-md5 if on sbcl, otherwise improve error if missing md5sum#10
rudolfochrist merged 3 commits intorudolfochrist:masterfrom
bo-tato:improved-md5

Conversation

@bo-tato
Copy link
Collaborator

@bo-tato bo-tato commented Feb 10, 2024

Currently it is computing md5sum by running the cli program with uiop:

(uiop:run-program (format nil "md5sum \"~A\" | cut -d' ' -f 1" file)
                    :output '(:string :stripped t))

Unfortunately in shells without pipefail set, if cut is present but md5sum is missing this will not return a bad error status, so uiop won't signal an error, leading to a md5-mismatch error later without a clear reason why, as in #8

This changes it to use sb-md5 if we are on sbcl, and if not on sbcl then still shell out to md5sum, but without piping to cut so that uiop will signal a clear error: Couldn't execute "md5sum": No such file or directory

Copy link
Owner

@rudolfochrist rudolfochrist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thank you for looking into this. Maybe we should add md5sum to the PREREQUISITES section in the README.

@rudolfochrist rudolfochrist merged commit b9ab619 into rudolfochrist:master Feb 12, 2024
@bo-tato
Copy link
Collaborator Author

bo-tato commented Feb 13, 2024

It looks like we can use openssl: openssl dgst -md5 FILENAME, which is installed by default on mac from what I can find with internet searching, I don't have a mac to test. I imagine openssl will be installed on all machines where curl with https is working

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants