Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions scripts/sign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ fi
NAME="${1}"
if [ -z "${2}" ]; then
gpg --armor --output "${NAME}".asc --detach-sig "${NAME}"
gpg --print-md SHA512 "${NAME}" > "${NAME}".sha512
else
# The GPG key name to use
GPG_LOCAL_USER="${2}"
gpg --local-user "${GPG_LOCAL_USER}" --armor --output "${NAME}".asc --detach-sig "${NAME}"
gpg --local-user "${GPG_LOCAL_USER}" --print-md SHA512 "${NAME}" > "${NAME}".sha512
fi
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This checks if a GPG user-id was specified to use gpg with --local-user for signing/decrypting. Generating SHA sums (--print-md SHA512) is not affected by specifying this --local-user option.

So it is the same as

if [ -z "${2}" ]; then
  gpg --armor --output "${NAME}".asc --detach-sig "${NAME}"
else
  # The GPG key name to use
  GPG_LOCAL_USER="${2}"
  gpg --local-user "${GPG_LOCAL_USER}" --armor --output "${NAME}".asc --detach-sig "${NAME}"
fi
gpg --print-md SHA512 "${NAME}" > "${NAME}".sha512

which I then replaced with shasum:

if [ -z "${2}" ]; then
  gpg --armor --output "${NAME}".asc --detach-sig "${NAME}"
else
  # The GPG key name to use
  GPG_LOCAL_USER="${2}"
  gpg --local-user "${GPG_LOCAL_USER}" --armor --output "${NAME}".asc --detach-sig "${NAME}"
fi
shasum -a 512 "${NAME}" > "${NAME}.sha512"

shasum -a 512 "${NAME}" > "${NAME}.sha512"