summaryrefslogtreecommitdiff
path: root/portato/backend/portage
diff options
context:
space:
mode:
Diffstat (limited to 'portato/backend/portage')
-rw-r--r--portato/backend/portage/system.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py
index d0a0bc3..fa4fece 100644
--- a/portato/backend/portage/system.py
+++ b/portato/backend/portage/system.py
@@ -31,11 +31,13 @@ class PortageSystem (SystemInterface):
def __init__ (self):
"""Constructor."""
self.settings = PortageSettings()
- portage.WORLD_FILE = os.path.join(self.settings.settings["ROOT"], portage.WORLD_FILE)
+ portage.WORLD_FILE = os.path.join(self.settings.settings["ROOT"],portage.WORLD_FILE)
self.use_descs = {}
self.local_use_descs = defaultdict(dict)
+ self._version = tuple([x.split("_")[0] for x in portage.VERSION.split(".")])
+
def get_version (self):
return "Portage %s" % portage.VERSION
@@ -155,18 +157,24 @@ class PortageSystem (SystemInterface):
return PortagePackage(portage.best(list))
def find_best_match (self, search_key, masked = False, only_installed = False, only_cpv = False):
- t = None
-
+ t = []
+
if not only_installed:
pkgSet = "tree"
else:
pkgSet = "installed"
t = self.find_packages(search_key, pkgSet = pkgSet, masked = masked, with_version = True, only_cpv = True)
+
+ if self._version >= (2,1,5):
+ t += [pkg.get_cpv() for pkg in self.find_installed_packages(search_key) if not (pkg.is_testing(True) or pkg.is_masked())]
if t:
+ t = unique_array(t)
return self.find_best(t, only_cpv)
+ return None
+
def find_packages (self, key = "", pkgSet = "all", masked = False, with_version = True, only_cpv = False):
if key is None: key = ""
@@ -355,7 +363,7 @@ class PortageSystem (SystemInterface):
# append system packages
packages.extend(unique_array([p.get_cp() for p in self.find_packages(pkgSet = "system")]))
- states = [(["RDEPEND"], True)]
+ states = [(["RDEPEND", "PDEPEND"], True)]
if self.with_bdeps():
states.append((["DEPEND"], True))
@@ -431,7 +439,7 @@ class PortageSystem (SystemInterface):
else:
for pkg in bm:
if not pkg: continue
- if pkg.is_masked() or pkg.is_testing(True): # check to not update unnecessairily
+ if not pkg.is_installed() and (pkg.is_masked() or pkg.is_testing(True)): # check to not update unnecessairily
cont = False
for inst in self.find_packages(pkg.get_cp(), "installed", only_cpv = True):
if self.cpv_matches(inst, i):
/span>/+11 2020-05-10Renamed feed template to html templateRené 'Necoro' Neumann2-2/+2 2020-05-10Release v0.2.0v0.2.0René 'Necoro' Neumann2-2/+6 2020-05-10Fix building cacheRené 'Necoro' Neumann1-1/+3 2020-05-10Update READMERené 'Necoro' Neumann1-5/+44 2020-05-10Ignore 'dist' folder and build productsRené 'Necoro' Neumann1-0/+2 2020-05-08Print item hashes in debug modeRené 'Necoro' Neumann1-1/+7 2020-05-07Improve html renderingRené 'Necoro' Neumann2-53/+32 2020-05-07Do not assume items to be new when their published date is newer than the las...René 'Necoro' Neumann2-7/+1 2020-05-07Updating some depsRené 'Necoro' Neumann2-2/+7 2020-05-07Better detection if a text starts with html or notRené 'Necoro' Neumann2-4/+13 2020-05-07go fmtRené 'Necoro' Neumann1-3/+2 2020-05-07Add header X-Feed2Imap-GUIDRené 'Necoro' Neumann3-1/+7 2020-05-07update changelogRené 'Necoro' Neumann1-0/+1 2020-05-07FixRené 'Necoro' Neumann1-1/+1 2020-05-07Unified publishedDate and updatedDate into one (just as the old feed2imap...)René 'Necoro' Neumann5-21/+32 2020-05-06Print version during startupRené 'Necoro' Neumann1-1/+1 2020-05-06Improve templateRené 'Necoro' Neumann3-20/+28 2020-05-05Fix pipelineRené 'Necoro' Neumann1-2/+5 2020-05-05Make changelog a part of the release pipeline (untested)René 'Necoro' Neumann2-0/+12