Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: common.sh

Issue 5444002: restart_in_chroot_if_needed can run scripts from bin/. cros_workon_now does this (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bin/cros_workon_make ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common.sh
diff --git a/common.sh b/common.sh
index b7d428dab5bcca65bb2f042eb2aa63acea944761..b85ee4ad546c550907750f1874bafc1b2a1ee791 100644
--- a/common.sh
+++ b/common.sh
@@ -106,7 +106,7 @@ DEFAULT_BUILD_ROOT=${CHROMEOS_BUILD_ROOT:-"$SRC_ROOT/build"}
# Set up a global ALL_BOARDS value
if [ -d $SRC_ROOT/overlays ]; then
ALL_BOARDS=$(cd $SRC_ROOT/overlays;ls -1d overlay-* 2>&-|sed 's,overlay-,,g')
-fi
+fi
# Strip CR
ALL_BOARDS=$(echo $ALL_BOARDS)
# Set a default BOARD
@@ -234,11 +234,15 @@ function make_pkg_common {
# Enter a chroot and restart the current script if needed
function restart_in_chroot_if_needed {
+ # NB: Pass in ARGV: restart_in_chroot_if_needed "$@"
if [ $INSIDE_CHROOT -ne 1 ]
then
- # Equivalent to enter_chroot.sh -- <current command>
+ local abspath=$(readlink -f "$0")
+ # $abspath minus everything up to /src/scripts/
Chris Masone 2010/12/01 21:18:52 it removes everything up to and including /src/scr
+ local path_from_scripts="${abspath##*/src/scripts/}"
exec $SCRIPTS_DIR/enter_chroot.sh -- \
- $CHROOT_TRUNK_DIR/src/scripts/$(basename $0) $*
+ "$CHROOT_TRUNK_DIR/src/scripts/$path_from_scripts" "$@"
+ exit
fi
}
« no previous file with comments | « bin/cros_workon_make ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698