From 2ca7e5fbf77548de093a48c0f2146a3727007502 Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Sun, 28 Sep 2008 23:38:28 +0000 Subject: [PATCH] Add a new DummyPackageSet handler to make set operators easier to use svn path=/main/trunk/; revision=11598 --- pym/portage/sets/base.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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) -- 2.26.2