From 03e1b4caa9cf91ac3a3956b82e080dfc72b66a17 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 21 Sep 2011 14:04:07 -0500 Subject: 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 --- scripts/pacman-key.sh.in | 20 ++++++++++++++------ 1 file 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 -- cgit v1.2.3-70-g09d2