summaryrefslogtreecommitdiff
path: root/trunk
diff options
context:
space:
mode:
authorgenone <genone@gentoo.org>2004-01-23 05:06:08 +0000
committergenone <genone@gentoo.org>2004-01-23 05:06:08 +0000
commitcb6e7e4786c7c13ab9905fe76f44c943e716a41f (patch)
treebcf1b967850d989485503bf33536889c11f00782 /trunk
parent82827505fd9bc5e3e86b14ab02ee239372950ab9 (diff)
downloadgentoolkit-cb6e7e4786c7c13ab9905fe76f44c943e716a41f.tar.gz
extended find_packages to optionally return masked packages
(needed for etcat -v to function properly) svn path=/; revision=72
Diffstat (limited to 'trunk')
-rwxr-xr-xtrunk/src/etcat/etcat6
-rw-r--r--trunk/src/gentoolkit/gentoolkit.py8
2 files changed, 9 insertions, 5 deletions
diff --git a/trunk/src/etcat/etcat b/trunk/src/etcat/etcat
index 2ef5b9f..e4e03f7 100755
--- a/trunk/src/etcat/etcat
+++ b/trunk/src/etcat/etcat
@@ -242,10 +242,12 @@ def changes(query, matches):
# `-------------------------------------------------------'
def versions(query, matches):
+ # this function should also report masked packages
+ matches = gentoolkit.find_packages(query, masked=True)
if not report_matches(query,matches):
return
- # sorting result list
+ # sorting result list
matches = gentoolkit.sort_package_list(matches)
# FIXME: old version printed result of regex search on name,
@@ -651,7 +653,7 @@ def main():
print red("!!!"), " "+p
else:
print red("!!!"), "Internal portage error, terminating"
- if len(e[0])):
+ if len(e[0]):
print red("!!!"), e[0]
sys.exit(2)
function = globals()[action]
diff --git a/trunk/src/gentoolkit/gentoolkit.py b/trunk/src/gentoolkit/gentoolkit.py
index 14241ee..b300c39 100644
--- a/trunk/src/gentoolkit/gentoolkit.py
+++ b/trunk/src/gentoolkit/gentoolkit.py
@@ -181,10 +181,12 @@ class Package:
# Global helper functions
#
-def find_packages(search_key):
+def find_packages(search_key, masked=False):
"""Returns a list of Package objects that matched the search key."""
- # FIXME: this one failes if search_key contains version suffix
- t=portage.portdb.match(search_key)
+ if masked:
+ t=portage.portdb.xmatch("match-all", search_key)
+ else:
+ t=portage.portdb.match(search_key)
return [Package(x) for x in t]
def find_best_match(search_key):