]> git.saurik.com Git - apt.git/commitdiff
set a primary-keyring only if we have access to it
authorDavid Kalnischkies <david@kalnischkies.de>
Fri, 24 Jan 2014 16:41:35 +0000 (17:41 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Fri, 26 Sep 2014 22:12:14 +0000 (00:12 +0200)
cmdline/apt-key.in

index ab62d4c8fdaac5d9a3e738ad9239e14904b562ac..9da5fceb81ab510eec6d6b12ff1552333e1fd2b2 100644 (file)
@@ -281,8 +281,8 @@ if [ -z "$TRUSTEDFILE" ]; then
    eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
    if [ -r "$TRUSTEDFILE" ]; then
       GPG="$GPG --keyring $TRUSTEDFILE"
+      GPG="$GPG --primary-keyring $TRUSTEDFILE"
    fi
-   GPG="$GPG --primary-keyring $TRUSTEDFILE"
    TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
    eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)
    if [ -d "$TRUSTEDPARTS" ]; then
@@ -316,6 +316,8 @@ if [ "$command" != "help" ]; then
        if [ -w "$(dirname "$TRUSTEDFILE")" ]; then
           touch -- "$TRUSTEDFILE"
           chmod 0644 -- "$TRUSTEDFILE"
+          GPG="$GPG --keyring $TRUSTEDFILE"
+          GPG="$GPG --primary-keyring $TRUSTEDFILE"
        fi
     fi
 fi