From 18d9a5dd55343a803b3a545ebd2f791ba9dfb8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Wed, 30 Jun 2021 20:39:34 +0200 Subject: [PATCH] common/xbps-cycles.py: deterministic cycle path --- common/scripts/xbps-cycles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/scripts/xbps-cycles.py b/common/scripts/xbps-cycles.py index 769e941ad89..dbfd538235c 100755 --- a/common/scripts/xbps-cycles.py +++ b/common/scripts/xbps-cycles.py @@ -75,7 +75,7 @@ def find_cycles(depmap, xbpsdir): if len(c) < 2: continue pkgs = nx.to_dict_of_lists(G, c) - p = next(iter(pkgs.keys())) + p = min(pkgs.keys()) cycles = [ ] while True: cycles.append(p) @@ -85,7 +85,7 @@ def find_cycles(depmap, xbpsdir): except KeyError: break # Any of the dependencies here contributes to a cycle - p = deps[0] + p = min(deps) if len(deps) > 1: print('Mulitpath: {} -> {}, choosing first'.format(p, deps))