Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 58 lines (44 sloc) 1.28 KB
#!/bin/bash
source "/usr/share/dar/dar-functions"
function help {
cat <<EOF
usage: dar-shell [-q] [-v] [-d dist,dist2] cmd
Acquire a shell in one or more DAR build environments
dar-exec options:
-d dist,dist2 select build envs
-h this help message
-q be very quiet
-v more verbose
exported variables:
arch, dist, nick, path, repo, tag
EOF
exit 1
}
daropts "d:hqv" $@
CMD="$OPTS"
if [ ! -d "$ROOT" ]; then
echo "ERROR: probably in chroot jail" >&2
exit 1
fi
set_dists
set_as_root
AS_ROOT=1
for distname in $DISTS; do
if [ -z "$QUIET" ]; then
echo -e "$_BL_$_WH= Entering $_YE$distname$_WH shell.$_DE"
fi
if [ -r "$CONFIGDIR/dists/$distname/config" ]; then
source "$CONFIGDIR/dists/$distname/config"
export arch="$DISTARCH" dist="${DISTNAME// *}" nick="$DISTNICK" path="$DISTPATH" repo="$REPO" tag="${DISTTAG// *}"
fi
if [ -z "$FORCE_VERBOSE" ]; then
setarch $DISTARCH /usr/sbin/chroot "$CHROOTDIR/$distname" /bin/bash --login
else
setarch $DISTARCH /usr/sbin/chroot "$CHROOTDIR/$distname" /bin/bash --login -x
fi
done
if [ -z "$QUIET" ]; then
echo -en "$_BL_$_WH= Returning to ${_YE}parent$_WH shell. Press ENTER.$_DE"
read a
fi
exit 0