Summary: | equery b file should return 1 if file not found to be used in scripts | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Maciej Piechotka <uzytkownik2> |
Component: | Tools | Assignee: | Portage Tools Team <tools-portage> |
Status: | RESOLVED DUPLICATE | ||
Severity: | enhancement | CC: | michael |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | equery_false_if_no_results.patch |
Description
Maciej Piechotka
2008-01-09 21:04:15 UTC
What's wrong with: [ "$(equery -q b ${file})" = "" ] Created attachment 144396 [details, diff] equery_false_if_no_results.patch (In reply to comment #1) > What's wrong with: > > [ "$(equery -q b ${file})" = "" ] Well, that requires both a subshell and a call to test, which is more overhead than should be required. Furthermore it's generally verbose and error prone. (What if an overzealous dev decides to output "no results found" and forgets about the -q?) Tracking whether or not we got results inside equery seems like a worthwhile step on the way to future enhancements anyway. Here's a patch against SVN revision 474 I should've mentioned in comment #2 that that patch only applies to equery 'belongs' -- if you want me to apply it to other features, say so. Furthermore it consolidates the dumpToScreen(pkg) and dumpToPipe(pkg) functions, because they were almost entirely the same. Sorry for the bugspam. I think this bug is a dupe of 114086 *** This bug has been marked as a duplicate of bug 114086 *** |