If equery b file would return non-zero return code if no package owning the file it can be used in scripts (for example in form if equery b file; then) and in interactive scripting. If it is not possible from interface reasons the special option (like --script) would be mostly welcome. PS. Such convention may be used in other tools. Reproducible: Always
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 ***