summaryrefslogtreecommitdiff
path: root/cmdline/apt-key.in
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-01-24 17:41:35 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-09-27 00:12:14 +0200
commit08cfcd73f517e909823c100143c4938b9997343e (patch)
tree89378bfd957f415b2931c6f205a5849d3333b9cf /cmdline/apt-key.in
parent4f51a496d56807c73586220dd736173d7783c8b3 (diff)
set a primary-keyring only if we have access to it
Diffstat (limited to 'cmdline/apt-key.in')
-rw-r--r--cmdline/apt-key.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index ab62d4c8f..9da5fceb8 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -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