X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b28fffc2825b807a26513f2ac5f34cb6e064acbf..3346b385523c596c1db7667b4874a8617718de70:/cmdline/apt-key diff --git a/cmdline/apt-key b/cmdline/apt-key index 7460a24be..3bd1a92d9 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 @@ -39,6 +39,8 @@ usage() { echo echo " apt-key add - add the key contained in ('-' for stdin)" echo " apt-key del - remove the key " + echo " apt-key export - output the key " + echo " apt-key exportall - output all trusted keys" echo " apt-key update - update keys using the keyring package" echo " apt-key list - list keys" echo @@ -75,6 +77,12 @@ case "$command" in finger*) $GPG --batch --fingerprint ;; + export) + $GPG --armor --export "$1" + ;; + exportall) + $GPG --armor --export + ;; adv*) echo "Executing: $GPG $*" $GPG $*