OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # This script moves ebuilds between 'stable' and 'live' states. | 7 # This script moves ebuilds between 'stable' and 'live' states. |
8 # By default 'stable' ebuilds point at and build from source at the | 8 # By default 'stable' ebuilds point at and build from source at the |
9 # last known good commit. Moving an ebuild to 'live' (via cros_workon start) | 9 # last known good commit. Moving an ebuild to 'live' (via cros_workon start) |
10 # is intended to support development. The current source tip is fetched, | 10 # is intended to support development. The current source tip is fetched, |
(...skipping 27 matching lines...) Expand all Loading... | |
38 iterate: For each ebuild, cd to the source dir and run a commond" | 38 iterate: For each ebuild, cd to the source dir and run a commond" |
39 FLAGS "$@" || exit 1 | 39 FLAGS "$@" || exit 1 |
40 eval set -- "${FLAGS_ARGV}" | 40 eval set -- "${FLAGS_ARGV}" |
41 | 41 |
42 | 42 |
43 # eat the workon command keywords: start, stop or list. | 43 # eat the workon command keywords: start, stop or list. |
44 WORKON_CMD=$1 | 44 WORKON_CMD=$1 |
45 shift | 45 shift |
46 | 46 |
47 | 47 |
48 # board dir config | 48 # Board dir config |
49 | |
50 # If both are specified, just use host, because board does not | |
51 # have to be specified and may come from default, in which case | |
52 # there's no way to override. | |
49 [ -n "${FLAGS_board}" ] && [ "${FLAGS_host}" = ${FLAGS_TRUE} ] && \ | 53 [ -n "${FLAGS_board}" ] && [ "${FLAGS_host}" = ${FLAGS_TRUE} ] && \ |
50 die "Flags --host and --board are mutually exclusive." | 54 FLAGS_board="" # kill board |
Mandeep Singh Baines
2010/08/27 01:47:01
I'm uncomfortable with modifying a shflags paramet
| |
51 [ -z "${FLAGS_board}" ] && [ "${FLAGS_host}" = ${FLAGS_FALSE} ] && \ | 55 [ -z "${FLAGS_board}" ] && [ "${FLAGS_host}" = ${FLAGS_FALSE} ] && \ |
52 die "You must specify either --host or --board=" | 56 die "You must specify either --host or --board=" |
53 | 57 |
54 if [ -n "${FLAGS_board}" ]; then | 58 if [ -n "${FLAGS_board}" ]; then |
Mandeep Singh Baines
2010/08/27 01:47:01
What if this were changed to [ -n "${FLAGS_host}"
| |
55 BOARD_DIR=/build/"${FLAGS_board}" # --board specified | 59 BOARD_DIR=/build/"${FLAGS_board}" # --board specified |
56 EQUERYCMD=equery-"${FLAGS_board}" | 60 EQUERYCMD=equery-"${FLAGS_board}" |
57 EBUILDCMD=ebuild-"${FLAGS_board}" | 61 EBUILDCMD=ebuild-"${FLAGS_board}" |
58 else | 62 else |
59 BOARD_DIR="" # --host specified | 63 BOARD_DIR="" # --host specified |
60 EQUERYCMD=equery | 64 EQUERYCMD=equery |
61 EBUILDCMD=ebuild | 65 EBUILDCMD=ebuild |
62 fi | 66 fi |
63 | 67 |
64 WORKON_DIR=${CHROOT_TRUNK_DIR}/.config/cros_workon | 68 WORKON_DIR=${CHROOT_TRUNK_DIR}/.config/cros_workon |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
234 esac | 238 esac |
235 fi | 239 fi |
236 | 240 |
237 case ${WORKON_CMD} in | 241 case ${WORKON_CMD} in |
238 start) ebuild_to_live "${ATOM_LIST}"; regen_manifest_and_sync ;; | 242 start) ebuild_to_live "${ATOM_LIST}"; regen_manifest_and_sync ;; |
239 stop) ebuild_to_stable "${ATOM_LIST}" ;; | 243 stop) ebuild_to_stable "${ATOM_LIST}" ;; |
240 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko n_ebuilds ;; | 244 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko n_ebuilds ;; |
241 iterate)ebuild_iterate "${ATOM_LIST}" ;; | 245 iterate)ebuild_iterate "${ATOM_LIST}" ;; |
242 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;; | 246 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;; |
243 esac | 247 esac |
OLD | NEW |