summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-08-17 08:10:29 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-08-17 14:12:24 +0200
commite289907f5e7241034cb0d37055dc2cba4e3a19af (patch)
tree8fef91c97dda2b848d73e5e3a15fe3e9449c48fd /cmdline
parent19fdf93d7363261227811a62157063081b9f1a5d (diff)
allow spaces in fingerprints for 'apt-key del'
Fingerprints tend to be displayed in space-separated octet pairs so be nice and allow delete to remove a key based on such a string rather than requiring that the user is deleting all the spaces manually.
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-key.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index aff75c300..81314c7f5 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -200,8 +200,8 @@ remove_key_from_keyring() {
local FINGERPRINTS="${GPGHOMEDIR}/keyringfile.keylst"
get_fingerprints_of_keyring "$KEYRINGFILE" > "$FINGERPRINTS"
- # strip leading 0x, if present:
- KEY="${KEY#0x}"
+ # strip leading 0x, if present:
+ KEY="$(echo "${KEY#0x}" | tr -d ' ')"
# check if the key is in this keyring
if ! grep -iq "^[0-9A-F]*${KEY}$" "$FINGERPRINTS"; then