From 3036f1e491ec1c71fb8fe9ff35954cebb2574320 Mon Sep 17 00:00:00 2001
From: Michael Vogt <michael.vogt@ubuntu.com>
Date: Wed, 25 Apr 2007 00:49:41 +0200
Subject: * NMU * Fix broken use of awk in apt-key that caused removal of the
 wrong keys   from the keyring. Closes: #412572

---
 cmdline/apt-key | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'cmdline/apt-key')

diff --git a/cmdline/apt-key b/cmdline/apt-key
index 7460a24be..90ecae2cf 100755
--- a/cmdline/apt-key
+++ b/cmdline/apt-key
@@ -24,9 +24,9 @@ update() {
     $GPG_CMD --quiet --batch --keyring $ARCHIVE_KEYRING --export | $GPG --ignore-time-conflict --import
 
     # remove no-longer used keys
-    keys=`$GPG_CMD --keyring $REMOVED_KEYS --with-colons --list-keys|awk '/^pub/{FS=":";print $5}'`
+    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 | awk '/^pub/{FS=":";print $5}'|grep -q $key; then
+	if $GPG --list-keys --with-colons | grep ^pub | cut -d: -f5 | grep -q $key; then
 	    $GPG --quiet --batch --delete-key --yes ${key}
 	fi
     done
-- 
cgit v1.2.3