Bug#632668: apt-key: does not look at apt.conf for all gpg files
Package: apt
Version: 0.8.10.3+squeeze1
Severity: wishlist
apt-key hardcodes several paths which belong to the apt config, at least:
/etc/apt/secring.gpg
/etc/apt/trustdb.gpg
There are also references to /var/lib/apt/keyrings which are probably in the same
situation.
Not a patch (and would probably require -o support as well for my use case), but I could get
"add" to work for me with:
$ diff -u /usr/bin/apt-key .
--- /usr/bin/apt-key 2011-04-15 21:06:00.000000000 +0000
+++ ./apt-key 2011-07-04 17:04:51.462197369 +0000
@@ -5,7 +5,7 @@
# We don't use a secret keyring, of course, but gpg panics and
# implodes if there isn't one available
-GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg"
+GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring $PWD/secring.gpg --trustdb-name $PWD/trustdb.gpg"
GPG="$GPG_CMD"
MASTER_KEYRING=""
@@ -145,7 +145,7 @@
# otherwise use the default
else
#echo "generate list"
- TRUSTEDFILE="/etc/apt/trusted.gpg"
+ TRUSTEDFILE="$PWD/trusted.gpg"
eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
if [ -r "$TRUSTEDFILE" ]; then
And apt-get -o Dir::Etc=$PWD/etc is (at last) happy after that.
Reply to: