[Yum] Yum output and term size

James Antill james-yum at and.org
Mon Feb 2 18:55:01 UTC 2009


pirla <the.pirla at gdit.it> writes:

>>  If the output is going to a non-terminal then yum can't find out how
>> big it is. So the only way to make "yum blah" and "yum blah | cat"
>> look the same is to guess at what the terminal size is.
>
> But yum can understand that is sending output to a non terminal

 No, it knows that what it is writing to isn't a terminal but it
doesn't know where the data ends up.

>>  You might be arguing that a default size of say "1000" is more often
>> correct than the current default of 80. I disagree, do you have any
>> data? You might argue that piping the output to anything means that
>> people want the output to look different ... and I would disagree very
>> strongly that people would expect that.
>
> 1000 or 80 is the same... If one need 1001.
> That should be everytime wrong.
> The right solution is to permit infinite lenght.
> Parsing output in this way is easier.
> grep, less, awk and so on ca be used to build complex scripts.

 This implies that yum output is meant for tools first and humans
second, we disagree. For instance most users would expect that given:

yum list yum
yum list yum | fgrep blah

...the second one would output the lines that the first one did which
contain the string blah. Changing the wrapping would break this.

 Again, the advise is always "if you are doing code it's much better
to just use the python API" ... we can easily keep compatibility with
that etc. so your scripts will work "forever".

-- 
James Antill -- james at and.org


More information about the Yum mailing list