Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-04-24 20:51:53 +1000
committerDan McGee <dan@archlinux.org>2011-04-24 10:43:25 -0500
commitfade60088e158c042e3a3a2c135fa067016998af (patch)
tree9bd6c4ecb639ddb5fd0f358ccd1927bccf536d86
parent59da64146d824026a958a139e0d3e0600f9bdcf7 (diff)
repo-add: check for valid key when signing is requested
Follow the example of makepkg Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--scripts/repo-add.sh.in12
1 files changed, 11 insertions, 1 deletions
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"