summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-12-21 12:51:23 +0000
committerZac Medico <zmedico@gentoo.org>2007-12-21 12:51:23 +0000
commite1ef3a42413627a11c807fd6c94f899da88a331a (patch)
tree4800433aadba7efbaf5143edf67f83830e76a73f /pym
parentImplement a `portageq contents <root> <category/package>` command (diff)
downloadportage-idfetch-e1ef3a42413627a11c807fd6c94f899da88a331a.tar.gz
portage-idfetch-e1ef3a42413627a11c807fd6c94f899da88a331a.tar.bz2
portage-idfetch-e1ef3a42413627a11c807fd6c94f899da88a331a.zip
Add support for --usepkg and --usepkgonly options together with
emerge --search. svn path=/main/trunk/; revision=9038
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index ad391e94..c905504a 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -398,7 +398,7 @@ class search(object):
# public interface
#
def __init__(self, root_config, spinner, searchdesc,
- verbose):
+ verbose, usepkg, usepkgonly):
"""Searches the available and installed packages for the supplied search key.
The list of available and installed packages is created at object instantiation.
This makes successive searches faster."""
@@ -422,10 +422,10 @@ class search(object):
bindb = root_config.trees["bintree"].dbapi
vardb = root_config.trees["vartree"].dbapi
- if portdb._have_root_eclass_dir:
+ if not usepkgonly and portdb._have_root_eclass_dir:
self._dbs.append(portdb)
- if bindb.cp_all():
+ if (usepkg or usepkgonly) and bindb.cp_all():
self._dbs.append(bindb)
self._dbs.append(vardb)
@@ -6117,7 +6117,8 @@ def action_search(root_config, myopts, myfiles, spinner):
else:
searchinstance = search(root_config,
spinner, "--searchdesc" in myopts,
- "--quiet" not in myopts)
+ "--quiet" not in myopts, "--usepkg" in myopts,
+ "--usepkgonly" in myopts)
for mysearch in myfiles:
try:
searchinstance.execute(mysearch)