OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # Common constants for build scripts | 5 # Common constants for build scripts |
6 # This must evaluate properly for both /bin/bash and /bin/sh | 6 # This must evaluate properly for both /bin/bash and /bin/sh |
7 | 7 |
8 # All scripts should die on error unless commands are specifically excepted | 8 # All scripts should die on error unless commands are specifically excepted |
9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'. | 9 # by prefixing with '!' or surrounded by 'set +e' / 'set -e'. |
10 # TODO: Re-enable this once shflags is less prone to dying. | 10 # TODO: Re-enable this once shflags is less prone to dying. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 read -n1 -p "Press any key to continue using the OLD build system..." | 134 read -n1 -p "Press any key to continue using the OLD build system..." |
135 echo | 135 echo |
136 echo | 136 echo |
137 fi | 137 fi |
138 ;; | 138 ;; |
139 esac | 139 esac |
140 | 140 |
141 # ----------------------------------------------------------------------------- | 141 # ----------------------------------------------------------------------------- |
142 # Functions | 142 # Functions |
143 | 143 |
| 144 function setup_board_warning { |
| 145 echo |
| 146 echo "$V_REVERSE================= WARNING ======================$V_VIDOFF" |
| 147 echo |
| 148 echo "*** No default board detected in " \ |
| 149 "$GCLIENT_ROOT/src/scripts/.default_board" |
| 150 echo "*** Either run setup_board with default flag set" |
| 151 echo "*** or echo |board_name| > $GCLIENT_ROOT/src/scripts/.default_board" |
| 152 echo |
| 153 } |
| 154 |
| 155 |
| 156 # Sets the default board variable for calling script |
| 157 function get_default_board { |
| 158 DEFAULT_BOARD= |
| 159 |
| 160 if [ -f "$GCLIENT_ROOT/src/scripts/.default_board" ] ; then |
| 161 DEFAULT_BOARD=`cat "$GCLIENT_ROOT/src/scripts/.default_board"` |
| 162 fi |
| 163 } |
| 164 |
| 165 |
144 # Make a package | 166 # Make a package |
145 function make_pkg_common { | 167 function make_pkg_common { |
146 # Positional parameters from calling script. :? means "fail if unset". | 168 # Positional parameters from calling script. :? means "fail if unset". |
147 set -e | 169 set -e |
148 PKG_BASE=${1:?} | 170 PKG_BASE=${1:?} |
149 shift | 171 shift |
150 set +e | 172 set +e |
151 | 173 |
152 # All packages are built in the chroot | 174 # All packages are built in the chroot |
153 assert_inside_chroot | 175 assert_inside_chroot |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 V_RED="\e[31m" | 258 V_RED="\e[31m" |
237 V_YELLOW="\e[33m" | 259 V_YELLOW="\e[33m" |
238 | 260 |
239 function warn { | 261 function warn { |
240 echo -e "${V_YELLOW}Warning..: $1${V_VIDOFF}" | 262 echo -e "${V_YELLOW}Warning..: $1${V_VIDOFF}" |
241 } | 263 } |
242 | 264 |
243 function error { | 265 function error { |
244 echo -e "${V_RED}Error....: $1${V_VIDOFF}" | 266 echo -e "${V_RED}Error....: $1${V_VIDOFF}" |
245 } | 267 } |
OLD | NEW |