[Aptitude-devel] Bug#720074: aptitude: When piping, stdout doesn't include "RECOMMENDED but will not be installed"

Manuel A. Fernandez Montecelo manuel.montezelo at gmail.com
Sun Feb 9 01:05:19 UTC 2014

forcemerge 647474 720074
severity 647474 minor
owner 647474 !
tags 647474 + patch moreinfo


The problem was introduced here in 2007, after a feature request which
was previously implemented in Ubuntu:


The basic problem is that showing the recommends in command line mode
depends on the option "Quiet" (which can be set by "-q" in the command
line, or "-o Quiet=integer").

It turns out that in src/main.cc, this option is set up automatically
to a positive number if the output is not a tty (the case of pipes or
redirections), even if the user didn't request it through the command
line explicitly:

  int curr_quiet = aptcfg->FindI("quiet", 0);
    aptcfg->SetNoUser("quiet", quiet);
  if(quiet == 0 && !isatty(1))
    aptcfg->SetNoUser("quiet", std::max(curr_quiet, 1));

The code above cannot be "fixed", since the "progress" operations
depend on this to work correctly.

I created the patch, attached.  The solution is not very good for my
taste, but Daniel Burrows solved it in this way, attaching this
message to the "Quiet" option (which doesn't happen for any other
output than progress-like), so this is the quick and dirty fix chaning
behaviour minimally and fixing this problem.

I say minimally because I don't think that users will rely (and thus,
complain if changes behaviour) on something as subtle as setting the
option -q explicitly while using pipes/redirection for other reasons,
to specifically avoid printing this message.

My prefered solution would be to do like with
Suggests-Will-Not-Install, that is, only show
Recommended-Will-Not-Install if verbose>0 (as the patch from Ubuntu,
but Daniel Burrows didn't like the solution, and I don't know why).
Or alternatively, show it inconditionally (which probably users didn't
like, and that's why Ubuntu implemented a solution).


Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-for-647474.patch
Type: text/x-patch
Size: 832 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/aptitude-devel/attachments/20140209/9d921c0f/attachment-0001.bin>

More information about the Aptitude-devel mailing list