Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 144396 Details for
Bug 205118
equery b file should return 1 if file not found to be used in scripts
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
equery_false_if_no_results.patch
equery_false_if_no_results.patch (text/plain), 2.35 KB, created by
michael@smith-li.com
on 2008-02-22 23:50:38 UTC
(
hide
)
Description:
equery_false_if_no_results.patch
Filename:
MIME Type:
Creator:
michael@smith-li.com
Created:
2008-02-22 23:50:38 UTC
Size:
2.35 KB
patch
obsolete
>Index: equery >=================================================================== >--- equery (revision 474) >+++ equery (working copy) >@@ -391,45 +391,30 @@ > > found = 0 > >- def dumpToPipe(pkg): >- mysplit = pkg.split("/") >- cnt = portage.dblink(mysplit[0], mysplit[1], "/", gentoolkit.settings).getcontents() >- #cnt = pkg.get_contents() >- if not cnt: return >- for file in cnt.keys(): >- if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]): >- if opts["nameOnly"]: >- x = portage.catpkgsplit(pkg) >- print x[0]+"/"+x[1] >- else: >- print pkg >- return >- > class DummyExp: > pass > >- def dumpToScreen(pkg): >- mysplit = pkg.split("/") >- cnt = portage.dblink(mysplit[0], mysplit[1], "/", gentoolkit.settings).getcontents() >+ def printResults(pkg): >+ (cat, pf) = pkg.split('/') >+ pn = portage.catpkgsplit(pkg)[1] >+ cnt = portage.dblink(cat, pf, "/", gentoolkit.settings).getcontents() > #cnt = pkg.get_contents() >- if not cnt: return >+ retval = False >+ if not cnt: return retval >+ if not (opts["category"] in [cat, '*']): return retval > for file in cnt.keys(): >- if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]): >- if opts["nameOnly"]: >- x = portage.catpkgsplit(pkg) >- s = x[0]+"/"+x[1] >- else: >- s = pkg >+ if not rx.search(file): continue >+ s = pn >+ if opts["nameOnly"]: s = cat+"/"+s >+ if not(Config["piping"]): > s += " (" + pp.path(fileAsStr(file, cnt[file])) + ")" >- print_info(0, s) >- if opts["earlyOut"]: >- raise DummyExp >+ print_info(0, s) >+ if opts["earlyOut"]: raise DummyExp >+ retval = True >+ return retval > > try: >- if Config["piping"]: >- map(dumpToPipe, matches) >- else: >- map(dumpToScreen, matches) >+ return True in map(printResults, matches) > except DummyExp: > pass > >@@ -1793,7 +1778,8 @@ > (cmd, local_opts) = parseArgs(sys.argv[1:]) > if cmd: > try: >- cmd.perform(local_opts) >+ # Special exit status when perform returns False >+ if (None != cmd.perform(local_opts) == False): sys.exit(1) > except KeyError, e: > if e and e[0].find("Specific key requires an operator") >= 0: > print_error("Invalid syntax: missing operator") >@@ -1827,4 +1813,3 @@ > else: > print_error("No command or unknown command given") > printUsage() >-
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 205118
: 144396