Chromium Code Reviews| Index: common.sh |
| diff --git a/common.sh b/common.sh |
| index a4d91384339d8fc61b450229f2149111eea1c3e1..6d34ff3e8e840d02b9dbda8c39cb1718fa4aff3a 100644 |
| --- a/common.sh |
| +++ b/common.sh |
| @@ -17,11 +17,24 @@ NUM_JOBS=`grep -c "^processor" /proc/cpuinfo` |
| # Store location of the calling script. |
| TOP_SCRIPT_DIR="${TOP_SCRIPT_DIR:-$(dirname $0)}" |
| +# Detect whether we're inside a chroot or not |
| +if [ -e /etc/debian_chroot ] |
| +then |
| + INSIDE_CHROOT=1 |
| +else |
| + INSIDE_CHROOT=0 |
| +fi |
| + |
| # Find root of source tree |
| if [ "x$GCLIENT_ROOT" != "x" ] |
| then |
| # GCLIENT_ROOT already set, so we're done |
| true |
| +elif [ $INSIDE_CHROOT -eq 1 ] |
| +then |
| + # If we are inside the chroot and we haven't been told otherwise, we assume |
| + # that the GCLIENT_ROOT is ~/trunk. |
| + GCLIENT_ROOT="/home/${SUDO_USER:-$USER}/trunk" |
|
davidjames
2011/01/26 21:26:14
Hmm, so this doesn't work for me.
./enter_chroot.
|
| elif [ "x$COMMON_SH" != "x" ] |
| then |
| # COMMON_SH set, so assume that's us |
| @@ -116,14 +129,6 @@ DEFAULT_BOARD=$(echo $ALL_BOARDS | awk '{print $NF}') |
| # Enable --fast by default. |
| DEFAULT_FAST="${FLAGS_TRUE}" |
| -# Detect whether we're inside a chroot or not |
| -if [ -e /etc/debian_chroot ] |
| -then |
| - INSIDE_CHROOT=1 |
| -else |
| - INSIDE_CHROOT=0 |
| -fi |
| - |
| # Directory locations inside the dev chroot |
| CHROOT_TRUNK_DIR="/home/$USER/trunk" |