From 031a3f254a2a73b2843ead28a2481b63ec1d7244 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 6 Mar 2016 10:16:59 +0100 Subject: add test for apt-key 0xKEY and use parameter expansion Fixed in f7bd44bae0d7cb7f9838490b5eece075da83899e already, but the commit misses the Closes tag and while we are at it we can add a simple regression test and micro-optimize it a bit. Thanks: James McCoy for the suggestion. Closes: 816691 --- cmdline/apt-key.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index cfd4be35d..3ed2a70ce 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -193,7 +193,7 @@ remove_key_from_keyring() { get_fingerprints_of_keyring "$KEYRINGFILE" > "$FINGERPRINTS" # strip leading 0x, if present: - KEY="$(printf %s "$KEY" | sed s/^0x//)" + KEY="${KEY#0x}" # check if the key is in this keyring if ! grep -iq "^[0-9A-F]*${KEY}$" "$FINGERPRINTS"; then -- cgit v1.2.3