summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-08-25 15:22:28 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-08-25 15:22:28 +0200
commit29c590951f812d9e9c4f17706e34f2c3315fb1f6 (patch)
treec0b13f3a3020aad1f79042582961c5215a26a129 /cmdline
parent105503b4b470c124bc0c271bd8a50e25ecbe9133 (diff)
show apt-key warnings in apt update
In 105503b4b470c124bc0c271bd8a50e25ecbe9133 we got a warning implemented for unreadable files which greatly improves the behavior of apt update already as everything will work as long as we don't need the keys included in these files. The behavior if they are needed is still strange through as update will fail claiming missing keys and a manual test (which the user will likely perform as root) will be successful. Passing the new warning generated by apt-key through to apt is a bit strange from an interface point of view, but basically duplicating the warning code in multiple places doesn't feel right either. That means we have no translation for the message through as apt-key has no i18n yet. It also means that if the user has a bunch of sources each of them will generate a warning for each unreadable file which could result in quite a few duplicated warnings, but "too many" is better than none. Closes: 834973
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-key.in15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index d34f59497..199903d61 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -474,12 +474,27 @@ if [ -z "$command" ]; then
fi
shift
+find_gpgv_status_fd() {
+ while [ -n "$1" ]; do
+ if [ "$1" = '--status-fd' ]; then
+ shift
+ echo "$1"
+ break
+ fi
+ shift
+ done
+}
+GPGSTATUSFD="$(find_gpgv_status_fd "$@")"
+
warn() {
if [ -z "$GPGHOMEDIR" ]; then
echo >&2 'W:' "$@"
else
echo 'W:' "$@" > "${GPGHOMEDIR}/aptwarnings.log"
fi
+ if [ -n "$GPGSTATUSFD" ]; then
+ echo >&${GPGSTATUSFD} '[APTKEY:] WARNING' "$@"
+ fi
}
cleanup_gpg_home() {