Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 228929 Details for
Bug 44796
[PATCH] Per package environment variables
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Per-package bashrc support (with missing unset added)
0003-Support-per-package-bashrc-files.patch (text/plain), 4.88 KB, created by
Michał Górny
on 2010-04-23 22:06:43 UTC
(
hide
)
Description:
Per-package bashrc support (with missing unset added)
Filename:
MIME Type:
Creator:
Michał Górny
Created:
2010-04-23 22:06:43 UTC
Size:
4.88 KB
patch
obsolete
>From a3e857dc07a842b466382bdabe4076947d258275 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl> >Date: Thu, 22 Apr 2010 17:43:59 +0000 >Subject: [PATCH 3/3] 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}, ${P} and/or ${PF} (which are >applied in that order). >--- > bin/ebuild.sh | 23 +++++++++++++---------- > bin/isolated-functions.sh | 2 +- > pym/portage/const.py | 1 + > pym/portage/package/ebuild/config.py | 2 +- > pym/portage/package/ebuild/doebuild.py | 6 ++++-- > 5 files changed, 20 insertions(+), 14 deletions(-) > >diff --git a/bin/ebuild.sh b/bin/ebuild.sh >index 57ceb28..52a0f65 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}" "${PORTAGE_BASHENVDIR}"/${CATEGORY}/{${PN},${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 5401e25..2acb3b3 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 PORTAGE_BASHENVDIR PORTAGE_BASHRCS_SOURCED \ > PORTAGE_BINPKG_TAR_OPTS PORTAGE_BINPKG_TMPFILE PORTAGE_BUILDDIR \ > PORTAGE_COLORMAP PORTAGE_CONFIGROOT PORTAGE_DEBUG \ > PORTAGE_DEPCACHEDIR PORTAGE_GID \ >diff --git a/pym/portage/const.py b/pym/portage/const.py >index 2c5e233..445677b 100644 >--- a/pym/portage/const.py >+++ b/pym/portage/const.py >@@ -34,6 +34,7 @@ MODULES_FILE_PATH = USER_CONFIG_PATH + "/modules" > CUSTOM_PROFILE_PATH = USER_CONFIG_PATH + "/profile" > USER_VIRTUALS_FILE = USER_CONFIG_PATH + "/virtuals" > EBUILD_SH_ENV_FILE = USER_CONFIG_PATH + "/bashrc" >+EBUILD_SH_ENV_DIR = USER_CONFIG_PATH + "/env" > CUSTOM_MIRRORS_FILE = USER_CONFIG_PATH + "/mirrors" > COLOR_MAP_FILE = USER_CONFIG_PATH + "/color.map" > PROFILE_PATH = "etc/make.profile" >diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py >index a3998cc..ae5f716 100644 >--- a/pym/portage/package/ebuild/config.py >+++ b/pym/portage/package/ebuild/config.py >@@ -172,7 +172,7 @@ class config(object): > "PKGDIR", > "PKGUSE", "PKG_LOGDIR", "PKG_TMPDIR", > "PORTAGE_ACTUAL_DISTDIR", "PORTAGE_ARCHLIST", >- "PORTAGE_BASHRC", >+ "PORTAGE_BASHRC", "PORTAGE_BASHENVDIR", > "PORTAGE_BINPKG_FILE", "PORTAGE_BINPKG_TAR_OPTS", > "PORTAGE_BINPKG_TMPFILE", > "PORTAGE_BIN_PATH", >diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py >index 9cf16cf..5835fe3 100644 >--- a/pym/portage/package/ebuild/doebuild.py >+++ b/pym/portage/package/ebuild/doebuild.py >@@ -32,8 +32,8 @@ from portage import auxdbkeys, bsd_chflags, dep_check, \ > eapi_is_supported, merge, os, selinux, StringIO, \ > unmerge, _encodings, _parse_eapi_ebuild_head, _os_merge, \ > _shell_quote, _split_ebuild_name_glep55, _unicode_decode, _unicode_encode >-from portage.const import EBUILD_SH_ENV_FILE, EBUILD_SH_BINARY, \ >- INVALID_ENV_FILE, MISC_SH_BINARY >+from portage.const import EBUILD_SH_ENV_FILE, EBUILD_SH_ENV_DIR, \ >+ EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY > from portage.data import portage_gid, portage_uid, secpass, \ > uid, userpriv_groups > from portage.dbapi.virtual import fakedbapi >@@ -211,6 +211,8 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, > > mysettings["PORTAGE_BASHRC"] = os.path.join( > mysettings["PORTAGE_CONFIGROOT"], EBUILD_SH_ENV_FILE) >+ mysettings["PORTAGE_BASHENVDIR"] = os.path.join( >+ mysettings["PORTAGE_CONFIGROOT"], EBUILD_SH_ENV_DIR) > mysettings["EBUILD_EXIT_STATUS_FILE"] = os.path.join( > mysettings["PORTAGE_BUILDDIR"], ".exit_status") > >-- >1.7.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 44796
:
72015
|
72017
|
90464
|
94711
|
228783
|
228785
|
228929