Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 497232 - app-portage/eix-0.30.0 display message about items limit, when limit not outreached
Summary: app-portage/eix-0.30.0 display message about items limit, when limit not outr...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: All Linux
: Normal trivial (vote)
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-06 10:25 UTC by Alexander Turenko
Modified: 2014-02-02 23:38 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Turenko 2014-01-06 10:25:41 UTC
More specific: message about limits displayed, when count of items equal to limit.

Reproducible: Always

Steps to Reproduce:
$ LANG=C EIX_LIMIT=1 eix eix
[...skip one found item...]
Only 1 matches displayed on terminal.
Set EIX_LIMIT=0 to show all matches.
Actual Results:  
Message about items displayed.

Expected Results:  
Do not display this message.

Possible fix (not tested):
change if expression in src/eix.cc code
if(unlikely(count == limit)) {
    reached_limit = true;
}
to unlikely(count > limit).
Comment 1 Martin Väth 2014-01-06 15:36:46 UTC
This is not so easy to fix, since it is not known a-priori whether the call to PrintFormat::print() will produce an output; one would need a "test mode" for that function which just checks whether something would be printed and if yes only then sets reached_limit - in advance.

However, such a "test mode" would require changes in every output function (and then also costs a considereable execution time or duplication of code). I am not sure whether this is worth the effort (of programming and execution time).

Perhaps the current (suboptimal) solution is sufficient since its main purpose is to stop producing huge lists on the terminal by a typo.
For the extreme cases when you want to restrict to 1 or 2 packages (I guess that this is what you have in mind) there are the options --brief and --brief2 which do not print the undesired output.
Comment 2 Alexander Turenko 2014-01-06 20:08:37 UTC
Thanks for you answer.

I chance found this peculiarity, and report. It not too critical factor for me considering what this hard to fix.
Comment 3 Martin Väth 2014-01-08 19:00:28 UTC
Calculating the *correct* number of packages when the limit is reached requires the same effort/speed loss.

Both issues are fixed in git master of eix on BerliOS (>=eix-0.30.1).
Comment 4 Martin Väth 2014-02-02 23:38:42 UTC
Closing since eix-0.30.1 with the fix is now in the tree.