summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-09-11 12:04:56 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-09-11 13:26:28 +0100
commit0739a514da24dde1177bdce4fc0afa692549a7d7 (patch)
tree58eb06fbcffd43c1cb1da0446de52ff3adb35362
parent1c9609503a5621b6a24f4e78573abe92dd69c9b5 (diff)
downloadmorph-0739a514da24dde1177bdce4fc0afa692549a7d7.tar.gz
import: Sort the resulting stratum alphabetically-ish
-rw-r--r--import/main.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/import/main.py b/import/main.py
index 481a730a..a9cd4fef 100644
--- a/import/main.py
+++ b/import/main.py
@@ -247,6 +247,12 @@ class Package(object):
self.is_build_dep = False
self.version_in_use = version
+ def __cmp__(self, other):
+ return cmp(self.name, other.name)
+
+ def __repr__(self):
+ return '<Package %s-%s>' % (self.name, self.version)
+
def __str__(self):
if len(self.required_by) > 0:
required_msg = ', '.join(self.required_by)
@@ -591,7 +597,8 @@ class BaserockImportApplication(cliapp.Application):
self.status(msg='Generating stratum morph for %s' % goal_name)
- chunk_packages = networkx.topological_sort(graph)
+ order = reversed(sorted(graph.nodes()))
+ chunk_packages = networkx.topological_sort(graph, nbunch=order)
chunk_entries = []
for package in chunk_packages: