From: Zac Medico Date: Fri, 27 Nov 2009 22:38:16 +0000 (-0000) Subject: Fix logic from previous commit so it only applies when a 'newmtime' parameter X-Git-Tag: v2.1.7.8~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ca79528f5ed4faccce4cce3fec8963f64a7d6b41;p=portage.git Fix logic from previous commit so it only applies when a 'newmtime' parameter has not been specified (this is always the case when called by portage). (trunk r14898) svn path=/main/branches/2.1.7/; revision=14903 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index e22854996..e314654f4 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -7565,13 +7565,15 @@ 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)) else: - os.utime(dest, (sstat.st_atime, sstat.st_mtime)) + if renamefailed: + # If rename succeeded then this is not necessary, since + # rename automatically preserves timestamps with complete + # precision. + os.utime(dest, (sstat.st_atime, sstat.st_mtime)) newmtime = long(sstat.st_mtime) except OSError: # The utime can fail here with EPERM even though the move succeeded.