common/xbps-cycles.py: deterministic cycle path
This commit is contained in:
parent
287624675c
commit
18d9a5dd55
1 changed files with 2 additions and 2 deletions
|
@ -75,7 +75,7 @@ def find_cycles(depmap, xbpsdir):
|
||||||
if len(c) < 2: continue
|
if len(c) < 2: continue
|
||||||
pkgs = nx.to_dict_of_lists(G, c)
|
pkgs = nx.to_dict_of_lists(G, c)
|
||||||
|
|
||||||
p = next(iter(pkgs.keys()))
|
p = min(pkgs.keys())
|
||||||
cycles = [ ]
|
cycles = [ ]
|
||||||
while True:
|
while True:
|
||||||
cycles.append(p)
|
cycles.append(p)
|
||||||
|
@ -85,7 +85,7 @@ def find_cycles(depmap, xbpsdir):
|
||||||
except KeyError: break
|
except KeyError: break
|
||||||
|
|
||||||
# Any of the dependencies here contributes to a cycle
|
# Any of the dependencies here contributes to a cycle
|
||||||
p = deps[0]
|
p = min(deps)
|
||||||
if len(deps) > 1:
|
if len(deps) > 1:
|
||||||
print('Mulitpath: {} -> {}, choosing first'.format(p, deps))
|
print('Mulitpath: {} -> {}, choosing first'.format(p, deps))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue