summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-06-18 16:46:25 +0200
committerDan McGee <dan@archlinux.org>2012-08-02 09:46:16 -0500
commitec5e6d90294f3322b7015b422db948770ecb41b6 (patch)
tree30f51994f978cc36c06c95080d3678c9426f36b5
parentd46bb6b27b05579acf5665368c111b4cc41eedcb (diff)
downloadpacman-ec5e6d90294f3322b7015b422db948770ecb41b6.tar.xz
pacman-key: Use lsign_keys function in --populate
This reduces code duplication and also makes --populate a non-interactive function. Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
-rw-r--r--scripts/pacman-key.sh.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index ae491d26..e5b60214 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -302,7 +302,7 @@ populate_keyring() {
msg "$(gettext "Locally signing trusted keys in keyring...")"
for key_id in "${!trusted_ids[@]}"; do
msg2 "$(gettext "Locally signing key %s...")" "${key_id}"
- "${GPG_PACMAN[@]}" --quiet --lsign-key "${key_id}"
+ lsign_keys "${key_id}"
done
msg "$(gettext "Importing owner trust values...")"
for keyring in "${KEYRINGIDS[@]}"; do
@@ -440,6 +440,7 @@ list_sigs() {
lsign_keys() {
check_keyids_exist
+ # we cannot use --yes here as gpg would still ask for confirmation if a key has more than one uid
printf 'y\ny\n' | LANG=C "${GPG_PACMAN[@]}" --command-fd 0 --quiet --batch --lsign-key "$@" 2>/dev/null
if (( PIPESTATUS[1] )); then
error "$(gettext "A specified key could not be locally signed.")"