Enable recognition of _mtime_ that doesn't rely on cache mtime mangling.
authorZac Medico <zmedico@gentoo.org>
Tue, 24 Oct 2006 10:39:57 +0000 (10:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 24 Oct 2006 10:39:57 +0000 (10:39 -0000)
svn path=/main/trunk/; revision=4808

pym/cache/flat_hash.py

index 722e9f1847b87c1dc8cba98d2bb3d71d76911f25..d4c5930c74d8853ef31768b567ff7fd6d7293778 100644 (file)
@@ -26,7 +26,10 @@ class database(fs_template.FsBased):
                        myf = open(fp, "r")
                        try:
                                d = self._parse_data(myf, cpv)
-                               d["_mtime_"] = long(os.fstat(myf.fileno()).st_mtime)
+                               if "_mtime_" not in d:
+                                       """Backward compatibility with old cache that uses mtime
+                                       mangling."""
+                                       d["_mtime_"] = long(os.fstat(myf.fileno()).st_mtime)
                                return d
                        finally:
                                myf.close()