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

Xiangyu Liu u122334 at gmail.com
Sun Feb 9 02:23:04 UTC 2014


Hi,

I personally think that the "-v" solution as you mentioned is good enough,
cause most users don't care these "recommend" or "suggestion" messages,
even "installed" things, they just want a "out of box" application. For
people want specific information, like me, "-v" would be a smart thing.

At this moment, it seems that I have to apply this patch manually to get a
"custom aptitude".

Thanks for your information and patch !



2014-02-09 9:05 GMT+08:00 Manuel A. Fernandez Montecelo <
manuel.montezelo at gmail.com>:

> forcemerge 647474 720074
> severity 647474 minor
> owner 647474 !
> tags 647474 + patch moreinfo
> stop
>
> Hi,
>
> The problem was introduced here in 2007, after a feature request which
> was previously implemented in Ubuntu:
>
>   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452202
>
>
> 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);
>   if(seen_quiet)
>     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).
>
> Opinions?
>
> --
> Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/aptitude-devel/attachments/20140209/b1690260/attachment-0001.html>


More information about the Aptitude-devel mailing list