diff options
author | Dan McGee <dan@archlinux.org> | 2011-09-21 14:04:07 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-09-22 11:14:35 -0500 |
commit | 03e1b4caa9cf91ac3a3956b82e080dfc72b66a17 (patch) | |
tree | 422d20b8f73ded39ade3b51078d22c14a20aa4a2 | |
parent | a7691ba6fd6f87cae6210c304235c709e4f9a60e (diff) | |
download | pacman-03e1b4caa9cf91ac3a3956b82e080dfc72b66a17.tar.xz |
pacman-key: print message in populate if signature is missing
Rather than saying it was invalid, tell the user no signature exists.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | scripts/pacman-key.sh.in | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in index 82131e91..0c4d3aef 100644 --- a/scripts/pacman-key.sh.in +++ b/scripts/pacman-key.sh.in @@ -202,16 +202,24 @@ verify_keyring_input() { # Verify signatures of keyring files and association revocation files if they exist msg "$(gettext "Verifying keyring file signatures...")" - local keyring + local keyring keyfile for keyring in "${KEYRINGIDS[@]}"; do - if ! "${GPG_PACMAN[@]}" --verify "${KEYRING_IMPORT_DIR}/${keyring}.gpg.sig" &>/dev/null; then - error "$(gettext "The signature of file %s is not valid.")" "${keyring}.gpg" + keyfile="${KEYRING_IMPORT_DIR}/${keyring}.gpg" + if [[ ! -f "${keyfile}.sig" ]]; then + error "$(gettext "File %s is unsigned, cannot continue.")" "${keyfile}" + ret=1 + elif ! "${GPG_PACMAN[@]}" --verify "${keyfile}.sig" &>/dev/null; then + error "$(gettext "The signature of file %s is not valid.")" "${keyfile}" ret=1 fi - if [[ -f "${KEYRING_IMPORT_DIR}/${keyring}-revoked" ]]; then - if ! "${GPG_PACMAN[@]}" --verify "${KEYRING_IMPORT_DIR}/${keyring}-revoked.sig" &>/dev/null; then - error "$(gettext "The signature of file %s is not valid.")" "${keyring}-revoked" + keyfile="${KEYRING_IMPORT_DIR}/${keyring}-revoked" + if [[ -f "${keyfile}" ]]; then + if [[ ! -f "${keyfile}.sig" ]]; then + error "$(gettext "File %s is unsigned, cannot continue.")" "${keyfile}" + ret=1 + elif ! "${GPG_PACMAN[@]}" --verify "${keyfile}.sig" &>/dev/null; then + error "$(gettext "The signature of file %s is not valid.")" "${keyfile}" ret=1 fi fi |