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

Side by Side Diff: cros_workon

Issue 3468009: cros_workon: only touch local_manifest for minilayout users (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Created 10 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 done 129 done
130 130
131 echo "${names}" 131 echo "${names}"
132 } 132 }
133 133
134 # Display ebuilds currently part of the live branch and open for development. 134 # Display ebuilds currently part of the live branch and open for development.
135 show_live_ebuilds () { 135 show_live_ebuilds () {
136 sed -n 's/^[~=]\(.*\)-9999$/\1/p' "${WORKON_FILE}" 136 sed -n 's/^[~=]\(.*\)-9999$/\1/p' "${WORKON_FILE}"
137 } 137 }
138 138
139 find_repo_dir () {
140 curdir=`pwd`
141 while [ $curdir != / ]; do
142 if [ -d "$curdir/.repo" ]; then
143 #echo "Found .repo directory at ${curdir}"
144 REPODIR=${curdir}/.repo
145 return 0
146 fi
147 curdir=`dirname "$curdir"`
148 done
149 echo "Unable to find .repo directory. Did you checkout with repo?"
150 exit 1
151 }
152
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. 139 # 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() { 140 regen_manifest_and_sync() {
141 # Nothing to do unless you are working on the minilayout
142 local manifest=${CHROOT_TRUNK_DIR}/.repo/manifest.xml
143 if [ $(basename $(readlink -f ${manifest})) != "minilayout.xml" ]; then
144 return
145 fi
146
156 for pkgname in $(show_live_ebuilds); do 147 for pkgname in $(show_live_ebuilds); do
157 eval $(${EBUILDCMD} $(${EQUERYCMD} which ${pkgname}) info) 148 eval $(${EBUILDCMD} $(${EQUERYCMD} which ${pkgname}) info)
158 local srcdir=$(readlink -m ${CROS_WORKON_SRCDIR}) 149 local srcdir=$(readlink -m ${CROS_WORKON_SRCDIR})
159 local trunkdir=$(readlink -m ${CHROOT_TRUNK_DIR}) 150 local trunkdir=$(readlink -m ${CHROOT_TRUNK_DIR})
160 local project_path=${srcdir#${trunkdir}/} 151 local project_path=${srcdir#${trunkdir}/}
161 152
162 loman add --workon "${CROS_WORKON_PROJECT}" "${project_path}" 153 loman add --workon "${CROS_WORKON_PROJECT}" "${project_path}"
163 done 154 done
164 echo "Please run \"repo sync\" now." 155 echo "Please run \"repo sync\" now."
165 } 156 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 esac 224 esac
234 fi 225 fi
235 226
236 case ${WORKON_CMD} in 227 case ${WORKON_CMD} in
237 start) ebuild_to_live "${ATOM_LIST}" ;; 228 start) ebuild_to_live "${ATOM_LIST}" ;;
238 stop) ebuild_to_stable "${ATOM_LIST}" ;; 229 stop) ebuild_to_stable "${ATOM_LIST}" ;;
239 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko n_ebuilds ${BOARD_KEYWORD} ;; 230 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko n_ebuilds ${BOARD_KEYWORD} ;;
240 iterate)ebuild_iterate "${ATOM_LIST}" ;; 231 iterate)ebuild_iterate "${ATOM_LIST}" ;;
241 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;; 232 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;;
242 esac 233 esac
OLDNEW
« 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