From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-commits+bounces-376744-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1QxpLo-0002Zo-LB
	for garchives@archives.gentoo.org; Mon, 29 Aug 2011 00:05:16 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 8D33221C127;
	Mon, 29 Aug 2011 00:05:04 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 5B3CE21C127
	for <gentoo-commits@lists.gentoo.org>; Mon, 29 Aug 2011 00:05:04 +0000 (UTC)
Received: from pelican.gentoo.org (unknown [66.219.59.40])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id ABE5D1B4013
	for <gentoo-commits@lists.gentoo.org>; Mon, 29 Aug 2011 00:05:03 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id F275780040
	for <gentoo-commits@lists.gentoo.org>; Mon, 29 Aug 2011 00:05:02 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <5bc6b9c8767c9a9bea511d7ece98f54e8a873b47.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/
X-VCS-Repository: proj/portage
X-VCS-Files: pym/portage/package/ebuild/doebuild.py
X-VCS-Directories: pym/portage/package/ebuild/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: 5bc6b9c8767c9a9bea511d7ece98f54e8a873b47
Date: Mon, 29 Aug 2011 00:05:02 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: 6b838e8fefc4a1aaa603babbdd6f74c8

commit:     5bc6b9c8767c9a9bea511d7ece98f54e8a873b47
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 29 00:04:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 29 00:04:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3D5bc6b9c8

spawnebuild: skip previously executed phases

This simply checks of $PORTAGE_BUILDDIR/.${EBUILD_PHASE%e}ed and skips
the phase like ebuild.sh would. It preserves a special case for the
install phase with FEATURES=3Dnoauto, so that dyn_install in ebuild.sh
continues to work the same for this case.. Also, note that commit
ae9b6cb513c7b29376caecf3b4e52aac452e2b93 preserves the automatic
"recreating WORKDIR" behavior that used to be implemented in
dyn_unpack.

---
 pym/portage/package/ebuild/doebuild.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package=
/ebuild/doebuild.py
index a95a418..0e80917 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1358,6 +1358,17 @@ def spawnebuild(mydo, actionmap, mysettings, debug=
, alwaysdep=3D0,
 	if mydo =3D=3D "pretend" and not eapi_has_pkg_pretend(eapi):
 		return os.EX_OK
=20
+	if not (mydo =3D=3D "install" and "noauto" in mysettings.features):
+		check_file =3D os.path.join(
+			mysettings["PORTAGE_BUILDDIR"], ".%sed" % mydo.rstrip('e'))
+		if os.path.exists(check_file):
+			writemsg_stdout(">>> It appears that "
+				"'%s' has already executed for '%s'; skipping.\n" %
+				(mydo, mysettings["PF"]))
+			writemsg_stdout(">>> Remove '%s' to force %s.\n" %
+				(check_file, mydo))
+			return os.EX_OK
+
 	return _spawn_phase(mydo, mysettings,
 		actionmap=3Dactionmap, logfile=3Dlogfile,
 		fd_pipes=3Dfd_pipes, returnpid=3Dreturnpid)