public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org, "Michał Górny" <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	[thread overview]
Message-ID: <1361710067-8869-4-git-send-email-mgorny@gentoo.org> (raw)
In-Reply-To: <20130224134551.63bd9791@pomiocik.lan>

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



      parent reply	other threads:[~2013-02-24 12:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24 12:45 [gentoo-python] [PATCHES] distutils-r1: making in-source builds more compatible with out-of-source builds Michał Górny
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 1/4] In-source builds: make BUILD_DIR point to the 'build' subdir Michał Górny
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 2/4] In-source builds: override build locations as well Michał Górny
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 3/4] In-source builds: set PYTHONPATH properly Michał Górny
2013-02-24 12:47 ` Michał Górny [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361710067-8869-4-git-send-email-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    --cc=python@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox