diff options
author | necoro <> | 2006-10-09 19:16:29 +0000 |
---|---|---|
committer | necoro <> | 2006-10-09 19:16:29 +0000 |
commit | 12d50f5040d8cc0a5564ba7dc328aa58b595eac6 (patch) | |
tree | ac8783ec6e3581e44a550a5e6ac98af549407ecb /geneticone/backend/package.py | |
parent | f27145ec49c6f1cdd13db2f3bf389164f10ac828 (diff) | |
download | portato-12d50f5040d8cc0a5564ba7dc328aa58b595eac6.tar.gz portato-12d50f5040d8cc0a5564ba7dc328aa58b595eac6.tar.bz2 portato-12d50f5040d8cc0a5564ba7dc328aa58b595eac6.zip |
bla - prepared 0.4.0 ; added dialogs.py; extended some comments
Diffstat (limited to '')
-rw-r--r-- | geneticone/backend/package.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/geneticone/backend/package.py b/geneticone/backend/package.py index 7b917a8..522ca08 100644 --- a/geneticone/backend/package.py +++ b/geneticone/backend/package.py @@ -14,8 +14,7 @@ from geneticone.helper import * from portage_helper import * import flags -import gentoolkit -import portage +import portage, gentoolkit from portage_util import unique_array class Package (gentoolkit.Package): @@ -182,8 +181,21 @@ class Package (gentoolkit.Package): continue pkg = find_best_match(dep) - if not dep: - raise PackageNotFoundException, dep + if not pkg: # try to find masked ones + list = find_packages(dep, masked = True) + if not list: + raise PackageNotFoundException, dep + + list = sort_package_list(list) + done = False + for i in range(len(list)-1,0,-1): + p = list[i] + if not p.is_masked(): + dep_pkgs.append(p.get_cpv()) + done = True + break + if not done: + dep_pkgs.append(list[-1].get_cpv()) else: dep_pkgs.append(pkg.get_cpv()) |