When integer mtime is desired, use stat_obj[stat.ST_MTIME] instead of the
authorZac Medico <zmedico@gentoo.org>
Thu, 24 Dec 2009 04:01:27 +0000 (04:01 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 24 Dec 2009 04:01:27 +0000 (04:01 -0000)
float st_mtime in order to avoid rounding *up* in some rare cases.
(trunk r15126)

svn path=/main/branches/2.1.7/; revision=15138

pym/portage/cache/flat_list.py

index bf465efdb21e929b1636f54636e49c7f5a36e7c4..51231a52a500e1108688500f850f2e7c4263a2f0 100644 (file)
@@ -48,7 +48,7 @@ class database(fs_template.FsBased):
                        raise cache_errors.CacheCorruption(cpv, e)
 
                try:
-                       d["_mtime_"] = long(os.fstat(myf.fileno()).st_mtime)
+                       d["_mtime_"] = os.fstat(myf.fileno())[stat.ST_MTIME]
                except OSError as e:    
                        myf.close()
                        raise cache_errors.CacheCorruption(cpv, e)