From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A729B138334 for ; Mon, 18 Nov 2019 02:56:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 95009E0845; Mon, 18 Nov 2019 02:56:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 77950E0845 for ; Mon, 18 Nov 2019 02:56:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 005DA34CF33 for ; Mon, 18 Nov 2019 02:56:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8FCF1888 for ; Mon, 18 Nov 2019 02:56:33 +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: <1574045723.2d8c7fe07d7a503faff2712c6f18f5ff0b23a45c.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: lib/_emerge/Binpkg.py X-VCS-Directories: lib/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 2d8c7fe07d7a503faff2712c6f18f5ff0b23a45c X-VCS-Branch: master Date: Mon, 18 Nov 2019 02:56:33 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 07759e28-1cea-42ee-93a1-8589c627422d X-Archives-Hash: 01a65fc14b89c650e1b4a448777456f3 commit: 2d8c7fe07d7a503faff2712c6f18f5ff0b23a45c Author: Zac Medico gentoo org> AuthorDate: Mon Nov 18 02:49:51 2019 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Nov 18 02:55:23 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=2d8c7fe0 Binpkg: fix _chpathtool_exit rmtree ENOENT after rename Signed-off-by: Zac Medico gentoo.org> lib/_emerge/Binpkg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/_emerge/Binpkg.py b/lib/_emerge/Binpkg.py index 542ef8fb0..f9cffa26d 100644 --- a/lib/_emerge/Binpkg.py +++ b/lib/_emerge/Binpkg.py @@ -378,14 +378,15 @@ class Binpkg(CompositeTask): image_tmp_dir = os.path.join( self.settings["PORTAGE_BUILDDIR"], "image_tmp") build_d = os.path.join(self.settings["D"], - self._build_prefix.lstrip(os.sep)) + self._build_prefix.lstrip(os.sep)).rstrip(os.sep) if not os.path.isdir(build_d): # Assume this is a virtual package or something. shutil.rmtree(self._image_dir) ensure_dirs(self.settings["ED"]) else: os.rename(build_d, image_tmp_dir) - shutil.rmtree(self._image_dir) + if build_d != self._image_dir: + shutil.rmtree(self._image_dir) ensure_dirs(os.path.dirname(self.settings["ED"].rstrip(os.sep))) os.rename(image_tmp_dir, self.settings["ED"])