From: Zac Medico Date: Sun, 13 May 2012 09:31:15 +0000 (-0700) Subject: match_from_list: preserve input in result X-Git-Tag: v2.2.0_alpha105~35 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bb1ac9ea20233ba764e989d36c8e8ea1cfc34cb3;p=portage.git match_from_list: preserve input in result This fixes an unintended change in behavior from commit f31320b67c9f593a2a8592e1a4e547f5f641943a. --- diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 240e2237f..31ec75cf6 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -2006,16 +2006,18 @@ def match_from_list(mydep, candidate_list): elif operator in [">", ">=", "<", "<="]: for x in candidate_list: - if not hasattr(x, 'cp'): + if hasattr(x, 'cp'): + pkg = x + else: try: - x = _pkg_str(remove_slot(x)) + pkg = _pkg_str(remove_slot(x)) except InvalidData: continue - if x.cp != mydep.cp: + if pkg.cp != mydep.cp: continue try: - result = vercmp(x.version, mydep.version) + result = vercmp(pkg.version, mydep.version) except ValueError: # pkgcmp may return ValueError during int() conversion writemsg(_("\nInvalid package name: %s\n") % x, noiselevel=-1) raise