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 43D111381F3 for ; Tue, 16 Apr 2013 14:01:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B3680E0885; Tue, 16 Apr 2013 14:01:16 +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 48122E0885 for ; Tue, 16 Apr 2013 14:01:16 +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 615DB33DDC1 for ; Tue, 16 Apr 2013 14:01:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 002E8E4306 for ; Tue, 16 Apr 2013 14:01:13 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1366120845.4d9c8b5ca0a7c13066b3e08ed6700cbd0939ec72.zmedico@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: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 4d9c8b5ca0a7c13066b3e08ed6700cbd0939ec72 X-VCS-Branch: master Date: Tue, 16 Apr 2013 14:01:13 +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: 4e72c8fb-1884-4453-8bfc-5e5aff738565 X-Archives-Hash: 8473323390c647827041cf253844218f commit: 4d9c8b5ca0a7c13066b3e08ed6700cbd0939ec72 Author: Zac Medico gentoo org> AuthorDate: Tue Apr 16 14:00:45 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Apr 16 14:00:45 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4d9c8b5c movefile: remove source symlink/hardlink after mv --- pym/portage/util/movefile.py | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/pym/portage/util/movefile.py b/pym/portage/util/movefile.py index 8a7a2b6..f33e67c 100644 --- a/pym/portage/util/movefile.py +++ b/pym/portage/util/movefile.py @@ -224,6 +224,12 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None, target != os.readlink(dest): raise lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) + + try: + _os.unlink(src_bytes) + except OSError: + pass + if sys.hexversion >= 0x3030000: try: os.utime(dest, ns=(sstat.st_mtime_ns, sstat.st_mtime_ns), follow_symlinks=False) @@ -277,6 +283,10 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None, writemsg("!!! %s\n" % (e,), noiselevel=-1) return None hardlinked = True + try: + _os.unlink(src_bytes) + except OSError: + pass break renamefailed=1