Package: apt
Version: 1.3.1
Severity: normal
File: /usr/lib/apt/apt.systemd.daily
Tags: patch
The documentation of APT::Periodic::Verbose doesn't match the code,
specifically level 2 should apply some things differently to level 1
but does not because it uses `-le 2` instead of `-lt 2` or `-le 1`.
I've opted to fix the code instead of the docs, patch attached.
# APT::Periodic::Verbose "0";
# - Send report mail to root
# 0: no report (or null string)
# 1: progress report (actually any string)
# 2: + command outputs (remove -qq, remove 2>/dev/null, add -d)
# 3: + trace on
...
# Set VERBOSE mode from apt-config (or inherit from environment)
VERBOSE=0
eval $(apt-config shell VERBOSE APT::Periodic::Verbose)
debug_echo "verbose level $VERBOSE"
if [ "$VERBOSE" -le 2 ]; then
# quiet for 0,1,2
XSTDOUT=">/dev/null"
XSTDERR="2>/dev/null"
XAPTOPT="-qq"
XUUPOPT=""
else
XSTDOUT=""
XSTDERR=""
XAPTOPT=""
XUUPOPT="-d"
fi
if [ "$VERBOSE" -ge 3 ]; then
# trace output
set -x
fi
...
debug_echo()
{
# Display message if $VERBOSE >= 1
if [ "$VERBOSE" -ge 1 ]; then
echo $1 1>&2
fi
}
-- System Information:
Debian Release: stretch/sid
APT prefers testing-debug
APT policy: (900, 'testing-debug'), (900, 'testing'), (800, 'unstable-debug'), (800, 'unstable'), (790, 'buildd-unstable'), (700, 'experimental-debug'), (700, 'experimental'), (690, 'buildd-experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 4.8.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages apt depends on:
ii adduser 3.115
ii debian-archive-keyring 2014.3
ii gpgv 2.1.15-9
ii init-system-helpers 1.46
ii libapt-pkg5.0 1.3.1
ii libc6 2.24-5
ii libgcc1 1:6.2.0-13
ii libstdc++6 6.2.0-13
Versions of packages apt recommends:
ii gnupg 2.1.15-9
ii gnupg1 1.4.21-2
ii gnupg2 2.1.15-9
Versions of packages apt suggests:
pn apt-doc <none>
ii aptitude 0.8.3-1+b2
ii dpkg-dev 1.18.15
ii powermgmt-base 1.31+nmu1
ii python-apt 1.1.0~beta5
-- no debconf information
--
bye,
pabs
https://wiki.debian.org/PaulWise
From 3cbaa5973e34c34a59183626254cad07187f26cf Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs@debian.org>
Date: Fri, 25 Nov 2016 11:08:54 +0800
Subject: [PATCH] Make APT::Periodic::Verbose 2 match the documentation
---
debian/apt.systemd.daily | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily
index d034d8c..03d41ba 100755
--- a/debian/apt.systemd.daily
+++ b/debian/apt.systemd.daily
@@ -320,8 +320,8 @@ fi
VERBOSE=0
eval $(apt-config shell VERBOSE APT::Periodic::Verbose)
debug_echo "verbose level $VERBOSE"
-if [ "$VERBOSE" -le 2 ]; then
- # quiet for 0,1,2
+if [ "$VERBOSE" -le 1 ]; then
+ # quiet for 0/1
XSTDOUT=">/dev/null"
XSTDERR="2>/dev/null"
XAPTOPT="-qq"
--
2.10.2
Attachment:
signature.asc
Description: This is a digitally signed message part