summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-07-09 04:48:41 +0200
committerAllan McRae <allan@archlinux.org>2011-07-19 02:27:54 +0200
commit0be9e4a4cd2c6a5d5c5246c8dc269931e883c1fe (patch)
tree0afea69bade08b6e54096a1f2eb96e980cf949ba
parentdf7b390514efa0ae6b84e8404806dee63d3524ad (diff)
downloadpacman-0be9e4a4cd2c6a5d5c5246c8dc269931e883c1fe.tar.gz
pacman-0be9e4a4cd2c6a5d5c5246c8dc269931e883c1fe.tar.xz
pacman-key: tidy up logic for finding pacman keyring directory
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--scripts/pacman-key.sh.in8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index 0ce0ea24..79bf41a8 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -300,11 +300,9 @@ if [[ ! -r "${CONFIG}" ]]; then
exit 1
fi
-# Get GPGDIR from pacman.conf iff not specified on command line
-if [[ -z PACMAN_KEYRING_DIR && GPGDIR="$(get_from "$CONFIG" "GPGDir")" == 0 ]]; then
- PACMAN_KEYRING_DIR="${GPGDIR}"
-fi
-PACMAN_KEYRING_DIR=${PACMAN_KEYRING_DIR:-@sysconfdir@/pacman.d/gnupg}
+# if PACMAN_KEYRING_DIR isn't assigned, try to get it from the config
+# file, falling back on a hard default
+PACMAN_KEYRING_DIR=${PACMAN_KEYRING_DIR:-$(get_from "$CONFIG" "GPGDir" || echo "@sysconfdir@/pacman.d/gnupg")}
# Try to create $PACMAN_KEYRING_DIR if non-existent
# Check for simple existence rather than for a directory as someone may want