summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2008-09-28 23:38:28 +0000
committerMarius Mauch <genone@gentoo.org>2008-09-28 23:38:28 +0000
commit2ca7e5fbf77548de093a48c0f2146a3727007502 (patch)
tree2722ff5190bcd5a46ac9449a6f9764d112a626e5
parent9578cd96d673cca832093b8ae0d06907fbefcf6a (diff)
downloadportage-2ca7e5fbf77548de093a48c0f2146a3727007502.tar.gz
portage-2ca7e5fbf77548de093a48c0f2146a3727007502.tar.bz2
portage-2ca7e5fbf77548de093a48c0f2146a3727007502.zip
Add a new DummyPackageSet handler to make set operators easier to use
svn path=/main/trunk/; revision=11598
-rw-r--r--pym/portage/sets/base.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pym/portage/sets/base.py b/pym/portage/sets/base.py
index 4de3e847d..370b03d45 100644
--- a/pym/portage/sets/base.py
+++ b/pym/portage/sets/base.py
@@ -219,3 +219,16 @@ class InternalPackageSet(EditablePackageSet):
def write(self):
pass
+class DummyPackageSet(PackageSet):
+ def __init__(self, atoms=None):
+ super(DummyPackageSet, self).__init__()
+ if atoms:
+ self._setAtoms(atoms)
+
+ def load(self):
+ pass
+
+ def singleBuilder(cls, options, settings, trees):
+ atoms = options.get("packages", "").split()
+ return DummyPackageSet(atoms=atoms)
+ singleBuilder = classmethod(singleBuilder)