summaryrefslogtreecommitdiffstats
path: root/pym/portage_manifest.py
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2006-03-27 07:21:46 +0000
committerMarius Mauch <genone@gentoo.org>2006-03-27 07:21:46 +0000
commit2da98ee3be94d5a3a56dd210b212213d7ea87c1d (patch)
tree9c5eb23474de6dca6d8c5e03506b7b5326fd4fd0 /pym/portage_manifest.py
parent3abd610842285717c547966d88c5eb499484c4d2 (diff)
downloadportage-2da98ee3be94d5a3a56dd210b212213d7ea87c1d.tar.gz
portage-2da98ee3be94d5a3a56dd210b212213d7ea87c1d.tar.bz2
portage-2da98ee3be94d5a3a56dd210b212213d7ea87c1d.zip
sort digest/Manifest files by 1) filetype (v2 only) 2) filename (v1+v2) 3) hashtype (v1 only)
svn path=/main/trunk/; revision=3024
Diffstat (limited to 'pym/portage_manifest.py')
-rw-r--r--pym/portage_manifest.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py
index 40122c212..0704bccc7 100644
--- a/pym/portage_manifest.py
+++ b/pym/portage_manifest.py
@@ -161,9 +161,13 @@ class Manifest(object):
def _createDigestLines1(self, distlist, myhashdict):
""" Create an old style digest file."""
mylines = []
- for f in myhashdict["DIST"].keys():
+ myfiles = myhashdict["DIST"].keys()
+ myfiles.sort()
+ for f in myfiles:
if f in distlist:
- for h in myhashdict["DIST"][f].keys():
+ myhashkeys = myhashdict["DIST"][f].keys()
+ myhashkeys.sort()
+ for h in myhashkeys:
if h not in portage_const.MANIFEST1_HASH_FUNCTIONS:
continue
myline = " ".join([h, str(myhashdict["DIST"][f][h]), f, str(myhashdict["DIST"][f]["size"])])
@@ -183,8 +187,12 @@ class Manifest(object):
def _write(self, fd):
""" Actual Manifest file generator """
mylines = []
- for t in self.fhashdict.keys():
- for f in self.fhashdict[t].keys():
+ mytypes = self.fhashdict.keys()
+ mytypes.sort()
+ for t in mytypes:
+ myfiles = self.fhashdict[t].keys()
+ myfiles.sort()
+ for f in myfiles:
# compat hack for v1 manifests
if t == "AUX":
f2 = os.path.join("files", f)
@@ -198,7 +206,9 @@ class Manifest(object):
myline += " "+h+" "+str(myhashes[h])
mylines.append(myline)
if self.compat and t != "DIST":
- for h in myhashes.keys():
+ myhashkeys = myhashes.keys()
+ myhashkeys.sort()
+ for h in myhashkeys:
if h not in portage_const.MANIFEST1_HASH_FUNCTIONS:
continue
mylines.append((" ".join([h, str(myhashes[h]), f2, str(myhashes["size"])])))