summaryrefslogtreecommitdiff
path: root/cmdline/apt-key.in
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-01-24 16:43:19 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-09-27 00:12:13 +0200
commit3d0def059874a6e63566ce13579de296ccd26932 (patch)
tree5e50f8d91f6ecde8f3cc58d2b811f9db0836f65c /cmdline/apt-key.in
parent5b55915a9beca06c9993285aee9da9f4ac3bccc4 (diff)
downloadapt-3d0def059874a6e63566ce13579de296ccd26932.tar.gz
add a (hidden) --quiet option for apt-key
Diffstat (limited to 'cmdline/apt-key.in')
-rw-r--r--cmdline/apt-key.in14
1 files changed, 10 insertions, 4 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index 59b69b89c..d50ad40ac 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -39,6 +39,8 @@ ARCHIVE_KEYRING_URI='&keyring-uri;'
eval $(apt-config shell ARCHIVE_KEYRING_URI APT::Key::ArchiveKeyringURI)
TMP_KEYRING=${APT_DIR}/var/lib/apt/keyrings/maybe-import-keyring.gpg
+aptkey_echo() { echo "$@"; }
+
requires_root() {
if [ "$(id -u)" -ne 0 ]; then
echo >&1 "ERROR: This command can only be used by root."
@@ -142,7 +144,7 @@ net_update() {
fi
new_mtime=$(stat -c %Y $keyring)
if [ $new_mtime -ne $old_mtime ]; then
- echo "Checking for new archive signing keys now"
+ aptkey_echo "Checking for new archive signing keys now"
add_keys_with_verify_against_master_keyring $keyring $MASTER_KEYRING
fi
}
@@ -227,7 +229,7 @@ remove_key() {
done
fi
fi
- echo "OK"
+ aptkey_echo "OK"
}
@@ -267,6 +269,10 @@ while [ -n "$1" ]; do
requires_root() { true; }
shift
;;
+ --quiet)
+ aptkey_echo() { true; }
+ shift
+ ;;
--*)
echo >&2 "Unknown option: $1"
usage
@@ -316,7 +322,7 @@ case "$command" in
requires_root
init_keyring "$TRUSTEDFILE"
$GPG --quiet --batch --import "$1"
- echo "OK"
+ aptkey_echo "OK"
;;
del|rm|remove)
init_keyring "$TRUSTEDFILE"
@@ -348,7 +354,7 @@ case "$command" in
;;
adv*)
init_keyring "$TRUSTEDFILE"
- echo "Executing: $GPG $*"
+ aptkey_echo "Executing: $GPG $*"
$GPG $*
;;
help)