Lines 67-88
def cpv_expand(mycpv, mydb=None, use_cac
Link Here
|
67 |
if mydb.cp_list(x+"/"+myp,use_cache=use_cache): |
67 |
if mydb.cp_list(x+"/"+myp,use_cache=use_cache): |
68 |
matches.append(x+"/"+myp) |
68 |
matches.append(x+"/"+myp) |
69 |
if len(matches) > 1: |
69 |
if len(matches) > 1: |
70 |
virtual_name_collision = False |
70 |
#more than 1 match! |
71 |
if len(matches) > 1: |
71 |
assert None == mykey |
72 |
for x in matches: |
72 |
for x in matches: |
73 |
if not x.startswith(("acct-group/", "acct-user/", "virtual/")): |
73 |
if not x.startswith(("acct-group/", "acct-user/", "virtual/")): |
74 |
# Assume that the non-virtual is desired. This helps |
74 |
# Assume that the non-virtual is desired. This helps |
75 |
# avoid the ValueError for invalid deps that come from |
75 |
# avoid the ValueError for invalid deps that come from |
76 |
# installed packages (during reverse blocker detection, |
76 |
# installed packages (during reverse blocker detection, |
77 |
# for example). |
77 |
# for example). |
78 |
mykey = x |
78 |
if None != mykey: |
79 |
else: |
79 |
#if more than 1 non-virtuals then collision! |
80 |
virtual_name_collision = True |
80 |
#eg. try 'equery m git' |
81 |
if not virtual_name_collision: |
81 |
# |
82 |
# AmbiguousPackageName inherits from ValueError, |
82 |
# AmbiguousPackageName inherits from ValueError, |
83 |
# for backward compatibility with calling code |
83 |
# for backward compatibility with calling code |
84 |
# that already handles ValueError. |
84 |
# that already handles ValueError. |
85 |
raise AmbiguousPackageName(matches) |
85 |
raise AmbiguousPackageName(matches) |
|
|
86 |
mykey = x |
86 |
elif matches: |
87 |
elif matches: |
87 |
mykey=matches[0] |
88 |
mykey=matches[0] |
88 |
|
89 |
|