In mirror_cache(), normalize EAPI by mapping EAPI=0 to empty.
authorZac Medico <zmedico@gentoo.org>
Wed, 25 Feb 2009 07:50:34 +0000 (07:50 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 25 Feb 2009 07:50:34 +0000 (07:50 -0000)
svn path=/main/trunk/; revision=12706

pym/portage/cache/util.py

index 7d81f2d05dacca942119689e26f8189210cdc045..86f93440e8cc6c2e961f9d88397b9ddb605c0771 100644 (file)
@@ -53,13 +53,14 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None,
                        except cache_errors.CacheError:
                                pass
 
+               for d in (entry, trg):
+                       if d is not None and d.get('EAPI') in ('', '0'):
+                               del d['EAPI']
+
                if trg and not write_it:
                        """ We don't want to skip the write unless we're really sure that
                        the existing cache is identical, so don't trust _mtime_ and
                        _eclasses_ alone."""
-                       for d in (entry, trg):
-                               if "EAPI" in d and d["EAPI"] in ("", "0"):
-                                       del d["EAPI"]
                        for k in set(chain(entry, trg)).difference(
                                ("_mtime_", "_eclasses_")):
                                if trg.get(k, "") != entry.get(k, ""):