summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMichał Górny <gentoo@mgorny.alt.pl>2010-04-22 17:43:59 +0000
committerZac Medico <zmedico@gentoo.org>2010-04-29 16:51:48 -0700
commitef2024a33be93a256beef28c1423ba1fb706383d (patch)
treea1581fa88b7113338bbfd0ae4b545ec26a375f63 /bin
parentBail out immediately if --exclude is given a bad atom. (diff)
downloadportage-idfetch-ef2024a33be93a256beef28c1423ba1fb706383d.tar.gz
portage-idfetch-ef2024a33be93a256beef28c1423ba1fb706383d.tar.bz2
portage-idfetch-ef2024a33be93a256beef28c1423ba1fb706383d.zip
Support per-package bashrc files.
Support loading per-package bashrc files from the /etc/portage/env directory. The invidual files should reside in a directory matching ${CATEGORY}, with names matching ${PN}, ${PN}:${SLOT}, ${P} and/or ${PF} (which are applied in that order).
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild.sh23
-rw-r--r--bin/isolated-functions.sh2
2 files changed, 14 insertions, 11 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 57ceb284..968bf6bc 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1557,17 +1557,20 @@ source_all_bashrcs() {
# We assume if people are changing shopts in their bashrc they do so at their
# own peril. This is the ONLY non-portage bit of code that can change shopts
# without a QA violation.
- if [ -f "${PORTAGE_BASHRC}" ]; then
- # If $- contains x, then tracing has already enabled elsewhere for some
- # reason. We preserve it's state so as not to interfere.
- if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
- source "${PORTAGE_BASHRC}"
- else
- set -x
- source "${PORTAGE_BASHRC}"
- set +x
+ for x in "${PORTAGE_BASHRC}" "${PM_EBUILD_HOOK_DIR}"/${CATEGORY}/{${PN},${PN}:${SLOT},${P},${PF}}; do
+ if [ -r "${x}" ]; then
+ # If $- contains x, then tracing has already enabled elsewhere for some
+ # reason. We preserve it's state so as not to interfere.
+ if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then
+ source "${x}"
+ else
+ set -x
+ source "${x}"
+ set +x
+ fi
fi
- fi
+ done
+
[ ! -z "${OCC}" ] && export CC="${OCC}"
[ ! -z "${OCXX}" ] && export CXX="${OCXX}"
}
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index fa23b667..6bead30b 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -553,7 +553,7 @@ save_ebuild_env() {
LAST_E_CMD LAST_E_LEN LD_PRELOAD MISC_FUNCTIONS_ARGS MOPREFIX \
NOCOLOR NORMAL PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \
PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST \
- PORTAGE_BASHRC PORTAGE_BASHRCS_SOURCED \
+ PORTAGE_BASHRC PM_EBUILD_HOOK_DIR PORTAGE_BASHRCS_SOURCED \
PORTAGE_BINPKG_TAR_OPTS PORTAGE_BINPKG_TMPFILE PORTAGE_BUILDDIR \
PORTAGE_COLORMAP PORTAGE_CONFIGROOT PORTAGE_DEBUG \
PORTAGE_DEPCACHEDIR PORTAGE_GID \