# public interface
#
def __init__(self, settings, trees, 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."""
bindb = trees["bintree"].dbapi
vardb = 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)
else:
searchinstance = search(settings, trees,
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)