From: genone Date: Wed, 8 Dec 2004 09:55:21 +0000 (-0000) Subject: minor bugfixes for glsa-check and equery X-Git-Tag: gentoolkit-0.2.4.3~329 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0a60845755448c92c818a8a3c9d70b1c6c8f7ff3;p=gentoolkit.git minor bugfixes for glsa-check and equery svn path=/; revision=177 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index fa9ca84..644b4cc 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2004-12-08 Marius Mauch + * equery: implemented the --category option + * glsa-check: fixed the bug where it wanted to unnecessary merge masked packages + 2004-11-29 Karl Trygve Kalleberg * branched v0-3-0: major rework in equery is in progess. the main branch is reserved for minor and incremental fixups. diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index bd7139b..079c15b 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -343,7 +343,7 @@ class CmdListBelongs(Command): #cnt = pkg.get_contents() if not cnt: return for file in cnt.keys(): - if rx.search(file): + if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]): print pkg return @@ -356,7 +356,7 @@ class CmdListBelongs(Command): #cnt = pkg.get_contents() if not cnt: return for file in cnt.keys(): - if rx.search(file): + if rx.search(file) and (opts["category"] == "*" or portage.catpkgsplit(pkg)[0] == opts["category"]): s = pkg + " (" + pp.path(fileAsStr(file, cnt[file])) + ")" print_info(0, s) if opts["earlyOut"]: @@ -1555,8 +1555,7 @@ if __name__ == "__main__": try: cmd.perform(local_opts) except KeyError, e: - if e and type(e[0]) == types.ListType and \ - string.find(e[0], "Specific key requires operator") == 0: + if e and string.find(e[0], "Specific key requires an operator") >= 0: print_error("Invalid syntax: missing operator") print_error("If you want only specific versions please use one of") print_error("the following operators as prefix for the package name:") @@ -1567,18 +1566,18 @@ if __name__ == "__main__": else: print_error("Internal portage error, terminating") if len(e[0]): - print_error(e) + print_error(str(e)) sys.exit(2) except ValueError, e: if e and type(e[0]) == types.ListType: print_error("Ambiguous package name " + pp.emph("\"" + local_opts[0] + "\"")) print_error("Please use one of the following long names:") for p in e[0]: - print_error(" " + p) + print_error(" " + str(p)) else: print_error("Internal portage error, terminating") if len(e[0]): - print_error(e[0]) + print_error(str(e[0])) sys.exit(2) except KeyboardInterrupt: print_info(0, "Interrupted by user, aborting.") diff --git a/trunk/src/glsa-check/glsa.py b/trunk/src/glsa-check/glsa.py index dc7fd8e..c142088 100644 --- a/trunk/src/glsa-check/glsa.py +++ b/trunk/src/glsa-check/glsa.py @@ -364,7 +364,7 @@ def getMinUpgrade(vulnerableList, unaffectedList): for c in mylist: c_pv = portage.catpkgsplit(c) i_pv = portage.catpkgsplit(portage.best(v_installed)) - if portage.pkgcmp(c_pv[1:], i_pv[1:]) > 0 and (rValue == None or portage.pkgcmp(c_pv[1:], rValue) < 0): + if portage.pkgcmp(c_pv[1:], i_pv[1:]) > 0 and (rValue == None or portage.pkgcmp(c_pv[1:], portage.catpkgsplit(rValue)[1:]) < 0): rValue = c_pv[0]+"/"+c_pv[1]+"-"+c_pv[2] if c_pv[3] != "r0": # we don't like -r0 for display rValue += "-"+c_pv[3]