Make PackageIndex.write() alphabetize the metadata keys.
authorZac Medico <zmedico@gentoo.org>
Thu, 24 May 2007 03:54:56 +0000 (03:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 24 May 2007 03:54:56 +0000 (03:54 -0000)
svn path=/main/trunk/; revision=6611

pym/portage/getbinpkg.py

index f21dce364a868dda3582568345e4e5f0a5ec7773..47413259ba5fa2f25cd3dcdfc3cdb05effab8b8d 100644 (file)
@@ -615,10 +615,14 @@ class PackageIndex(object):
                import time
                self.header["TIMESTAMP"] = str(long(time.time()))
                self.header["PACKAGES"] = str(len(cpv_all))
-               writepkgindex(pkgfile, self.header.iteritems())
+               keys = self.header.keys()
+               keys.sort()
+               writepkgindex(pkgfile, [(k, self.header[k]) for k in keys])
                for cpv in cpv_all:
                        metadata = self.packages[cpv]
                        if metadata["SLOT"] == "0":
                                metadata = metadata.copy()
                                del metadata["SLOT"]
-                       writepkgindex(pkgfile, metadata.iteritems())
+                       keys = metadata.keys()
+                       keys.sort()
+                       writepkgindex(pkgfile, [(k, metadata[k]) for k in keys])