]> git.saurik.com Git - apt.git/commitdiff
respect --keyring also in merged keyring commands
authorDavid Kalnischkies <david@kalnischkies.de>
Sun, 26 Jan 2014 18:14:13 +0000 (19:14 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Fri, 26 Sep 2014 22:12:14 +0000 (00:12 +0200)
Git-Dch: Ignore

cmdline/apt-key.in

index 12aee97505e56aecfb08db4e467468f82efc876a..c54b608e1a1440878ad8bf0d14a450a4f8ac2e4f 100644 (file)
@@ -231,14 +231,16 @@ import_keys_from_keyring() {
 }
 
 setup_merged_keyring() {
-    local TRUSTEDFILE_BAK="$TRUSTEDFILE"
-    TRUSTEDFILE='/dev/null'
-    foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/trusted.gpg"
-    TRUSTEDFILE="$TRUSTEDFILE_BAK"
-    # mark it as non-writeable so users get errors if gnupg tries to modify it
-    if [ -s "${GPGHOMEDIR}/trusted.gpg" ]; then
-       chmod -w "${GPGHOMEDIR}/trusted.gpg"
-       GPG="$GPG --keyring ${GPGHOMEDIR}/trusted.gpg"
+    if [ -z "$FORCED_KEYRING" ]; then
+       local TRUSTEDFILE_BAK="$TRUSTEDFILE"
+       TRUSTEDFILE='/dev/null'
+       foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg"
+       TRUSTEDFILE="$TRUSTEDFILE_BAK"
+       # mark it as non-writeable so users get errors if gnupg tries to modify it
+       if [ -s "${GPGHOMEDIR}/pubring.gpg" ]; then
+           chmod -w "${GPGHOMEDIR}/pubring.gpg"
+           GPG="$GPG --keyring ${GPGHOMEDIR}/pubring.gpg"
+       fi
     fi
     if [ -r "$TRUSTEDFILE" ]; then
        GPG="$GPG --keyring $TRUSTEDFILE --primary-keyring $TRUSTEDFILE"