summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to 'portato')
-rw-r--r--portato/backend/portage/sets.py17
-rw-r--r--portato/backend/portage/system_22.py18
2 files changed, 35 insertions, 0 deletions
diff --git a/portato/backend/portage/sets.py b/portato/backend/portage/sets.py
index 2305c85..7984d3d 100644
--- a/portato/backend/portage/sets.py
+++ b/portato/backend/portage/sets.py
@@ -14,7 +14,14 @@ from __future__ import absolute_import, with_statement
import re
+import portage
+try:
+ import portage.dep as portage_dep
+except ImportError:
+ import portage_dep
+
from .. import system
+from ...helper import debug
class Set(object):
@@ -57,6 +64,15 @@ class FilterSet (Set):
return t
+class PortageSet (FilterSet):
+ def __init__ (self, name):
+ FilterSet.__init__(self)
+ debug("Loading portage set '%s'", name)
+ self.portageSet = system.settings.setsconfig.getSets()[name]
+
+ def get_list(self):
+ return self.portageSet.getAtoms()
+
class SystemSet (FilterSet):
def get_list(self):
@@ -126,3 +142,4 @@ class UninstalledSet (Set):
def find (self, *args, **kwargs):
return self.all.find(*args, **kwargs) - self.installed.find(*args, **kwargs)
+
diff --git a/portato/backend/portage/system_22.py b/portato/backend/portage/system_22.py
index 289849c..18e3b4e 100644
--- a/portato/backend/portage/system_22.py
+++ b/portato/backend/portage/system_22.py
@@ -20,6 +20,7 @@ from collections import defaultdict
from .package_22 import PortagePackage_22
from .settings_22 import PortageSettings_22
from .system import PortageSystem
+from . import sets as syssets
class PortageSystem_22 (PortageSystem):
@@ -30,6 +31,13 @@ class PortageSystem_22 (PortageSystem):
self.use_descs = {}
self.local_use_descs = defaultdict(dict)
+ self.setmap = {
+ self.SET_ALL : syssets.AllSet,
+ self.SET_INSTALLED : syssets.InstalledSet,
+ self.SET_UNINSTALLED : syssets.UninstalledSet,
+ self.SET_TREE : syssets.TreeSet
+ }
+
def has_set_support (self):
return True
@@ -39,5 +47,15 @@ class PortageSystem_22 (PortageSystem):
else:
return tuple(self.settings.setsconfig.getSets())
+ def _get_set (self, pkgSet):
+ pkgSet = pkgSet.lower()
+ if pkgSet == "": pkgSet = self.SET_ALL
+
+ s = self.setmap.get(pkgSet, None)
+ if s is None:
+ return syssets.PortageSet(pkgSet)
+ else:
+ return s()
+
def new_package (self, cpv):
return PortagePackage_22(cpv)
3d8b22b6a7073250f5698d5d8b397106f9686e&follow=1'>keep i18n up2dateRené 'Necoro' Neumann3-326/+366 2008-03-18corrected header commentRené 'Necoro' Neumann1-2/+2 2008-03-18Removed gtk subdirRené 'Necoro' Neumann21-134/+79 2008-03-18Removed wrapperRené 'Necoro' Neumann2-238/+184 2008-03-18Split and renamed gui_helperRené 'Necoro' Neumann4-249/+266 2008-03-18Splitted windows.pyRené 'Necoro' Neumann10-424/+549 2008-03-12Moved get_dependencies to top package classRené 'Necoro' Neumann4-50/+85 2008-03-11improved performance by caching the use_expand queriesRené 'Necoro' Neumann1-5/+14 2008-03-11use catapult varsRené 'Necoro' Neumann2-4/+6 2008-03-11Updated catapult stuffRené 'Necoro' Neumann5-56/+108 2008-03-10Generate correct KeyNotFoundExceptionRené 'Necoro' Neumann1-2/+2 2008-03-09Small changesRené 'Necoro' Neumann3-1/+4 2008-03-07Better session handlingRené 'Necoro' Neumann1-5/+54 2008-03-07Small changesRené 'Necoro' Neumann1-1/+4 2008-03-07Updated shm module to 1.2René 'Necoro' Neumann1-8/+21 2008-03-07Update TODORené 'Necoro' Neumann1-3/+1 2008-03-07hmm ... yesRené 'Necoro' Neumann1-1/+1 2008-03-06Used better exceptions for configuration parserRené 'Necoro' Neumann1-26/+114 2008-03-06Update translationRené 'Necoro' Neumann2-349/+393 2008-03-06Update createpot.shRené 'Necoro' Neumann1-3/+2 2008-03-06Use 'nofork' instead of 'nolistener'René 'Necoro' Neumann1-3/+3 2008-03-05Install glade files into template dir and not data dirRené 'Necoro' Neumann2-2/+1 2008-03-05Added dependency listRené 'Necoro' Neumann3-117/+237