diff options
author | necoro <> | 2007-05-31 19:45:22 +0000 |
---|---|---|
committer | necoro <> | 2007-05-31 19:45:22 +0000 |
commit | 860f59e2a4a7a8daeb9683d6938986afc694cf6d (patch) | |
tree | e8e9a0493ee6a7e2aff5c7f9a1c59fb73429d7e2 /portato/backend/portage | |
parent | db7e4fb5c77cff77617d28206722c9b7a72aaa04 (diff) | |
download | portato-860f59e2a4a7a8daeb9683d6938986afc694cf6d.tar.gz portato-860f59e2a4a7a8daeb9683d6938986afc694cf6d.tar.bz2 portato-860f59e2a4a7a8daeb9683d6938986afc694cf6d.zip |
Some interface changes
Made qt-frontend work mostly with PyQt-4.2
Diffstat (limited to '')
-rw-r--r-- | portato/backend/portage/package.py | 21 | ||||
-rw-r--r-- | portato/backend/portage/system.py | 6 |
2 files changed, 19 insertions, 8 deletions
diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py index 9f40137..d22d203 100644 --- a/portato/backend/portage/package.py +++ b/portato/backend/portage/package.py @@ -163,7 +163,7 @@ class PortagePackage (Package): return retlist - def get_dep_packages (self, depvar = ["RDEPEND", "PDEPEND", "DEPEND"]): + def get_dep_packages (self, depvar = ["RDEPEND", "PDEPEND", "DEPEND"], with_criterions = False): dep_pkgs = [] # the package list # change the useflags, because we have internally changed some, but not made them visible for portage @@ -192,6 +192,14 @@ class PortagePackage (Package): deps = deps[1] + def create_dep_pkgs_data (dep, pkg): + """Returns the data to enter into the dep_pkgs list, which is either the package cpv or a tuple + consisting of the cpv and the criterion.""" + if with_criterions: + return (pkg.get_cpv(), dep) + else: + return pkg.get_cpv() + for dep in deps: if dep[0] == '!': # blocking sth dep = dep[1:] @@ -212,13 +220,13 @@ class PortagePackage (Package): for i in range(len(list)-1,0,-1): p = list[i] if not p.is_masked(): - dep_pkgs.append(p.get_cpv()) + dep_pkgs.append(create_dep_pkgs_data(dep, p)) done = True break if not done: - dep_pkgs.append(list[-1].get_cpv()) + dep_pkgs.append(create_dep_pkgs_data(dep, list[-1])) else: - dep_pkgs.append(pkg.get_cpv()) + dep_pkgs.append(create_dep_pkgs_data(dep, pkg)) return dep_pkgs @@ -262,7 +270,4 @@ class PortagePackage (Package): return portage.pkgcmp(v1[1:],v2[1:]) def matches (self, criterion): - if portage.match_from_list(criterion, [self.get_cpv()]) == []: - return False - else: - return True + return system.cpv_matches(self.get_cpv(), criterion) diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index 27099cc..ddc4a8e 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -79,6 +79,12 @@ class PortageSystem (SystemInterface): return opts + def cpv_matches (self, cpv, criterion): + if portage.match_from_list(criterion, [self.get_cpv()]) == []: + return False + else: + return True + def find_lambda (self, name): """Returns the function needed by all the find_all_*-functions. Returns None if no name is given. |