In movefile(), skip os.utime() when os.rename() succeeds, in order to
authorZac Medico <zmedico@gentoo.org>
Thu, 26 Nov 2009 21:59:51 +0000 (21:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 26 Nov 2009 21:59:51 +0000 (21:59 -0000)
completely preserve mtime resolution.

svn path=/main/trunk/; revision=14897

pym/portage/__init__.py

index 2641472e582a89f3a34e858b66ffcd35f05123a2..3246a3a51f532aed355a22c2c90c6fa1c966bff6 100644 (file)
@@ -7565,6 +7565,8 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None,
        try:
                if hardlinked:
                        newmtime = long(os.stat(dest).st_mtime)
+               elif not renamefailed:
+                       newmtime = long(sstat.st_mtime)
                else:
                        if newmtime is not None:
                                os.utime(dest, (newmtime, newmtime))