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

Side by Side Diff: cros_workon

Issue 3335004: Whitespace/tab cleanup for cros_workon (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 143 }
144 144
145 145
146 # 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. 146 # 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.
147 regen_manifest_and_sync() { 147 regen_manifest_and_sync() {
148 find_repo_dir 148 find_repo_dir
149 local_manifest="${REPODIR}/local_manifest.xml" 149 local_manifest="${REPODIR}/local_manifest.xml"
150 150
151 # ensure we don't clobber existing manifest entries 151 # ensure we don't clobber existing manifest entries
152 if [ -f "${local_manifest}" ]; then 152 if [ -f "${local_manifest}" ]; then
153 grep -q -i "<remote" "${local_manifest}" 153 grep -q -i "<remote" "${local_manifest}"
154 if [ $? -ne 1 ]; then 154 if [ $? -ne 1 ]; then
155 » die "Your local manifest will be clobbered running cros_workon. You ca n not have any <remote> tags at all." 155 die "Your local manifest will be clobbered running cros_workon. You can no t have any <remote> tags at all."
156 fi 156 fi
157 sed -ne '/^[[:space:]]\+[^[:space:]]/q1' "${local_manifest}" 157 sed -ne '/^[[:space:]]\+[^[:space:]]/q1' "${local_manifest}"
158 if [ $? -ne 0 ]; then 158 if [ $? -ne 0 ]; then
159 » die "Your local manifest will be clobbered running cros_workon. You ca n not have any tags that span multiple lines or are indented." 159 die "Your local manifest will be clobbered running cros_workon. You can no t have any tags that span multiple lines or are indented."
160 fi 160 fi
161 egrep -q "^[^<]" "${local_manifest}" 161 egrep -q "^[^<]" "${local_manifest}"
162 if [ $? -ne 1 ]; then 162 if [ $? -ne 1 ]; then
163 » die "Your local manifest will be clobbered running cros_workon. You ca n not have any tags that span multiple lines" 163 die "Your local manifest will be clobbered running cros_workon. You can no t have any tags that span multiple lines"
164 fi 164 fi
165 grep -v "<project" "${local_manifest}" | grep -q -i "<project" 165 grep -v "<project" "${local_manifest}" | grep -q -i "<project"
166 if [ $? -eq 0 ]; then 166 if [ $? -eq 0 ]; then
167 » die "Your local manifest has mixed case tags for project. You can not have mixed case tags" 167 die "Your local manifest has mixed case tags for project. You can not hav e mixed case tags"
168 fi 168 fi
169 fi 169 fi
170 # preserve old manifest entries 170 # preserve old manifest entries
171 [ -f "${local_manifest}" ] && \ 171 [ -f "${local_manifest}" ] && \
172 MANIFEST_ENTRIES_OLD=$(cat "${local_manifest}" | grep "^<project") 172 MANIFEST_ENTRIES_OLD=$(cat "${local_manifest}" | grep "^<project")
173 173
174 rm -f "${local_manifest}" 174 rm -f "${local_manifest}"
175 175
176 # get new manifest entries 176 # get new manifest entries
177 MANIFEST_ENTRIES=$(show_live_ebuilds | 177 MANIFEST_ENTRIES=$(show_live_ebuilds |
178 { 178 {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 esac 257 esac
258 fi 258 fi
259 259
260 case ${WORKON_CMD} in 260 case ${WORKON_CMD} in
261 start) ebuild_to_live "${ATOM_LIST}"; regen_manifest_and_sync ;; 261 start) ebuild_to_live "${ATOM_LIST}"; regen_manifest_and_sync ;;
262 stop) ebuild_to_stable "${ATOM_LIST}" ;; 262 stop) ebuild_to_stable "${ATOM_LIST}" ;;
263 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko n_ebuilds ;; 263 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko n_ebuilds ;;
264 iterate)ebuild_iterate "${ATOM_LIST}" ;; 264 iterate)ebuild_iterate "${ATOM_LIST}" ;;
265 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;; 265 *) die "$(basename $0): command '${WORKON_CMD}' not recognized" ;;
266 esac 266 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