diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-11-20 07:54:10 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-11-20 07:54:10 +0000 |
commit | 2f49883123e61a79077896248af40a4fc0c28105 (patch) | |
tree | e5d4758f827ab3b78890ce0a9adeb753b11a035f /app-shells | |
parent | Update libaio patch to work with both old and new versions #103427. (diff) | |
download | gentoo-2-2f49883123e61a79077896248af40a4fc0c28105.tar.gz gentoo-2-2f49883123e61a79077896248af40a4fc0c28105.tar.bz2 gentoo-2-2f49883123e61a79077896248af40a4fc0c28105.zip |
Touchup code and add support for exporting vars from the portage environment file #112618 by Petteri Raty.
(Portage version: 2.0.53_rc7)
Diffstat (limited to 'app-shells')
-rw-r--r-- | app-shells/sandboxshell/ChangeLog | 10 | ||||
-rw-r--r-- | app-shells/sandboxshell/files/digest-sandboxshell-0.2 (renamed from app-shells/sandboxshell/files/digest-sandboxshell-0.1-r2) | 0 | ||||
-rw-r--r-- | app-shells/sandboxshell/files/sandboxshell | 6 | ||||
-rw-r--r-- | app-shells/sandboxshell/files/sandboxshell.conf | 58 | ||||
-rw-r--r-- | app-shells/sandboxshell/sandboxshell-0.2.ebuild (renamed from app-shells/sandboxshell/sandboxshell-0.1-r2.ebuild) | 2 |
5 files changed, 35 insertions, 41 deletions
diff --git a/app-shells/sandboxshell/ChangeLog b/app-shells/sandboxshell/ChangeLog index 8d5b7e720a01..50c3a5c49b02 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.6 2005/04/27 03:12:53 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/ChangeLog,v 1.7 2005/11/20 07:54:10 vapier Exp $ + +*sandboxshell-0.2 (20 Nov 2005) + + 20 Nov 2005; Mike Frysinger <vapier@gentoo.org> files/sandboxshell, + files/sandboxshell.conf, -sandboxshell-0.1-r2.ebuild, + +sandboxshell-0.2.ebuild: + Touchup code and add support for exporting vars from the portage environment + file #112618 by Petteri Raty. *sandboxshell-0.1-r2 (27 Apr 2005) diff --git a/app-shells/sandboxshell/files/digest-sandboxshell-0.1-r2 b/app-shells/sandboxshell/files/digest-sandboxshell-0.2 index e69de29bb2d1..e69de29bb2d1 100644 --- a/app-shells/sandboxshell/files/digest-sandboxshell-0.1-r2 +++ b/app-shells/sandboxshell/files/digest-sandboxshell-0.2 diff --git a/app-shells/sandboxshell/files/sandboxshell b/app-shells/sandboxshell/files/sandboxshell index 9ba530b05096..165c9dcd13cb 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.2 2005/04/27 03:12:53 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/files/sandboxshell,v 1.3 2005/11/20 07:54:10 vapier Exp $ . /sbin/functions.sh . /etc/profile @@ -14,7 +14,7 @@ cd ${PWD} || { for SANDBOX_LIB in /lib /usr/lib ; do SANDBOX_LIB=${SANDBOX_LIB}/libsandbox.so - [ -e ${SANDBOX_LIB} ] && break + [[ -e ${SANDBOX_LIB} ]] && break done export LD_PRELOAD=${SANDBOX_LIB} export SANDBOX_LOG="/tmp/sandboxme-$(date '+%d.%m.%Y-%H.%M.%S').log" @@ -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:/dev/ram5:/root/.ccache 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 a34e3abe9578..e824bb985956 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.4 2004/06/24 00:25:51 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/files/sandboxshell.conf,v 1.5 2005/11/20 07:54:10 vapier Exp $ trap ":" INT QUIT TSTP @@ -9,30 +9,33 @@ source /etc/profile # do ebuild environment loading ... detect if we're in portage # build area or not ... uNF uNF uNF -#sbs_pdir=`portageq envvar PORTAGE_TMPDIR`/portage/ #portageq takes too long imo -if [ -z "${PORTAGE_TMPDIR}" ] ; then - sbs_gpdir=`( source /etc/make.globals && echo $PORTAGE_TMPDIR ) 2> /dev/null` - sbs_cpdir=`( source /etc/make.conf && echo $PORTAGE_TMPDIR ) 2> /dev/null` - [ -z "${sbs_cpdir}" ] \ +#sbs_pdir=$(portageq envvar PORTAGE_TMPDIR)/portage/ #portageq takes too long imo +if [[ -z ${PORTAGE_TMPDIR} ]] ; then + sbs_gpdir=$( source /etc/make.globals && echo $PORTAGE_TMPDIR 2> /dev/null) + sbs_cpdir=$( source /etc/make.conf && echo $PORTAGE_TMPDIR 2> /dev/null) + [[ -z ${sbs_cpdir} ]] \ && sbs_pdir=${sbs_gpdir} \ || sbs_pdir=${sbs_cpdir} else sbs_pdir=${PORTAGE_TMPDIR} fi -[ -z "${sbs_pdir}" ] && sbs_pdir=/var/tmp +[[ -z ${sbs_pdir} ]] && sbs_pdir=/var/tmp sbs_pdir=${sbs_pdir}/portage/ -if [ "${PWD:0:${#sbs_pdir}}" == "${sbs_pdir}" ] ; then - sbs_bdir=`echo ${PWD:${#sbs_pdir}} | cut -d/ -f1` +if [[ ${PWD:0:${#sbs_pdir}} == "${sbs_pdir}" ]] ; then + sbs_bdir=$(echo ${PWD:${#sbs_pdir}} | cut -d/ -f1) sbs_tmpenvfile=${sbs_pdir}${sbs_bdir}/temp/environment - if [ -e "${sbs_tmpenvfile}" ] ; then + if [[ -e ${sbs_tmpenvfile} ]] ; then echo "Found environment at ${sbs_tmpenvfile}" printf " * Would you like to enter the portage environment ? " read env sbs_PREPWD=${PWD} - if [ "${env}" == "y" ] ; then - source ${sbs_tmpenvfile} 2> /dev/null - export SANDBOX_WRITE="${SANDBOX_WRITE}:${sbs_pdir}${sbs_bdir}:${sbs_pdir}/homedir" + if [[ ${env} == "y" ]] ; then + # 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 + export SANDBOX_WRITE=${SANDBOX_WRITE}:${sbs_pdir}${sbs_bdir}:${sbs_pdir}/homedir fi PWD=${sbs_PREPWD} fi @@ -41,26 +44,9 @@ fi 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" -} - -sandboxon() { - export SANDBOX_ON="1" -} - -sandboxoff() { - export SANDBOX_OFF="0" -} +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" ; } diff --git a/app-shells/sandboxshell/sandboxshell-0.1-r2.ebuild b/app-shells/sandboxshell/sandboxshell-0.2.ebuild index a2791771288e..4cf369246d38 100644 --- a/app-shells/sandboxshell/sandboxshell-0.1-r2.ebuild +++ b/app-shells/sandboxshell/sandboxshell-0.2.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.1-r2.ebuild,v 1.1 2005/04/27 03:12:53 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/sandboxshell/sandboxshell-0.2.ebuild,v 1.1 2005/11/20 07:54:10 vapier Exp $ DESCRIPTION="launch a sandboxed shell ... useful for debugging ebuilds" HOMEPAGE="http://wh0rd.org/" |