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 # 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 # For each package, compares the head commit id to the commit id in the ebuild. | 56 # For each package, compares the head commit id to the commit id in the ebuild. |
57 # If they do not match, add the package and its commit id into ${PACKAGE_LIST} | 57 # If they do not match, add the package and its commit id into ${PACKAGE_LIST} |
58 # and ${COMMIT_ID_LIST} | 58 # and ${COMMIT_ID_LIST} |
59 for package in ${PACKAGES}; do | 59 for package in ${PACKAGES}; do |
60 if package_is_blacklisted ${package}; then | 60 if package_is_blacklisted ${package}; then |
61 info "${package} blacklisted, skipping" | 61 info "${package} blacklisted, skipping" |
62 continue | 62 continue |
63 fi | 63 fi |
64 ebuild_path=$(${EQUERYCMD} which ${package}) || continue | 64 ebuild_path=$(${EQUERYCMD} which ${package}) || continue |
| 65 # Get 9999 ebuild path to see if it got changed. |
| 66 ebuild_9999_path=$(ACCEPT_KEYWORDS=~* ${EQUERYCMD} which ${package}) \ |
| 67 || continue |
65 # Sets ${CROS_WORKON_SRCDIR} from the ebuild. | 68 # Sets ${CROS_WORKON_SRCDIR} from the ebuild. |
66 eval $(${EBUILDCMD} ${ebuild_path} info) &> /dev/null || continue | 69 eval $(${EBUILDCMD} ${ebuild_path} info) &> /dev/null || continue |
67 head_commit=$( cd "${CROS_WORKON_SRCDIR}" &&\ | 70 head_commit=$( cd "${CROS_WORKON_SRCDIR}" &&\ |
68 bash -c "${GRAB_HEAD_COMMIT_CMD}" ) || continue | 71 bash -c "${GRAB_HEAD_COMMIT_CMD}" ) || continue |
69 egit_commit=$(\ | 72 egit_commit=$(\ |
70 eval echo $(grep CROS_WORKON_COMMIT ${ebuild_path} | cut -f 2 -d '=')) ||\ | 73 eval echo $(grep CROS_WORKON_COMMIT ${ebuild_path} | cut -f 2 -d '=')) ||\ |
71 echo "No CROS_WORKON_COMMIT found in ${ebuild_path}" | 74 echo "No CROS_WORKON_COMMIT found in ${ebuild_path}" |
72 if [[ ${head_commit} != ${egit_commit} ]] && \ | 75 if [[ ${head_commit} != ${egit_commit} ]] && \ |
73 [ -n "${head_commit}" ]; then | 76 [ -n "${head_commit}" ]; then |
74 info\ | 77 info\ |
75 "HEAD ${head_commit} != CROS_WORKON_COMMIT ${egit_commit} for ${package}" | 78 "HEAD ${head_commit} != CROS_WORKON_COMMIT ${egit_commit} for ${package}" |
76 PACKAGE_LIST="${PACKAGE_LIST} ${package}" | 79 PACKAGE_LIST="${PACKAGE_LIST} ${package}" |
77 COMMIT_ID_LIST="${COMMIT_ID_LIST} ${head_commit}" | 80 COMMIT_ID_LIST="${COMMIT_ID_LIST} ${head_commit}" |
78 elif [[ ${head_commit} = ${egit_commit} ]]; then | 81 elif [[ ${head_commit} = ${egit_commit} ]]; then |
79 info "Commit id's match for ${package}" | 82 info "Commit id's match for ${package}, checking for 9999 ebuild change." |
| 83 # egrep succeeds if there are important differences between the ebuilds. |
| 84 if diff "${ebuild_path}" "${ebuild_9999_path}" | \ |
| 85 egrep -v "KEYWORDS|CROS_WORKON_COMMIT|^---|^[<>]\ *$|^[0-9]"; then |
| 86 info "Detected 9999 ebuild change for ${package}." |
| 87 PACKAGE_LIST="${PACKAGE_LIST} ${package}" |
| 88 COMMIT_ID_LIST="${COMMIT_ID_LIST} ${egit_commit}" |
| 89 fi |
80 fi | 90 fi |
81 done | 91 done |
82 | 92 |
83 if [ -n "${PACKAGE_LIST}" ] ; then | 93 if [ -n "${PACKAGE_LIST}" ] ; then |
84 info "Candidate package list ${PACKAGE_LIST}" | 94 info "Candidate package list ${PACKAGE_LIST}" |
85 info "With commit id list ${COMMIT_ID_LIST}" | 95 info "With commit id list ${COMMIT_ID_LIST}" |
86 | 96 |
87 ./cros_mark_as_stable --board ${FLAGS_board} -p "${PACKAGE_LIST}" \ | 97 ./cros_mark_as_stable --board ${FLAGS_board} -p "${PACKAGE_LIST}" \ |
88 -i "${COMMIT_ID_LIST}" -t ${FLAGS_tracking_branch} commit || \ | 98 -i "${COMMIT_ID_LIST}" -t ${FLAGS_tracking_branch} commit || \ |
89 die "Could not mark all packages as stable" | 99 die "Could not mark all packages as stable" |
90 else | 100 else |
91 info "No candidate packages to be marked" | 101 info "No candidate packages to be marked" |
92 fi | 102 fi |
OLD | NEW |