After most operations that touch the keyring, it is a good idea to
always run a check on the trustdb as this prevents gpg complaining
on later operations.

Signed-off-by: Allan McRae <[email protected]>
---
 scripts/pacman-key.sh.in |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index 3e31abb..6d07482 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -253,10 +253,6 @@ populate_keyring() {
                        "${GPG_PACMAN[@]}" --quiet --batch --yes --delete-key 
"${key_id}"
                done
        fi
-
-       # Update trustdb, just to be sure
-       msg "$(gettext "Updating trust database...")"
-       "${GPG_PACMAN[@]}" --batch --check-trustdb
 }
 
 receive_keys() {
@@ -417,4 +413,9 @@ esac
 (( UPDATEDB )) && "${GPG_PACMAN[@]}" --batch --check-trustdb
 (( VERIFY )) && "${GPG_PACMAN[@]}" --verify $SIGNATURE
 
+if (( ADD || DELETE || EDITKEY || IMPORT || IMPORT_TRUSTDB || POPULATE || 
RECEIVE )); then
+       msg "$(gettext "Updating trust database...")"
+       "${GPG_PACMAN[@]}" --batch --check-trustdb
+fi
+
 # vim: set ts=2 sw=2 noet:
-- 
1.7.6


Reply via email to