From fade60088e158c042e3a3a2c135fa067016998af Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sun, 24 Apr 2011 20:51:53 +1000 Subject: repo-add: check for valid key when signing is requested Follow the example of makepkg Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/repo-add.sh.in | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index c50c47da..00d3a416 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -554,7 +554,17 @@ while [[ $# > 0 ]]; do -q|--quiet) QUIET=1;; -d|--delta) DELTA=1;; -f|--files) WITHFILES=1;; - -s|--sign) SIGN=1;; + -s|--sign) + SIGN=1 + if ! gpg --list-key ${GPGKEY} &>/dev/null; then + if [[ ! -z $GPGKEY ]]; then + error "$(gettext "The key ${GPGKEY} does not exist in your keyring.")" + else + error "$(gettext "There is no key in your keyring.")" + fi + exit 1 + fi + ;; -k|--key) shift GPGKEY="$1" -- cgit v1.2.3-24-g4f1b