From: Michael Vogt <michael.vogt@ubuntu.com>
Date: Thu, 24 Sep 2009 09:55:46 +0000 (+0200)
Subject: * cmdline/apt-key:
X-Git-Tag: 0.7.24ubuntu1~1^2~6
X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/364af2ef2aba2911b12379ec8b6e55874e4b0a31

* cmdline/apt-key:
  - Emit a warning if removed keys keyring is missing and skip associated
    checks (LP: #218971)
---

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
 }
 
 
diff --git a/debian/changelog b/debian/changelog
index cad223833..16e8929ad 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,17 @@
 apt (0.7.22.4) unstable; urgency=low
 
+  [ Michael Vogt ]
   * apt-pkg/deb/dpkgpm.cc:
     - when tcgetattr() returns non-zero skip all pty magic 
       (thanks to Simon Richter, closes: #509866)
   * apt-inst/contrib/arfile.cc:
     - show propper error message for Invalid archive members
 
+  [ Loïc Minier ]
+  * cmdline/apt-key:
+    - Emit a warning if removed keys keyring is missing and skip associated
+      checks (LP: #218971)
+
  -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 31 Aug 2009 11:08:03 +0200
 
 apt (0.7.22.3) UNRELEASED; urgency=low