Problem with RPM::Interactive=false when running apt-rpm through a pipe

Panu Matilainen pmatilai at laiskiainen.org
Sat Aug 5 23:12:49 PDT 2006


Logan Rathbone wrote:
> Dear Panu and the other followers of the apt-rpm mailing list:
>
> I've noticed a strange problem with the latest apt-rpm (lorg3.2) in
> combination with rpm 4.4.5 -- I am not exactly sure what has gone wrong,
> but previously with rpm 4.2 and apt cnc7 I was not experiencing this
> problem.  Here goes...
>
> When RPM::Interactive=false, apt sends the options "-Uv" and "--percent"
> to rpm.  This gets apt/rpm to spit the percentage numbers line-by-line
> to STDOUT (or so I thought).  And indeed, this works when running, for
> instance, "apt-get -o RPM::Interactive=false install foobar" -- but with
> the above command piped to 'cat' (as in "apt-get -o
> RPM::Interactive=false install foobar |cat"), the percentages do not
> show up, and output is given to STDOUT as though --percentage were
> nonexistent.
>
> At first I thought, "ah, RPM must have changed its behaviour with this
> option wrt pipes" -- but then I tried "rpm -Uvh --percent somerpm.rpm
> |cat" and the percentage numbers showed up just fine.
>
> This behaviour working is sort of important to me since I have written a
> Perl-Qt program that acts as a GUI frontend for apt-rpm, but the
> progress dialogs do not work if I can't have these percentage numbers
> properly sent to STDOUT whilst following the apt-rpm process with my
> Perl-Qt program.
>
> I realise that this is a rather long-winded and probably confusing "bug
> report" -- feel free to ask follow-up questions if you would like me to
> clarify something.  I would really like to try to assist you in getting
> this working.

Not confusing at all, although my first reaction was also "rpm must've
done something strange, that code in apt-rpm hasn't changed since cnc7."
But there IS one related change, and that's the thing that causes this:

svn diff -r147:148 http://svn.laiskiainen.org/apt-rpm/trunk/

The change seems innocent enough, but as quiet mode gets enabled
automatically if stdout is not a tty... well, duh. The attached patch
ought to take care of this while maintaining the intended behavior of the
above change (committed to trunk and also in the lorg3.x branch so next
maintenance release will have it as well)

What IS a bit confusing about this is how come Synaptic which also relies
on RPM::Interactive=false didn't break.

   - Panu -
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apt-0.5.15lorg3.2-noninteractive.patch
Type: text/x-patch
Size: 776 bytes
Desc: not available
URL: <http://lists.laiskiainen.org/pipermail/apt-rpm-laiskiainen.org/attachments/20060806/ae003e37/attachment-0003.bin>


More information about the Apt-Rpm mailing list