summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-12-10 20:25:56 +0000
committerMike Frysinger <vapier@gentoo.org>2005-12-10 20:25:56 +0000
commit43f0bd9a8fe95deeb42f359f8d86976f1ef770f3 (patch)
tree4f62f8ccb572e43cee73a4e96ce7a6f6d4ed8513 /app-shells
parentStable on alpha. (diff)
downloadgentoo-2-43f0bd9a8fe95deeb42f359f8d86976f1ef770f3.tar.gz
gentoo-2-43f0bd9a8fe95deeb42f359f8d86976f1ef770f3.tar.bz2
gentoo-2-43f0bd9a8fe95deeb42f359f8d86976f1ef770f3.zip
Dont flood the env with functions #113624 and add sandboxwrite for custom ccache/distcc paths if they exist #114387. Both by Petteri Raty.
(Portage version: 2.0.53)
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/sandboxshell/ChangeLog10
-rw-r--r--app-shells/sandboxshell/files/digest-sandboxshell-0.3 (renamed from app-shells/sandboxshell/files/digest-sandboxshell-0.2)0
-rw-r--r--app-shells/sandboxshell/files/sandboxshell4
-rw-r--r--app-shells/sandboxshell/files/sandboxshell.conf25
-rw-r--r--app-shells/sandboxshell/sandboxshell-0.3.ebuild (renamed from app-shells/sandboxshell/sandboxshell-0.2.ebuild)2
5 files changed, 29 insertions, 12 deletions
diff --git a/app-shells/sandboxshell/ChangeLog b/app-shells/sandboxshell/ChangeLog
index 50c3a5c49b02..fd6f6bc804d6 100644
--- a/app-shells/sandboxshell/ChangeLog
+++ b/app-shells/sandboxshell/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for app-shells/sandboxshell
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/ChangeLog,v 1.7 2005/11/20 07:54:10 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/ChangeLog,v 1.8 2005/12/10 20:25:56 vapier Exp $
+
+*sandboxshell-0.3 (10 Dec 2005)
+
+ 10 Dec 2005; Mike Frysinger <vapier@gentoo.org> files/sandboxshell,
+ files/sandboxshell.conf, -sandboxshell-0.2.ebuild,
+ +sandboxshell-0.3.ebuild:
+ Dont flood the env with functions #113624 and add sandboxwrite for custom
+ ccache/distcc paths if they exist #114387. Both by Petteri Raty.
*sandboxshell-0.2 (20 Nov 2005)
diff --git a/app-shells/sandboxshell/files/digest-sandboxshell-0.2 b/app-shells/sandboxshell/files/digest-sandboxshell-0.3
index e69de29bb2d1..e69de29bb2d1 100644
--- a/app-shells/sandboxshell/files/digest-sandboxshell-0.2
+++ b/app-shells/sandboxshell/files/digest-sandboxshell-0.3
diff --git a/app-shells/sandboxshell/files/sandboxshell b/app-shells/sandboxshell/files/sandboxshell
index 165c9dcd13cb..a7c4dc2edfca 100644
--- a/app-shells/sandboxshell/files/sandboxshell
+++ b/app-shells/sandboxshell/files/sandboxshell
@@ -1,7 +1,7 @@
#!/bin/bash
# Written by vapier@gentoo.org
# public-domain code ... z0r ...
-# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/files/sandboxshell,v 1.3 2005/11/20 07:54:10 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/files/sandboxshell,v 1.4 2005/12/10 20:25:56 vapier Exp $
. /sbin/functions.sh
. /etc/profile
@@ -36,5 +36,5 @@ einfo " adddeny <path>: deny access to <path>"
einfo " addpredict <path>: allow fake access to <path>"
export SANDBOX_ACTIVE="armedandready"
-export SANDBOX_WRITE=${SANDBOX_WRITE}:$(pwd):/etc/mtab:/dev/ram5:/root/.ccache
+export SANDBOX_WRITE=${SANDBOX_WRITE}:$(pwd):/etc/mtab
exec /bin/bash --init-file /etc/sandboxshell.conf
diff --git a/app-shells/sandboxshell/files/sandboxshell.conf b/app-shells/sandboxshell/files/sandboxshell.conf
index 75df274ca688..3ed6daafc2c7 100644
--- a/app-shells/sandboxshell/files/sandboxshell.conf
+++ b/app-shells/sandboxshell/files/sandboxshell.conf
@@ -1,7 +1,7 @@
#!/bin/bash
# Written by vapier@gentoo.org
# public-domain code ... z0r ...
-# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/files/sandboxshell.conf,v 1.6 2005/11/20 10:57:15 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/files/sandboxshell.conf,v 1.7 2005/12/10 20:25:56 vapier Exp $
trap ":" INT QUIT TSTP
@@ -31,21 +31,30 @@ if [[ ${PWD:0:${#sbs_pdir}} == "${sbs_pdir}" ]] ; then
read env
sbs_PREPWD=${PWD}
if [[ ${env} == "y" ]] ; then
- set -a
+ # First try to source variables and export them ...
+ eval $(sed -e '/^[[:alnum:]_-]*=/s:^:export :' -e '/^[[:alnum:]_-]* ()/Q' "${sbs_tmpenvfile}") 2>/dev/null
+ # Then grab everything (including functions)
source "${sbs_tmpenvfile}" 2> /dev/null
- set +a
export SANDBOX_WRITE=${SANDBOX_WRITE}:${sbs_pdir}${sbs_bdir}:${sbs_pdir}/homedir
fi
PWD=${sbs_PREPWD}
fi
fi
-cd ${PWD}
+unset sbs_gpdir sbs_cpdir sbs_pdir sbs_bdir sbs_tmpenvfile sbs_PREPWD env
+
+cd "${PWD}"
export PS1="[s]${PS1}"
-adddeny() { export SANDBOX_DENY=$SANDBOX_DENY:$1 ; }
-addpredict() { export SANDBOX_PREDICT="$SANDBOX_PREDICT:$1" ; }
-addread() { export SANDBOX_READ="$SANDBOX_READ:$1" ; }
-addwrite() { export SANDBOX_WRITE="$SANDBOX_WRITE:$1" ; }
+adddeny() { export SANDBOX_DENY=${SANDBOX_DENY}:$1 ; }
+addpredict() { export SANDBOX_PREDICT=${SANDBOX_PREDICT}:$1 ; }
+addread() { export SANDBOX_READ=${SANDBOX_READ}:$1 ; }
+addwrite() { export SANDBOX_WRITE=${SANDBOX_WRITE}:$1 ; }
sandboxon() { export SANDBOX_ON="1" ; }
sandboxoff() { export SANDBOX_OFF="0" ; }
+
+[[ -z ${CCACHE_DIR} ]] && export CCACHE_DIR=/root/.ccache
+for var in CCACHE_DIR DISTCC_DIR ; do
+ [[ ${!var+set} == "set" ]] && addwrite ${!var}
+done
+unset var
diff --git a/app-shells/sandboxshell/sandboxshell-0.2.ebuild b/app-shells/sandboxshell/sandboxshell-0.3.ebuild
index 4cf369246d38..ceff0e14e38d 100644
--- a/app-shells/sandboxshell/sandboxshell-0.2.ebuild
+++ b/app-shells/sandboxshell/sandboxshell-0.3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/sandboxshell-0.2.ebuild,v 1.1 2005/11/20 07:54:10 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/sandboxshell-0.3.ebuild,v 1.1 2005/12/10 20:25:56 vapier Exp $
DESCRIPTION="launch a sandboxed shell ... useful for debugging ebuilds"
HOMEPAGE="http://wh0rd.org/"