diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-11-27 22:38:16 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-11-27 22:38:16 +0000 |
commit | ca79528f5ed4faccce4cce3fec8963f64a7d6b41 (patch) | |
tree | a7d520b9477246841b3c55e116c8689fadb2b1d5 | |
parent | 42027856c58b700b4637cd29fb75c33896b1f5aa (diff) | |
download | portage-ca79528f5ed4faccce4cce3fec8963f64a7d6b41.tar.gz portage-ca79528f5ed4faccce4cce3fec8963f64a7d6b41.tar.bz2 portage-ca79528f5ed4faccce4cce3fec8963f64a7d6b41.zip |
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
-rw-r--r-- | pym/portage/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
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. |