[Aptitude-devel] Bug#797785: Bug#797785: aptitude: TUI to catch debtags warnins/errors

Manuel A. Fernandez Montecelo manuel.montezelo at gmail.com
Sun Jan 10 22:07:22 UTC 2016


2016-01-10 21:36 GMT+00:00 Julian Andres Klode <jak at debian.org>:
> On Sun, Jan 10, 2016 at 07:01:45PM +0000, Manuel A. Fernandez Montecelo wrote:
>> Control: tags -1 - unreproducible
>>
>>
>> @ APT deities: could you please have a look at the bug report and tell
>>              me your opinion?
>>
>>
>> Hi,
>>
>> 2016-01-10 16:56 Pavel Reznicek:
>> >
>> >Hi,
>> >
>> >>How/when does the errors show, when viewing the package information
>> >>screen, or with other operations?
>> >
>> >The error messages appears after running "Update package list" from the
>> >aptitude ncruses gui. Attached is a screenshot.
>>
>> Oh, I see, I can reproduce it now.  It happens the same with "apt-get
>> update" (see below).
>>
>> The problem seems to be that the in the function RunScripts() from
>> libapt, when executing debtags (it has to be installed on the system),
>> the output of the program doesn't get silenced/captured in any way, just
>> printed to the terminal as it is.
>>
>> I don't know if the APT team can or will want to change this behaviour
>> (to add this output to the apt error mechanism, for example).  It
>> doesn't seem to be a big problem for apt, not having curses interfaces,
>> but this might affect other users of the library.
>>
>> I am not sure if we can do much about this from aptitude's side,
>> otherwise.
>
> Well, you could.
>
> You could open a pipe for stderr and read from it, and display
> that in an aptitude window. That is, do the following:
>
> 1. dup(STDERR_FILENO) = stderr_backup
> 2. pipe(&fds)
> 3. dup2(fd[1], STDERR_FILENO)
>
> Then you can read any stderr output from fd[0] and display it
> inside aptitude.

Yes, something like that would be possible.  It would have to be
repeated for every call to RunScripts() (3 at the moment) or similar
functions, if they exhibit the same problem.

But thinking about it, it looks a bit silly to me to do it in this
way, and RunScripts() itself seems like a better place to centralise
this.

This message doesn't seem like something that front-ends are
interested in, but in other cases it might be.  For example in
synaptic this message gets lost or printed in the terminal if launched
from there (perhaps to .xsession-errors if not).

On the other hand, if the scripts shouldn't print anything under any
circumstance, maybe it's better to close the output FDs.


Cheers.
-- 
Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>



More information about the Aptitude-devel mailing list