diff options
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()) |