summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgenone <genone@gentoo.org>2004-12-08 09:55:21 +0000
committergenone <genone@gentoo.org>2004-12-08 09:55:21 +0000
commit0a60845755448c92c818a8a3c9d70b1c6c8f7ff3 (patch)
tree0c1e90ba86dd65850a132b9b7d9c122107de57a0
parent123acc5496d8a56de80882745e43c23acaa805c6 (diff)
downloadgentoolkit-0a60845755448c92c818a8a3c9d70b1c6c8f7ff3.tar.gz
minor bugfixes for glsa-check and equery
svn path=/; revision=177
-rw-r--r--trunk/ChangeLog4
-rwxr-xr-xtrunk/src/equery/equery13
-rw-r--r--trunk/src/glsa-check/glsa.py2
3 files changed, 11 insertions, 8 deletions
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 <genone@gentoo.org>
+ * equery: implemented the --category option
+ * glsa-check: fixed the bug where it wanted to unnecessary merge masked packages
+
2004-11-29 Karl Trygve Kalleberg <karltk@gentoo.org>
* 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]