]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-key
* Merged from the mvo branch
[apt.git] / cmdline / apt-key
index 26aa55633c148545f0f121777cc86b43e4e61ddb..b579e5a53c94aeae1928bfeecba103f9729445ef 100755 (executable)
@@ -90,13 +90,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
 }