summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-02 12:24:02 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-02 12:24:02 -0700
commitc8599e6d0a7cda12e4d1ce8796283fae2a2b4061 (patch)
tree0dbc5f11654a3c9f9651f689a0e4bc4fa69bc54d
parent94015a2fe3b2d886b71e874c10bdd2504e54a133 (diff)
downloadportage-c8599e6d0a7cda12e4d1ce8796283fae2a2b4061.tar.gz
portage-c8599e6d0a7cda12e4d1ce8796283fae2a2b4061.tar.bz2
portage-c8599e6d0a7cda12e4d1ce8796283fae2a2b4061.zip
Add a _SANDBOX_COMPAT_LEVEL constant which will be used to enable
a workaround for bug #288863 in the stable branch.
-rwxr-xr-xbin/ebuild.sh9
-rw-r--r--bin/isolated-functions.sh3
-rw-r--r--pym/portage/const.py1
-rw-r--r--pym/portage/package/ebuild/_config/special_env_vars.py5
-rw-r--r--pym/portage/package/ebuild/config.py4
5 files changed, 19 insertions, 3 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 73ea8c807..714084f0b 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -5,6 +5,15 @@
PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}"
+if [[ $PORTAGE_SANDBOX_COMPAT_LEVEL -lt 22 ]] ; then
+ # Ensure that /dev/std* streams have appropriate sandbox permission for
+ # bug #288863. This can be removed after sandbox is fixed and portage
+ # depends on the fixed version (sandbox-2.2 has the fix but it is
+ # currently unstable).
+ export SANDBOX_WRITE="${SANDBOX_WRITE:+${SANDBOX_WRITE}:}/dev/stdout:/dev/stderr"
+ export SANDBOX_READ="${SANDBOX_READ:+${SANDBOX_READ}:}/dev/stdin"
+fi
+
# Don't use sandbox's BASH_ENV for new shells because it does
# 'source /etc/profile' which can interfere with the build
# environment by modifying our PATH.
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 46685f891..12feea0ed 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -603,7 +603,8 @@ save_ebuild_env() {
PORTAGE_INST_UID PORTAGE_IPC_DAEMON \
PORTAGE_LOG_FILE PORTAGE_MASTER_PID \
PORTAGE_NONFATAL PORTAGE_QUIET PORTAGE_PYTHON \
- PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_SIGPIPE_STATUS \
+ PORTAGE_REPO_NAME PORTAGE_RESTRICT \
+ PORTAGE_SANDBOX_COMPAT_LEVEL PORTAGE_SIGPIPE_STATUS \
PORTAGE_UPDATE_ENV \
PORTAGE_USERNAME PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR \
PORTDIR_OVERLAY ${!PORTAGE_SANDBOX_*} PREROOTPATH \
diff --git a/pym/portage/const.py b/pym/portage/const.py
index 5ef7eece1..3a77006f7 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -121,6 +121,7 @@ _ENABLE_DYN_LINK_MAP = True
_ENABLE_PRESERVE_LIBS = True
_ENABLE_REPO_NAME_WARN = True
_ENABLE_SET_CONFIG = True
+_SANDBOX_COMPAT_LEVEL = "22"
# The definitions above will differ between branches, so it's useful to have
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 4ad4a0e9a..86226157e 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -14,7 +14,7 @@ env_blacklist = frozenset((
"HOMEPAGE", "INHERITED", "IUSE",
"KEYWORDS", "LICENSE", "PDEPEND", "PF", "PKGUSE",
"PORTAGE_BUILT_USE", "PORTAGE_CONFIGROOT", "PORTAGE_IUSE",
- "PORTAGE_NONFATAL", "PORTAGE_REPO_NAME",
+ "PORTAGE_NONFATAL", "PORTAGE_REPO_NAME", "PORTAGE_SANDBOX_COMPAT_LEVEL",
"PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "RESTRICT",
"ROOT", "SLOT", "SRC_URI"
))
@@ -52,7 +52,8 @@ environ_whitelist += [
"PORTAGE_IPC_DAEMON", "PORTAGE_IUSE",
"PORTAGE_LOG_FILE", "PORTAGE_MASTER_PID",
"PORTAGE_PYM_PATH", "PORTAGE_PYTHON", "PORTAGE_QUIET",
- "PORTAGE_REPO_NAME", "PORTAGE_RESTRICT", "PORTAGE_SIGPIPE_STATUS",
+ "PORTAGE_REPO_NAME", "PORTAGE_RESTRICT",
+ "PORTAGE_SANDBOX_COMPAT_LEVEL", "PORTAGE_SIGPIPE_STATUS",
"PORTAGE_TMPDIR", "PORTAGE_UPDATE_ENV", "PORTAGE_USERNAME",
"PORTAGE_VERBOSE", "PORTAGE_WORKDIR_MODE",
"PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", "PROFILE_PATHS",
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 443a735eb..6ccb1da5f 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -29,6 +29,7 @@ from portage.const import CACHE_PATH, \
MODULES_FILE_PATH, PORTAGE_BIN_PATH, PORTAGE_PYM_PATH, \
PRIVATE_PATH, PROFILE_PATH, USER_CONFIG_PATH, \
USER_VIRTUALS_FILE
+from portage.const import _SANDBOX_COMPAT_LEVEL
from portage.dbapi import dbapi
from portage.dbapi.porttree import portdbapi
from portage.dbapi.vartree import vartree
@@ -528,6 +529,9 @@ class config(object):
self["EROOT"] = eroot
self.backup_changes("EROOT")
+ self["PORTAGE_SANDBOX_COMPAT_LEVEL"] = _SANDBOX_COMPAT_LEVEL
+ self.backup_changes("PORTAGE_SANDBOX_COMPAT_LEVEL")
+
self.pkeywordsdict = portage.dep.ExtendedAtomDict(dict)
self._ppropertiesdict = portage.dep.ExtendedAtomDict(dict)
self._penvdict = portage.dep.ExtendedAtomDict(dict)