[arch-projects] [dbscripts][PATCH] Disable automatic trust db check when verifying

Florian Pritz bluewind at xinu.at
Fri Aug 10 16:27:56 EDT 2012

Most dbscripts commands are run with user privileges and those won't
have write access to the trust db. Therefore when gpg tries to check it
and write the last check time (or something else) into the file it will
fail and display the following error:
> gpg: trustdb rec 30: write failed (n=-1): Bad file descriptor
> gpg: trustdb: sync failed: Bad file descriptor

To avoid this we tell it not to do automatic checking.

Signed-off-by: Florian Pritz <bluewind at xinu.at>
 db-functions | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/db-functions b/db-functions
index de5e8b8..20143ba 100644
--- a/db-functions
+++ b/db-functions
@@ -460,7 +460,7 @@ check_pkgsig() {
 	local ret=1
 	local fd="$(mktemp --tmpdir="${WORKDIR}")"
-	gpg --homedir /etc/pacman.d/gnupg/ --status-file "${fd}" --verify "${signature}" >/dev/null 2>&1
+	gpg --no-auto-check-trustdb --homedir /etc/pacman.d/gnupg/ --status-file "${fd}" --verify "${signature}" >/dev/null 2>&1
 	if grep -q TRUST_FULLY "${fd}"; then

More information about the arch-projects mailing list