#!/bin/bash source "/usr/share/dar/dar-functions" function help { cat <&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= Executing \"$_YE$CMD$_WH\" for $_YE$distname$_WH.$_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 ### Check for building as user if [ $AS_ROOT -eq 1 ]; then # DO_SU="/bin/su -l -c" if [ "$FORCE_VERBOSE" ]; then DO_SU="/bin/bash -x -s" else DO_SU="/bin/bash -s" fi else if [ "$FORCE_VERBOSE" ]; then DO_SU="/bin/su -lm $BUILD_USER -- /bin/bash -x -s" else DO_SU="/bin/su -lm $BUILD_USER -- /bin/bash -s" fi fi # echo chroot "$CHROOTDIR/$distname" $DO_SU $CMD # chroot "$CHROOTDIR/$distname" $DO_SU $CMD echo "$CMD" | chroot "$CHROOTDIR/$distname" $DO_SU RC=$? if [ $RC -ne 0 ]; then error "$_RE_${_WH}Failed execution (RC=$_YE$RC$_WH)$_DE" fi done exit 0