aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-02-11 12:39:37 -0800
committerZac Medico <zmedico@gentoo.org>2020-02-11 12:48:56 -0800
commit350b8f486b96871386d721e48e768a77a1c4b1a6 (patch)
tree2e40956e76cf97b116374adde2295a51409cb433 /lib/_emerge/depgraph.py
parentdepgraph: sort package set atoms for consistent results (diff)
downloadportage-350b8f486b96871386d721e48e768a77a1c4b1a6.tar.gz
portage-350b8f486b96871386d721e48e768a77a1c4b1a6.tar.bz2
portage-350b8f486b96871386d721e48e768a77a1c4b1a6.zip
depgraph: sort nested package set names for consistent results
Traverse the unordered set returned from PackageSet.getNonAtoms() in sorted order, for more consistent results. Use a reverse sort since we pop these sets from a stack. Bug: https://bugs.gentoo.org/649622 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge/depgraph.py')
-rw-r--r--lib/_emerge/depgraph.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index dd29b607c..8e0d79e29 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -2788,8 +2788,10 @@ class depgraph(object):
# Traverse nested sets and add them to the stack
# if they're not already in the graph. Also, graph
- # edges between parent and nested sets.
- for token in arg.pset.getNonAtoms():
+ # edges between parent and nested sets. Traverse in
+ # sorted order for consistent results, using reverse
+ # sort since we pop these sets from a stack.
+ for token in sorted(arg.pset.getNonAtoms(), reverse=True):
if not token.startswith(SETPREFIX):
continue
s = token[len(SETPREFIX):]