diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-11-27 02:22:08 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-11-27 02:22:08 +0000 |
commit | f5d99ea8e2e07cdf3b7c37703034db035f68b5cb (patch) | |
tree | 700bcd2255bb9f55204974d302ae57767fe6a3ba | |
parent | db47cf762436803aadaa8ed909a6fd1b3390f629 (diff) | |
download | portage-f5d99ea8e2e07cdf3b7c37703034db035f68b5cb.tar.gz portage-f5d99ea8e2e07cdf3b7c37703034db035f68b5cb.tar.bz2 portage-f5d99ea8e2e07cdf3b7c37703034db035f68b5cb.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).
svn path=/main/trunk/; revision=14898
-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 3246a3a51..35ce95329 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. |