summaryrefslogtreecommitdiff
path: root/portato/backend
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/backend/flags.py14
-rw-r--r--portato/backend/portage/package.py2
-rw-r--r--portato/backend/portage/system.py16
3 files changed, 17 insertions, 15 deletions
diff --git a/portato/backend/flags.py b/portato/backend/flags.py
index 9cd061a..6c2a159 100644
--- a/portato/backend/flags.py
+++ b/portato/backend/flags.py
@@ -217,7 +217,7 @@ def set_use_flag (pkg, flag):
if not cpv in newUseFlags:
newUseFlags[cpv] = []
- debug("data: "+str(data))
+ debug("data: %s", str(data))
# add a useflag / delete one
added = False
for file, line, crit, flags in data:
@@ -256,7 +256,7 @@ def set_use_flag (pkg, flag):
newUseFlags[cpv].append((path, -1, flag, False))
newUseFlags[cpv] = unique_array(newUseFlags[cpv])
- debug("newUseFlags: "+str(newUseFlags))
+ debug("newUseFlags: %s", str(newUseFlags))
def remove_new_use_flags (cpv):
"""Removes all new use-flags for a specific package.
@@ -429,7 +429,7 @@ def set_masked (pkg, masked = True):
return
data = get_data(pkg, path)
- debug("data:", str(data))
+ debug("data: %s", str(data))
done = False
for file, line, crit, flags in data:
if pkg.matches(crit):
@@ -452,7 +452,7 @@ def set_masked (pkg, masked = True):
link_neq[cpv].append((file, "-1"))
link_neq[cpv] = unique_array(link_neq[cpv])
- debug("new_(un)masked: "+str(link_neq))
+ debug("new_(un)masked: %s",str(link_neq))
def remove_new_masked (cpv):
if isinstance(cpv, package.Package):
@@ -478,7 +478,7 @@ def new_masking_status (cpv):
for file, line in list[cpv]:
_ret = (int(line) == -1)
if ret is not None and _ret != ret:
- debug("Conflicting values for masking status!", list, error = True)
+ error("Conflicting values for masking status: %s", list)
else:
ret = _ret
return ret
@@ -635,7 +635,7 @@ def set_testing (pkg, enable):
if not enable:
test = get_data(pkg, CONST.testing_path())
- debug("data (test): "+str(test))
+ debug("data (test): %s", str(test))
for file, line, crit, flags in test:
if pkg.matches(crit) and flags[0] == "~"+arch:
newTesting[cpv].append((file, line))
@@ -647,7 +647,7 @@ def set_testing (pkg, enable):
newTesting[cpv].append((file, "-1"))
newTesting[cpv] = unique_array(newTesting[cpv])
- debug("newTesting: "+str(newTesting))
+ debug("newTesting: %s",str(newTesting))
def write_testing ():
global arch, newTesting
diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py
index d819f2d..4f4b618 100644
--- a/portato/backend/portage/package.py
+++ b/portato/backend/portage/package.py
@@ -86,7 +86,7 @@ class PortagePackage (Package):
if status == "masked": return True
elif status == "unmasked": return False
else:
- debug("BUG in flags.new_masking_status. It returns", status, error = True)
+ error("BUG in flags.new_masking_status. It returns \'%s\'", status)
else: # we have not touched the status
if self._status and ("profile" in self._status or "package.mask" in self._status):
return True
diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py
index 739c577..92bdf51 100644
--- a/portato/backend/portage/system.py
+++ b/portato/backend/portage/system.py
@@ -16,7 +16,7 @@ import portage
import package
from settings import PortageSettings
-from portato.helper import debug, unique_array
+from portato.helper import *
from portato.backend.system_interface import SystemInterface
class PortageSystem (SystemInterface):
@@ -121,12 +121,14 @@ class PortageSystem (SystemInterface):
def find_best_match (self, search_key, only_installed = False):
t = None
+
if not only_installed:
- t = self.settings.porttree.dep_bestmatch(search_key)
+ t = self.find_packages(search_key)
else:
- t = self.settings.vartree.dep_bestmatch(search_key)
+ t = self.find_installed_packages(search_key)
+
if t:
- return package.PortagePackage(t)
+ return self.find_best([x.get_cpv() for x in t])
return None
def find_packages (self, search_key, masked=False):
@@ -277,7 +279,7 @@ class PortageSystem (SystemInterface):
best_p = self.find_best_match(p)
if best_p is None:
- debug("No best match for",p,"-- It seems not to be in the tree anymore.",warn = True)
+ warning("No best match for %s. It seems not to be in the tree anymore." % p)
continue
if len(inst) > 1:
@@ -334,7 +336,7 @@ class PortageSystem (SystemInterface):
oldList = self.sort_package_list(self.find_installed_packages(p.get_cp()))
if not oldList:
if add_not_installed:
- debug("Not found installed",p.get_cpv(),"==> adding")
+ info("Found a not installed dependency: %s." % p.get_cpv())
oldList = [p]
else:
return
@@ -374,7 +376,7 @@ class PortageSystem (SystemInterface):
raw_checked.append(i)
bm = self.get_new_packages([i])
if not bm:
- debug("Bug? No best match could be found:",i)
+ warning("Bug? No best match could be found for %s.",i)
else:
for pkg in bm:
if not pkg: continue