[gobolinux-users] Freshen 2.2.6: failed when stdin and stdout are redirected?

Michael Homer gobo-users-dufus at wotfun.com
Sun Aug 26 22:59:52 UTC 2007


On 8/26/07, rubisher <rubisher at scarlet.be> wrote:
> Hello Michael,
>
> With this release 2.2.6 of Freshen, when I redirect stdin and stdout, it failed:
> # Freshen -U KDE-Base 2>&1 | tee /var/tmp/Freshen-KdeBase.doc
> Freshen: Producing updates list...
> Freshen: Examining only KDE-Base
> Backtrace:
>    /usr/local/sbin/Freshen:637:in `progStatus'
>    /usr/local/sbin/Freshen:326:in `upgradeSystem'
>    /usr/local/sbin/Freshen:325:in `each'
>    /usr/local/sbin/Freshen:325:in `upgradeSystem'
>    /usr/local/sbin/Freshen:183:in `run'
>    /System/Links/Libraries/ruby/site_ruby/1.8/gobo.rb:187:in `start'
>    /usr/local/sbin/Freshen:694
> [IUR] Xorg 7.2-r5 (KDE-Base)                                          7.2-r2
> [IUR] Cairo 1.4.2-r1 (Pango)                                           1.4.0
> [IUR] Pango 1.16.2-r1 (DBus)                                          1.16.0
> [IUR] GTK+ 2.10.11-r2 (DBus)                                      2.10.11-r1
> [IUR] DBus 1.0.2-r3 (KDE-Base)                                      1.0.2-r2
> Freshen: Error: undefined method `+' for nil:NilClass [NoMethodError]
>
> while it doesn't show this pb when I doesn't redirect std in/out:
I don't think you did redirect stdin, did you? In any case, I don't
think Freshen reads anything, so it shouldn't matter if you do,
although if it calls Compile for anything you might be in trouble.
Freshen also doesn't output anything to standard error, so you can
save some typing and leave that part out.

You have uncovered a bug when STDOUT is not a tty, though: you can fix
it by changing line 21 of lib/screen.rb to "Colours = Hash.new('')",
or check out from CVS. I will release a new version with that at some
point (when there are more substantive changes to make). The problem
arises because it doesn't show colours if it detects it's not going
directly to a tty. I'm not sure whether that's even a desirable
behaviour any more, come to think of it.
-Michael


More information about the gobolinux-users mailing list