summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-11-25 20:51:26 +0100
committerDan McGee <dan@archlinux.org>2012-01-31 04:59:34 +0100
commit2a73f4e9949e6655d17f15cf123a81568708741d (patch)
tree8e7be251f7954edd71392f72a9828e3dbaf3d108 /scripts
parent41db62b77a8a45d086da1be0606be69861f322cc (diff)
downloadpacman-2a73f4e9949e6655d17f15cf123a81568708741d.tar.gz
pacman-2a73f4e9949e6655d17f15cf123a81568708741d.tar.xz
pacman-key: simplify trusted keyring iteration
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/pacman-key.sh.in14
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index 4e321e63..947d59f9 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -301,14 +301,12 @@ populate_keyring() {
local -A trusted_ids
for keyring in "${KEYRINGIDS[@]}"; do
if [[ -f "${KEYRING_IMPORT_DIR}/${keyring}-trusted" ]]; then
- while read key; do
- # skip comments; these are valid in this file
- [[ $key = \#* ]] && continue
- key_id="${key%%:*}"
- if [[ -n ${key_id} ]]; then
- # Mark this key to be lsigned
- trusted_ids[$key_id]="${keyring}"
- fi
+ while IFS=: read key_id _; do
+ # skip blank lines, comments; these are valid in this file
+ [[ -z $key_id || ${key_id:0:1} = \# ]] && continue
+
+ # Mark this key to be lsigned
+ trusted_ids[$key_id]=$keyring
done < "${KEYRING_IMPORT_DIR}/${keyring}-trusted"
fi
done