from portage import os
from portage import xpak
from portage.dbapi.dep_expand import dep_expand
-from portage.dep import use_reduce
+from portage.dep import Atom, extended_cp_match, use_reduce
from portage.exception import InvalidAtom, InvalidData, InvalidDependString, \
PackageSetNotFound, PermissionDenied
from portage.util import ConfigProtect, ensure_dirs, shlex_split
for atom in atoms:
quickpkg_atom(options, infos, atom, eout)
+
+def quickpkg_extended_atom(options, infos, arg, eout):
+ root = portage.settings["ROOT"]
+ trees = portage.db[root]
+ vartree = trees["vartree"]
+ vardb = vartree.dbapi
+
+ try:
+ atom = Atom(arg, allow_wildcard=True, allow_repo=True)
+ except (InvalidAtom, InvalidData):
+ eout.eerror("Invalid atom: %s" % (arg,))
+ infos["missing"].append(arg)
+ return
+
+ require_metadata = atom.slot or atom.repo
+ atoms = []
+ for cpv in vardb.cpv_all():
+ cpv_atom = Atom("=%s" % cpv)
+ if not extended_cp_match(atom.cp, cpv_atom.cp):
+ continue
+
+ if require_metadata:
+ slot, repo = vardb.aux_get(cpv, ["SLOT", "repository"])
+
+ if atom.slot and atom.slot != slot:
+ continue
+
+ if atom.repo and atom.repo != repo:
+ continue
+
+ atoms.append(cpv_atom)
+
+ for atom in atoms:
+ quickpkg_atom(options, infos, atom, eout)
+
+
def quickpkg_main(options, args, eout):
root = portage.settings["ROOT"]
trees = portage.db[root]
for arg in args:
if arg[0] == SETPREFIX:
quickpkg_set(options, infos, arg, eout)
+ elif '*' in arg:
+ quickpkg_extended_atom(options, infos, arg, eout)
else:
quickpkg_atom(options, infos, arg, eout)