From: Arfrever Frehtes Taifersar Arahesis Date: Thu, 29 Nov 2012 20:30:35 +0000 (+0100) Subject: Fix return value of portage.util.movefile.movefile() for symlinks with Python >=3.3. X-Git-Tag: v2.2.0_alpha143~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=90abd1ee06f66fe094c87763e501a64be82915c5;p=portage.git Fix return value of portage.util.movefile.movefile() for symlinks with Python >=3.3. --- diff --git a/pym/portage/util/movefile.py b/pym/portage/util/movefile.py index b9c418347..98cf86a41 100644 --- a/pym/portage/util/movefile.py +++ b/pym/portage/util/movefile.py @@ -163,8 +163,11 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None, raise lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) # utime() only works on the target of a symlink, so it's not - # possible to perserve mtime on symlinks. - return os.lstat(dest)[stat.ST_MTIME] + # possible to preserve mtime on symlinks. + if sys.hexversion >= 0x3030000: + return os.stat(dest, follow_symlinks=False).st_mtime_ns + else: + return os.lstat(dest)[stat.ST_MTIME] except SystemExit as e: raise except Exception as e: