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

Unified Diff: host/cros_overlay_list

Issue 6596117: Update cros_overlay_list to support returning a list of overlays for all boards. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dev-util.git@master
Patch Set: Add -nopublic and --noprivate flags Created 9 years, 10 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: host/cros_overlay_list
diff --git a/host/cros_overlay_list b/host/cros_overlay_list
index 09a54bfeba3ed159e8f7c05434dfcfff0e58215d..c66415cd3b628dd1ff682541ef2958f9a93581eb 100755
--- a/host/cros_overlay_list
+++ b/host/cros_overlay_list
@@ -28,10 +28,16 @@ fi
get_default_board
# Flags
+DEFINE_boolean all_boards "${FLAGS_FALSE}" \
+ "Return paths to overlays for all boards. (Default: false)"
DEFINE_string board "$DEFAULT_BOARD" "The name of the board to set up."
DEFINE_string board_overlay "" "Location of the board overlay."
DEFINE_boolean primary_only ${FLAGS_FALSE} \
"Only return the path to the board's primary overlay. (Default: false)"
+DEFINE_boolean private ${FLAGS_TRUE} \
+ "Include private overlays. (Default: true)"
+DEFINE_boolean public ${FLAGS_TRUE} \
+ "Include public overlays. (Default: true)"
DEFINE_string variant "" "Board variant."
# Parse command line flags
@@ -42,6 +48,21 @@ eval set -- "${FLAGS_ARGV}"
# so will die prematurely if 'set -e' is specified before now.
set -e
+public() { [ "$FLAGS_public" = "$FLAGS_TRUE" ]; }
+private() { [ "$FLAGS_private" = "$FLAGS_TRUE" ]; }
+
+if [ "$FLAGS_all_boards" = "$FLAGS_TRUE" ] ; then
+ overlays=
+ public && overlays="$overlays ${SRC_ROOT}/overlays/*overlay*"
+ private && overlays="$overlays ${SRC_ROOT}/private-overlays/*overlay*"
+ for overlay in $overlays ; do
+ if [ -d "$overlay" ] ; then
+ echo $overlay
+ fi
+ done
+ exit 0
+fi
+
if [ -z "$FLAGS_board" ] ; then
error "--board required."
exit 1
@@ -86,9 +107,9 @@ PRIVATE_BOARD_OVERLAY="${SRC_ROOT}/private-overlays/${PRIVATE_OVERLAY_NAME}"
#
# Identify the primary board overlay or die.
#
-if is_primary_overlay ${BOARD_OVERLAY}; then
+if public && is_primary_overlay ${BOARD_OVERLAY}; then
PRIMARY_OVERLAY="${BOARD_OVERLAY}"
-elif is_primary_overlay "${PRIVATE_BOARD_OVERLAY}"; then
+elif private && is_primary_overlay "${PRIVATE_BOARD_OVERLAY}"; then
PRIMARY_OVERLAY="${PRIVATE_BOARD_OVERLAY}"
fi
if [ ! -n "${PRIMARY_OVERLAY}" ]; then
@@ -109,14 +130,14 @@ fi
#
CHROMEOS_OVERLAY="${SRC_ROOT}/private-overlays/chromeos-overlay"
-if [ -d "${CHROMEOS_OVERLAY}" ]; then
+if private && [ -d "${CHROMEOS_OVERLAY}" ]; then
echo "${CHROMEOS_OVERLAY}"
fi
#
# Check if there are any public board overlays.
#
-if [ -d "${BOARD_OVERLAY}" ]; then
+if public && [ -d "${BOARD_OVERLAY}" ]; then
echo "${BOARD_OVERLAY}"
#
@@ -132,7 +153,7 @@ fi
#
# Add any private overlays and private variant overlays for this board.
#
-if [ -d "${SRC_ROOT}/private-overlays" ] ; then
+if private && [ -d "${SRC_ROOT}/private-overlays" ] ; then
OVERLAY_NAME="overlay-${FLAGS_board}-private"
PRIVATE_OVERLAY="${SRC_ROOT}/private-overlays/${OVERLAY_NAME}"
« 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