1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

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>
This commit is contained in:
Pierre Schmitz 2012-06-18 16:46:25 +02:00 committed by Dan McGee
parent d46bb6b27b
commit ec5e6d9029

View File

@ -302,7 +302,7 @@ populate_keyring() {
msg "$(gettext "Locally signing trusted keys in keyring...")" msg "$(gettext "Locally signing trusted keys in keyring...")"
for key_id in "${!trusted_ids[@]}"; do for key_id in "${!trusted_ids[@]}"; do
msg2 "$(gettext "Locally signing key %s...")" "${key_id}" msg2 "$(gettext "Locally signing key %s...")" "${key_id}"
"${GPG_PACMAN[@]}" --quiet --lsign-key "${key_id}" lsign_keys "${key_id}"
done done
msg "$(gettext "Importing owner trust values...")" msg "$(gettext "Importing owner trust values...")"
for keyring in "${KEYRINGIDS[@]}"; do for keyring in "${KEYRINGIDS[@]}"; do
@ -440,6 +440,7 @@ list_sigs() {
lsign_keys() { lsign_keys() {
check_keyids_exist 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 printf 'y\ny\n' | LANG=C "${GPG_PACMAN[@]}" --command-fd 0 --quiet --batch --lsign-key "$@" 2>/dev/null
if (( PIPESTATUS[1] )); then if (( PIPESTATUS[1] )); then
error "$(gettext "A specified key could not be locally signed.")" error "$(gettext "A specified key could not be locally signed.")"