From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-python+bounces-409-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id CE619198005
	for <garchives@archives.gentoo.org>; Sun, 24 Feb 2013 12:47:42 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 6763DE05D7;
	Sun, 24 Feb 2013 12:47:42 +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 02C8CE05D7
	for <gentoo-python@lists.gentoo.org>; Sun, 24 Feb 2013 12:47:41 +0000 (UTC)
Received: from pomiocik.lan (unknown [213.195.173.220])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: mgorny)
	by smtp.gentoo.org (Postfix) with ESMTPSA id 2E8A033DD9E;
	Sun, 24 Feb 2013 12:47:39 +0000 (UTC)
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org,
	=?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Subject: [gentoo-python] [PATCH distutils-r1 4/4] In-source builds: run *_all() phases in best-impl sources copy.
Date: Sun, 24 Feb 2013 13:47:47 +0100
Message-Id: <1361710067-8869-4-git-send-email-mgorny@gentoo.org>
X-Mailer: git-send-email 1.8.1.4
In-Reply-To: <20130224134551.63bd9791@pomiocik.lan>
References: <20130224134551.63bd9791@pomiocik.lan>
Precedence: bulk
List-Post: <mailto:gentoo-python@lists.gentoo.org>
List-Help: <mailto:gentoo-python+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-python+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-python+subscribe@lists.gentoo.org>
List-Id: Discussions centering around the Python ecosystem in Gentoo Linux <gentoo-python.gentoo.org>
X-BeenThere: gentoo-python@gentoo.org
X-BeenThere: gentoo-python@lists.gentoo.org
X-Archives-Salt: 8494a353-0d67-491e-b5ac-2e3fd788dfe7
X-Archives-Hash: fe2342553f2343709b3e1a7da19af14d

This seems a bit safer, and provides users with expectable way of
obtaining the location of those sources. The original sources directory
can be still obtained via ${S}.
---
 gx86/eclass/distutils-r1.eclass | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
index 0c5abff..7a295c2 100644
--- a/gx86/eclass/distutils-r1.eclass
+++ b/gx86/eclass/distutils-r1.eclass
@@ -580,6 +580,9 @@ distutils-r1_run_phase() {
 # @INTERNAL
 # @DESCRIPTION:
 # Run the given command, restoring the best-implementation state.
+#
+# If in-source build is used, the command will be run in the copy
+# of sources made for the best Python interpreter.
 _distutils-r1_run_common_phase() {
 	local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR}
 
@@ -590,8 +593,16 @@ _distutils-r1_run_common_phase() {
 
 	export EPYTHON PYTHON PYTHONPATH
 
+	if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
+		pushd "${BUILD_DIR}"/.. >/dev/null || die
+	fi
+
 	einfo "common: running ${1}"
 	"${@}"
+
+	if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
+		popd >/dev/null || die
+	fi
 }
 
 # @FUNCTION: _distutils-r1_multijob_init
-- 
1.8.1.4