Hi,

it had been pointed out that there would be no way for apt-listbugs to
know whether apt-get had been given a -q/--quiet option, to produce
loggable output only, i.e., without frequently updated progress
indicators. This seems to be mistaken.


Confer apt-get(8):

| -q, --quiet
|    Quiet; produces output suitable for logging, omitting progress
|    indicators. [...] Configuration Item: quiet.

And this (the configuration item) seems to be where, e.g.,
apt-listchanges gets this information from.


Code snippet from /usr/bin/apt-listchanges:

| def main():
[...]
| 
|     if config.apt_mode:
|         debs = apt_listchanges.read_apt_pipeline(config)
| 
[...]
| 
|     # If apt is in quiet (loggable) mode, we should make our output
|     # loggable too
|     if config.quiet == 1:
|         config.frontend = 'text'
|     elif config.quiet >= 2:
|         config.frontend = 'mail'


Code snippet from /usr/share/apt-listchanges/apt_listchanges.py:

| def read_apt_pipeline(config):
|     version = sys.stdin.readline().rstrip()
|     if version != "VERSION 2":
|         sys.stderr.write(_('''Wrong or missing VERSION from apt pipeline
| (is Dpkg::Tools::Options::/usr/bin/apt-listchanges::Version set to 2?)
| '''))
|         sys.exit(1)
| 
|     while 1:
|         line = sys.stdin.readline().rstrip()
|         if not line:
|             break
| 
|         if line.startswith('quiet='):
|             config.quiet = int(line[len('quiet='):])


Confer apt.conf(5):

| Pre-Install-Pkgs
|    This is a list of shell commands to run before invoking dpkg. Like
|    options this must be specified in list notation. The commands are
|    invoked in order using /bin/sh, should any fail APT will abort. APT
|    will pass to the commands on standard input the filenames of all .deb
|    files it is going to install, one per line.
| 
|    Version 2 of this protocol dumps more information, including the
|    protocol version, the APT configuration space and the packages, files
|    and versions being changed. Version 2 is enabled by setting
|    DPkg::Tools::options::cmd::Version to 2.  cmd is a command given to
|    Pre-Install-Pkgs.


And indeed this is set in /etc/apt/apt.conf.d/20listchanges:

| DPkg::Pre-Install-Pkgs { "/usr/bin/apt-listchanges --apt || test $? -ne 10"; 
};
| DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";


So it would seem quite possible now to integrate --quiet awareness into
apt-listbugs, too.

Regards, Fabian

-- 
Fabian "zzz" Pietsch - http://zzz.arara.de/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to