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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 [ -f "${UNMASK_FILE}" ] && sudo mv "${UNMASK_FILE}" "${WORKON_FILE}" | 96 [ -f "${UNMASK_FILE}" ] && sudo mv "${UNMASK_FILE}" "${WORKON_FILE}" |
97 sudo ln -s "${WORKON_FILE}" "${UNMASK_FILE}" || \ | 97 sudo ln -s "${WORKON_FILE}" "${UNMASK_FILE}" || \ |
98 die "ln -s ${WORKON_FILE} ${UNMASK_FILE}" | 98 die "ln -s ${WORKON_FILE} ${UNMASK_FILE}" |
99 fi | 99 fi |
100 | 100 |
101 # Canonicalize package name to category/package. | 101 # Canonicalize package name to category/package. |
102 canonicalize_name () { | 102 canonicalize_name () { |
103 local pkgfile | 103 local pkgfile |
104 local pkgname | 104 local pkgname |
105 | 105 |
| 106 if grep -qx "=$1-9999" "${WORKON_FILE}" ; then |
| 107 echo $1 |
| 108 return 0 |
| 109 fi |
| 110 |
106 if ! pkgfile=$(ACCEPT_KEYWORDS="~${BOARD_KEYWORD}" ${EQUERYCMD} which $1); the
n | 111 if ! pkgfile=$(ACCEPT_KEYWORDS="~${BOARD_KEYWORD}" ${EQUERYCMD} which $1); the
n |
107 warn "error looking up package $1" 1>&2 | 112 warn "error looking up package $1" 1>&2 |
108 return 1 | 113 return 1 |
109 fi | 114 fi |
110 | 115 |
111 pkgname=$(\ | 116 pkgname=$(\ |
112 echo "${pkgfile}" |awk -F '/' '{ print $(NF-2) "/" $(NF-1) }') | 117 echo "${pkgfile}" |awk -F '/' '{ print $(NF-2) "/" $(NF-1) }') |
113 | 118 |
114 if ! grep -q "cros-workon" ${pkgfile}; then | 119 if ! grep -q "cros-workon" ${pkgfile}; then |
115 warn "${pkgname} is not a cros-workon package" 1>&2 | 120 warn "${pkgname} is not a cros-workon package" 1>&2 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 fi | 244 fi |
240 | 245 |
241 case ${WORKON_CMD} in | 246 case ${WORKON_CMD} in |
242 start) ebuild_to_live "${ATOM_LIST}" ;; | 247 start) ebuild_to_live "${ATOM_LIST}" ;; |
243 stop) ebuild_to_stable "${ATOM_LIST}" ;; | 248 stop) ebuild_to_stable "${ATOM_LIST}" ;; |
244 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko
n_ebuilds ${BOARD_KEYWORD} ;; | 249 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko
n_ebuilds ${BOARD_KEYWORD} ;; |
245 list-all) show_all_live_ebuilds ;; | 250 list-all) show_all_live_ebuilds ;; |
246 iterate)ebuild_iterate "${ATOM_LIST}" ;; | 251 iterate)ebuild_iterate "${ATOM_LIST}" ;; |
247 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;; | 252 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;; |
248 esac | 253 esac |
OLD | NEW |