summaryrefslogtreecommitdiff
path: root/cmdline/apt-key
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-12-02 17:22:32 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-12-02 17:22:32 +0100
commit16d7341fce96b089aa2a1c241acd0a72209bcd7f (patch)
treeb2bf899c035363fbc0b561f1006a787cb06527f0 /cmdline/apt-key
parent7efded877fcf46f51b464fe4c5e053f26609f9d0 (diff)
parent5085e660679cdbb51783702898c42000d5db4fba (diff)
* apt-pkg/packagemanager.cc:
- add output about pre-depends configuring when debug::pkgPackageManager is used * methods/https.cc: - fix incorrect use of CURLOPT_TIMEOUT, closes: #497983, LP: #354972 thanks to Brian Thomason for the patch * apt-pkg/depcache.cc, apt-pkg/indexcopy.cc: - typo fix (LP: #462328) * cmdline/apt-key: - Emit a warning if removed keys keyring is missing and skip associated checks (LP: #218971)
Diffstat (limited to 'cmdline/apt-key')
-rwxr-xr-xcmdline/apt-key18
1 files changed, 11 insertions, 7 deletions
diff --git a/cmdline/apt-key b/cmdline/apt-key
index 7bb30240e..5f4e02fdf 100755
--- a/cmdline/apt-key
+++ b/cmdline/apt-key
@@ -93,13 +93,17 @@ update() {
# add any security. we *need* this check on net-update though
$GPG_CMD --quiet --batch --keyring $ARCHIVE_KEYRING --export | $GPG --import
- # remove no-longer supported/used keys
- keys=`$GPG_CMD --keyring $REMOVED_KEYS --with-colons --list-keys | grep ^pub | cut -d: -f5`
- for key in $keys; do
- if $GPG --list-keys --with-colons | grep ^pub | cut -d: -f5 | grep -q $key; then
- $GPG --quiet --batch --delete-key --yes ${key}
- fi
- done
+ if [ -r "$REMOVED_KEYS" ]; then
+ # remove no-longer supported/used keys
+ keys=`$GPG_CMD --keyring $REMOVED_KEYS --with-colons --list-keys | grep ^pub | cut -d: -f5`
+ for key in $keys; do
+ if $GPG --list-keys --with-colons | grep ^pub | cut -d: -f5 | grep -q $key; then
+ $GPG --quiet --batch --delete-key --yes ${key}
+ fi
+ done
+ else
+ echo "Warning: removed keys keyring $REMOVED_KEYS missing or not readable" >&2
+ fi
}