summaryrefslogtreecommitdiff
path: root/portato/backend
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-09-06 17:47:26 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-09-06 17:47:26 +0200
commit4ac3a9d99ffe2a7763f2f109903866ed56f52842 (patch)
tree74680ea1bec1792c53813c98601dd674fa09faee /portato/backend
parentefccd35b43ab610e762d353bc917d3afb17c9a61 (diff)
parentb8078063684b5683126cf9bd5b09808666b91af8 (diff)
downloadportato-4ac3a9d99ffe2a7763f2f109903866ed56f52842.tar.gz
portato-4ac3a9d99ffe2a7763f2f109903866ed56f52842.tar.bz2
portato-4ac3a9d99ffe2a7763f2f109903866ed56f52842.zip
Merged 0.14.1
Diffstat (limited to '')
-rw-r--r--portato/backend/portage/__init__.py2
-rw-r--r--portato/backend/portage/settings_22.py8
-rw-r--r--portato/backend/portage/system.py11
3 files changed, 16 insertions, 5 deletions
diff --git a/portato/backend/portage/__init__.py b/portato/backend/portage/__init__.py
index 6a68bbc..3b0d18b 100644
--- a/portato/backend/portage/__init__.py
+++ b/portato/backend/portage/__init__.py
@@ -17,7 +17,7 @@ from portage import VERSION as PV
VERSION = tuple(map(int, (x.split("_")[0] for x in PV.split("."))))
-if VERSION >= (2, 2):
+if VERSION >= (2, 2) or VERSION >= (2, 1, 8):
debug("Using portage-2.2")
from .system_22 import PortageSystem_22 as PortageSystem
from .package_22 import PortagePackage_22 as PortagePackage
diff --git a/portato/backend/portage/settings_22.py b/portato/backend/portage/settings_22.py
index 253ecaa..33ac60d 100644
--- a/portato/backend/portage/settings_22.py
+++ b/portato/backend/portage/settings_22.py
@@ -12,7 +12,11 @@
-import portage.sets
+try:
+ import portage.sets as psets
+except ImportError:
+ import portage._sets as psets
+
from .settings import PortageSettings
class PortageSettings_22 (PortageSettings):
@@ -24,4 +28,4 @@ class PortageSettings_22 (PortageSettings):
def load (self):
PortageSettings.load(self)
- self.setsconfig = portage.sets.load_default_config(self.settings, self.trees[self.settings["ROOT"]])
+ self.setsconfig = psets.load_default_config(self.settings, self.trees[self.settings["ROOT"]])
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py
index a7fea5d..54d0021 100644
--- a/portato/backend/portage/system.py
+++ b/portato/backend/portage/system.py
@@ -224,7 +224,11 @@ class PortageSystem (SystemInterface):
return list(filter(self.find_lambda(name), categories))
def split_cpv (self, cpv):
- cpv = portage.dep_getcpv(cpv)
+ try:
+ cpv = portage.dep_getcpv(cpv)
+ except portage.exception.InvalidAtom:
+ pass
+
return portage.catpkgsplit(cpv)
def sort_package_list(self, pkglist, only_cpv = False):
@@ -274,12 +278,15 @@ class PortageSystem (SystemInterface):
if len(inst) > 1:
myslots = set()
+ splitp = p.split('[', 1) # split away the useflags
for i in inst: # get the slots of the installed packages
myslots.add(i.get_slot())
myslots.add(best_p.get_slot()) # add the slot of the best package in portage
for slot in myslots:
- crit = "%s:%s" % (p, slot)
+ crit = splitp[:]
+ crit[0] = "%s:%s" % (crit[0], slot)
+ crit = "[".join(crit) # re-add possible useflags
append(crit, self.find_best_match(crit), inst)
else:
append(p, best_p, inst)