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

Unified Diff: bin/cros_overlay_list

Issue 6293021: Update cros_overlay_list to work from either src/scripts or /usr/bin. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 11 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cros_overlay_list
diff --git a/bin/cros_overlay_list b/bin/cros_overlay_list
index 2cf911a858141888a84037eadf03bdf69e79efe4..7031068261db71568b91fabc5147c27476a6f2c0 100755
--- a/bin/cros_overlay_list
+++ b/bin/cros_overlay_list
@@ -6,9 +6,24 @@
# This script generates the list of board overlays and variants.
-# Load common constants. This should be the first executable line.
-# The path to common.sh should be relative to your script's location.
-. "$(dirname "$0")/../common.sh"
+# Load common CrOS utilities. Inside the chroot this file is installed in
+# /usr/lib/crosutils. Outside the chroot we find it relative to the scripts
+# location.
+common_paths="/usr/lib/crosutils $(dirname "$0")/.."
+
+for path in ${common_paths} ; do
+ if [ -f "${path}/common.sh" ] ; then
+ COMMON_SH="${path}/common.sh"
+ break
+ fi
+done
+
+if [ -z "${COMMON_SH}" ] ; then
+ error "common.sh not found in search path (${common_paths})"
+ exit 1
+fi
+
+. "${COMMON_SH}"
Greg Spencer (Chromium) 2011/01/26 22:30:45 So, in my CL for cleaning things up, I've used the
robotboy 2011/01/26 23:07:38 I think I prefer to have the error checking and re
Greg Spencer (Chromium) 2011/01/26 23:47:46 No, that's fine. I might even adopt some of it fo
get_default_board
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698