From: Zac Medico Date: Sat, 12 May 2012 23:27:32 +0000 (-0700) Subject: match_from_list: handle Package.UNKNOWN_REPO X-Git-Tag: v2.2.0_alpha105~42 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=895e2cda1b83d282131eb4b12278654cc6bca141;p=portage.git match_from_list: handle Package.UNKNOWN_REPO --- diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index e4d416c8c..ec0c3f6d4 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -1,4 +1,4 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import sys @@ -8,7 +8,8 @@ from portage import _encodings, _unicode_decode, _unicode_encode from portage.cache.mappings import slot_dict_class from portage.const import EBUILD_PHASES from portage.dep import Atom, check_required_use, use_reduce, \ - paren_enclose, _slot_re, _slot_separator, _repo_separator + paren_enclose, _slot_re, _slot_separator, _repo_separator, \ + _unknown_repo from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use from portage.exception import InvalidDependString from portage.repository.config import _gen_valid_repo @@ -38,7 +39,7 @@ class Package(Task): _dep_keys = ('DEPEND', 'PDEPEND', 'RDEPEND',) _use_conditional_misc_keys = ('LICENSE', 'PROPERTIES', 'RESTRICT') - UNKNOWN_REPO = "__unknown__" + UNKNOWN_REPO = _unknown_repo def __init__(self, **kwargs): Task.__init__(self, **kwargs) diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index de8d1c4d1..d4888e086 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -54,6 +54,8 @@ if sys.hexversion >= 0x3000000: # stable keywords, make these warnings unconditional. _internal_warnings = False +_unknown_repo = "__unknown__" + def cpvequal(cpv1, cpv2): """ @@ -2086,7 +2088,8 @@ def match_from_list(mydep, candidate_list): repo = getattr(x, "repo", False) if repo is False: repo = dep_getrepo(x) - if repo is not None and repo != mydep.repo: + if repo is not None and repo != _unknown_repo and \ + repo != mydep.repo: continue mylist.append(x)