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

Side by Side Diff: cros_mark_all_as_stable

Issue 3032021: Need $ on same line to not eval hash as command in bash (Closed) Base URL: ssh://git@chromiumos-git//crosutils.git
Patch Set: Fix space Created 10 years, 5 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 # Wrapper scripts around cros_mark_as_stable that marks all packages as stable 7 # Wrapper scripts around cros_mark_as_stable that marks all packages as stable
8 # that have CROS_WORKON_COMMIT that is different than the current HEAD commit 8 # that have CROS_WORKON_COMMIT that is different than the current HEAD commit
9 # of the corresponding git repository. 9 # of the corresponding git repository.
10 10
(...skipping 29 matching lines...) Expand all
40 40
41 # For each package, compares the head commit id to the commit id in the ebuild. 41 # For each package, compares the head commit id to the commit id in the ebuild.
42 # If they do not match, add the package and its commit id into ${PACKAGE_LIST} 42 # If they do not match, add the package and its commit id into ${PACKAGE_LIST}
43 # and ${COMMIT_ID_LIST} 43 # and ${COMMIT_ID_LIST}
44 for package in ${PACKAGES}; do 44 for package in ${PACKAGES}; do
45 ebuild_path=$(${EQUERYCMD} which ${package}) || continue 45 ebuild_path=$(${EQUERYCMD} which ${package}) || continue
46 # Sets ${CROS_WORKON_SRCDIR} from the ebuild. 46 # Sets ${CROS_WORKON_SRCDIR} from the ebuild.
47 eval $(${EBUILDCMD} ${ebuild_path} info) &> /dev/null || continue 47 eval $(${EBUILDCMD} ${ebuild_path} info) &> /dev/null || continue
48 head_commit=$( cd "${CROS_WORKON_SRCDIR}" &&\ 48 head_commit=$( cd "${CROS_WORKON_SRCDIR}" &&\
49 bash -c "${GRAB_HEAD_COMMIT_CMD}" ) || continue 49 bash -c "${GRAB_HEAD_COMMIT_CMD}" ) || continue
50 egit_commit=\ 50 egit_commit=$(\
51 $(eval echo $(grep CROS_WORKON_COMMIT ${ebuild_path} | cut -f 2 -d '=')) ||\ 51 eval echo $(grep CROS_WORKON_COMMIT ${ebuild_path} | cut -f 2 -d '=')) ||\
Christopher Covington 2010/07/26 16:36:24 Too late now, but just a thought for the record. T
52 echo "No CROS_WORKON_COMMIT found in ${ebuild_path}" 52 echo "No CROS_WORKON_COMMIT found in ${ebuild_path}"
53 if [[ ${head_commit} != ${egit_commit} ]] && \ 53 if [[ ${head_commit} != ${egit_commit} ]] && \
54 [ -n "${head_commit}" ]; then 54 [ -n "${head_commit}" ]; then
55 info\ 55 info\
56 "HEAD ${head_commit} != CROS_WORKON_COMMIT ${egit_commit} for ${package}" 56 "HEAD ${head_commit} != CROS_WORKON_COMMIT ${egit_commit} for ${package}"
57 PACKAGE_LIST="${PACKAGE_LIST} ${package}" 57 PACKAGE_LIST="${PACKAGE_LIST} ${package}"
58 COMMIT_ID_LIST="${COMMIT_ID_LIST} ${head_commit}" 58 COMMIT_ID_LIST="${COMMIT_ID_LIST} ${head_commit}"
59 elif [[ ${head_commit} = ${egit_commit} ]]; then
60 info "Commit id's match for ${package}"
59 fi 61 fi
60 done 62 done
61 63
62 info "Candidate package list ${PACKAGE_LIST}" 64 info "Candidate package list ${PACKAGE_LIST}"
63 info "With commit id list ${COMMIT_ID_LIST}" 65 info "With commit id list ${COMMIT_ID_LIST}"
64 66
65 ./cros_mark_as_stable --board ${FLAGS_board} -p "${PACKAGE_LIST}" \ 67 ./cros_mark_as_stable --board ${FLAGS_board} -p "${PACKAGE_LIST}" \
66 -i "${COMMIT_ID_LIST}" commit || \ 68 -i "${COMMIT_ID_LIST}" commit || \
67 die "Could not mark all packages as stable" 69 die "Could not mark all packages as stable"
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