summaryrefslogtreecommitdiff
path: root/cmdline/apt-key
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-01-26 15:51:45 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2010-01-26 15:51:45 +0100
commit51f9f4d78deabf54dbbb6881139d2b1a319ffbfc (patch)
tree60a2bcd8911acd5c4ab8b4558bfd30344b673ff5 /cmdline/apt-key
parent76fe5db7153957f8fda437e3bd614312b076f19e (diff)
parentc1f168f54be5b4babeb9b91cd7145441ea2489ad (diff)
merge from the mvo branch
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
}