Make PackageIndex.write() omit USE when appropriate.
authorZac Medico <zmedico@gentoo.org>
Thu, 24 May 2007 05:49:44 +0000 (05:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 24 May 2007 05:49:44 +0000 (05:49 -0000)
svn path=/main/trunk/; revision=6613

pym/portage/getbinpkg.py

index 47413259ba5fa2f25cd3dcdfc3cdb05effab8b8d..76016e3c05fe282939ca0ce8ef501a7bdd5d2ef3 100644 (file)
@@ -619,10 +619,11 @@ class PackageIndex(object):
                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()
+                       metadata = self.packages[cpv].copy()
+                       if metadata.get("SLOT") == "0":
                                del metadata["SLOT"]
+                       if metadata.get("USE") == "":
+                               del metadata["USE"]
                        keys = metadata.keys()
                        keys.sort()
                        writepkgindex(pkgfile, [(k, metadata[k]) for k in keys])