diff options
author | Allan McRae <allan@archlinux.org> | 2011-04-17 14:38:35 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-04-21 01:58:55 +0200 |
commit | 4c31bc6e3f32d954a9a0f81555abe5b91db3a6d3 (patch) | |
tree | 89927ede6fc4ed41c6d0c58bf6450fc211c7372f /scripts | |
parent | cb35affd1b2ac7bb489c8774685225672c5a3d9f (diff) | |
download | pacman-4c31bc6e3f32d954a9a0f81555abe5b91db3a6d3.tar.gz pacman-4c31bc6e3f32d954a9a0f81555abe5b91db3a6d3.tar.xz |
Add configure option to specify package signing key
Add the "GPGKEY" option to makepkg.conf for specifying signing packages
with the non-default key from the keyring. Is overridded by makepkg's
--key option.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.sh.in | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 36ac7280..70d3cf32 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1116,8 +1116,8 @@ create_signature() { fi local SIGNWITHKEY="" - if [[ -n $SIGNKEY ]]; then - SIGNWITHKEY="-u ${SIGNKEY}" + if [[ -n $GPGKEY ]]; then + SIGNWITHKEY="-u ${GPGKEY}" fi # The signature will be generated directly in ascii-friendly format gpg --detach-sign --use-agent ${SIGNWITHKEY} "$filename" &>/dev/null || ret=$? @@ -1697,7 +1697,7 @@ while true; do -g|--geninteg) GENINTEG=1 ;; --holdver) HOLDVER=1 ;; -i|--install) INSTALL=1 ;; - --key) shift; SIGNKEY=$1 ;; + --key) shift; GPGKEY=$1 ;; -L|--log) LOGGING=1 ;; -m|--nocolor) USE_COLOR='n' ;; --nocheck) RUN_CHECK='n' ;; @@ -1727,6 +1727,7 @@ done [[ -n ${SRCPKGDEST} ]] && _SRCPKGDEST=$(canonicalize_path ${SRCPKGDEST}) [[ -n ${PKGEXT} ]] && _PKGEXT=${PKGEXT} [[ -n ${SRCEXT} ]] && _SRCEXT=${SRCEXT} +[[ -n ${GPGKEY} ]] && _GPGKEY=${GPGKEY} # default config is makepkg.conf MAKEPKG_CONF=${MAKEPKG_CONF:-$confdir/makepkg.conf} @@ -1792,6 +1793,7 @@ SRCPKGDEST=${SRCPKGDEST:-$startdir} #default to $startdir if undefined PKGEXT=${_PKGEXT:-$PKGEXT} SRCEXT=${_SRCEXT:-$SRCEXT} +GPGKEY=${_GPGKEY:-$GPGKEY} if (( HOLDVER )) && [[ -n $FORCE_VER ]]; then # The '\\0' is here to prevent gettext from thinking --holdver is an option @@ -1948,9 +1950,9 @@ if [[ -z "$SIGNPKG" && $(check_buildenv sign) == 'y' ]]; then SIGNPKG='y' fi if [[ $SIGNPKG == 'y' ]]; then - if ! gpg --list-key ${SIGNKEY} &>/dev/null; then - if [[ ! -z $SIGNKEY ]]; then - error "$(gettext "The key ${SIGNKEY} does not exist in your keyring.")" + 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 |