match_from_list: avoid multiple meanings of mycpv
authorZac Medico <zmedico@gentoo.org>
Sun, 13 May 2012 20:21:55 +0000 (13:21 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 13 May 2012 20:21:55 +0000 (13:21 -0700)
pym/portage/dep/__init__.py

index 0c92857c4efc6660a4766633e05876f2383aac09..4ccc6696b755a3c23aa04c1c011d77c5bba79353 100644 (file)
@@ -1990,7 +1990,7 @@ def match_from_list(mydep, candidate_list):
                myver = mysplit[2].lstrip("0")
                if not myver or not myver[0].isdigit():
                        myver = "0"+myver
-               mycpv = mysplit[0]+"/"+mysplit[1]+"-"+myver
+               mycpv_cmp = mysplit[0]+"/"+mysplit[1]+"-"+myver
                for x in candidate_list:
                        xs = getattr(x, "cpv_split", None)
                        if xs is None:
@@ -1999,7 +1999,7 @@ def match_from_list(mydep, candidate_list):
                        if not myver or not myver[0].isdigit():
                                myver = "0"+myver
                        xcpv = xs[0]+"/"+xs[1]+"-"+myver
-                       if xcpv.startswith(mycpv):
+                       if xcpv.startswith(mycpv_cmp):
                                mylist.append(x)
 
        elif operator == "~": # version, any revision, match