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

Side by Side Diff: cros_workon

Issue 3129008: cros_workon: check for existence of local manifest before cat (Closed) Base URL: ssh://gitrw.chromium.org/crosutils
Patch Set: Created 10 years, 4 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
« 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 exit 1 125 exit 1
126 } 126 }
127 127
128 128
129 # 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. 129 # 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.
130 regen_manifest_and_sync() { 130 regen_manifest_and_sync() {
131 find_repo_dir 131 find_repo_dir
132 local_manifest="${REPODIR}/local_manifest.xml" 132 local_manifest="${REPODIR}/local_manifest.xml"
133 133
134 # preserve old manifest entries 134 # preserve old manifest entries
135 MANIFEST_ENTRIES_OLD=$(cat "${local_manifest}" | grep "^<project") 135 [ -f "${local_manifest}" ] && \
136 MANIFEST_ENTRIES_OLD=$(cat "${local_manifest}" | grep "^<project")
136 137
137 rm -f "${local_manifest}" 138 rm -f "${local_manifest}"
138 139
139 # get new manifest entries 140 # get new manifest entries
140 MANIFEST_ENTRIES=$(cat ${KEYWORDS_FILE} | 141 MANIFEST_ENTRIES=$(cat ${KEYWORDS_FILE} |
141 { 142 {
142 while read line 143 while read line
143 do 144 do
144 pkgname=`basename ${line}` 145 pkgname=`basename ${line}`
145 eval $(${EBUILDCMD} $(${EQUERYCMD} which ${pkgname}) info) 146 eval $(${EBUILDCMD} $(${EQUERYCMD} which ${pkgname}) info)
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 esac 227 esac
227 fi 228 fi
228 229
229 case ${WORKON_CMD} in 230 case ${WORKON_CMD} in
230 start) ebuild_to_live "${ATOM_LIST}"; regen_manifest_and_sync ;; 231 start) ebuild_to_live "${ATOM_LIST}"; regen_manifest_and_sync ;;
231 stop) ebuild_to_stable "${ATOM_LIST}" ;; 232 stop) ebuild_to_stable "${ATOM_LIST}" ;;
232 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko n_ebuilds ;; 233 list) [ ${FLAGS_all} = "${FLAGS_FALSE}" ] && show_live_ebuilds || show_worko n_ebuilds ;;
233 iterate)ebuild_iterate "${ATOM_LIST}" ;; 234 iterate)ebuild_iterate "${ATOM_LIST}" ;;
234 *) die "invalid cros_workon command" ;; 235 *) die "invalid cros_workon command" ;;
235 esac 236 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