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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 done | 148 done |
149 echo "Unable to find .repo directory. Did you checkout with repo?" | 149 echo "Unable to find .repo directory. Did you checkout with repo?" |
150 exit 1 | 150 exit 1 |
151 } | 151 } |
152 | 152 |
153 | 153 |
154 # This is called only for "cros-workon start". We dont handle the "stop" case si
nce the local changes are ignored anyway since the 9999.ebuild is masked and we
dont want to deal with what to do with the user's local changes. | 154 # This is called only for "cros-workon start". We dont handle the "stop" case si
nce the local changes are ignored anyway since the 9999.ebuild is masked and we
dont want to deal with what to do with the user's local changes. |
155 regen_manifest_and_sync() { | 155 regen_manifest_and_sync() { |
156 for pkgname in $(show_live_ebuilds); do | 156 for pkgname in $(show_live_ebuilds); do |
157 eval $(${EBUILDCMD} $(${EQUERYCMD} which ${pkgname}) info) | 157 eval $(${EBUILDCMD} $(${EQUERYCMD} which ${pkgname}) info) |
158 local srcdir=$(readlink -f ${CROS_WORKON_SRCDIR}) | 158 local srcdir=$(readlink -m ${CROS_WORKON_SRCDIR}) |
159 local trunkdir=$(readlink -f ${CHROOT_TRUNK_DIR}) | 159 local trunkdir=$(readlink -m ${CHROOT_TRUNK_DIR}) |
160 local project_path=${srcdir#$(readlink -f ${CHROOT_TRUNK_DIR})/} | 160 local project_path=${srcdir#${trunkdir}/} |
161 | 161 |
162 loman add --workon "${CROS_WORKON_PROJECT}" "${project_path}" | 162 loman add --workon "${CROS_WORKON_PROJECT}" "${project_path}" |
163 done | 163 done |
164 echo "Please run \"repo sync\" now." | 164 echo "Please run \"repo sync\" now." |
165 } | 165 } |
166 | 166 |
167 # Move a stable ebuild to the live development catgeory. The ebuild | 167 # Move a stable ebuild to the live development catgeory. The ebuild |
168 # src_unpack step fetches the package source for local development. | 168 # src_unpack step fetches the package source for local development. |
169 ebuild_to_live () { | 169 ebuild_to_live () { |
170 local atoms=$1 | 170 local atoms=$1 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 esac | 233 esac |
234 fi | 234 fi |
235 | 235 |
236 case ${WORKON_CMD} in | 236 case ${WORKON_CMD} in |
237 start) ebuild_to_live "${ATOM_LIST}" ;; | 237 start) ebuild_to_live "${ATOM_LIST}" ;; |
238 stop) ebuild_to_stable "${ATOM_LIST}" ;; | 238 stop) ebuild_to_stable "${ATOM_LIST}" ;; |
239 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko
n_ebuilds ${BOARD_KEYWORD} ;; | 239 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko
n_ebuilds ${BOARD_KEYWORD} ;; |
240 iterate)ebuild_iterate "${ATOM_LIST}" ;; | 240 iterate)ebuild_iterate "${ATOM_LIST}" ;; |
241 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;; | 241 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;; |
242 esac | 242 esac |
OLD | NEW |