From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1EF891381F3 for ; Thu, 29 Nov 2012 20:32:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BE8A721C0AD; Thu, 29 Nov 2012 20:32:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 46EC821C0AD for ; Thu, 29 Nov 2012 20:32:19 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3DC8933D969 for ; Thu, 29 Nov 2012 20:32:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id BCE2FE5436 for ; Thu, 29 Nov 2012 20:32:16 +0000 (UTC) From: "Arfrever Frehtes Taifersar Arahesis" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arfrever Frehtes Taifersar Arahesis" Message-ID: <1354221035.90abd1ee06f66fe094c87763e501a64be82915c5.arfrever@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/movefile.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis X-VCS-Revision: 90abd1ee06f66fe094c87763e501a64be82915c5 X-VCS-Branch: master Date: Thu, 29 Nov 2012 20:32:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8237dcbd-e0af-4b1d-a1de-6d0afb0df556 X-Archives-Hash: e3ba4ae298c86f2d8b47991a05545f3b commit: 90abd1ee06f66fe094c87763e501a64be82915c5 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Thu Nov 29 20:30:35 2012 +0000 Commit: Arfrever Frehtes Taifersar Arahesis gmail com> CommitDate: Thu Nov 29 20:30:35 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=90abd1ee Fix return value of portage.util.movefile.movefile() for symlinks with Python >=3.3. --- pym/portage/util/movefile.py | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pym/portage/util/movefile.py b/pym/portage/util/movefile.py index b9c4183..98cf86a 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: