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

Side by Side Diff: tools/common-includes.sh

Issue 23723003: Move version macros to public V8 header. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « src/version.cc ('k') | tools/merge-to-branch.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 15 matching lines...) Expand all
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 # This file contains common function definitions for various other shell 28 # This file contains common function definitions for various other shell
29 # scripts in this directory. It is not meant to be executed by itself. 29 # scripts in this directory. It is not meant to be executed by itself.
30 30
31 # Important: before including this file, the following variables must be set: 31 # Important: before including this file, the following variables must be set:
32 # - BRANCHNAME 32 # - BRANCHNAME
33 # - PERSISTFILE_BASENAME 33 # - PERSISTFILE_BASENAME
34 34
35 TEMP_BRANCH=$BRANCHNAME-temporary-branch-created-by-script 35 TEMP_BRANCH=$BRANCHNAME-temporary-branch-created-by-script
36 VERSION_FILE="src/version.cc" 36 VERSION_FILE="include/v8.h"
37 CHANGELOG_ENTRY_FILE="$PERSISTFILE_BASENAME-changelog-entry" 37 CHANGELOG_ENTRY_FILE="$PERSISTFILE_BASENAME-changelog-entry"
38 PATCH_FILE="$PERSISTFILE_BASENAME-patch" 38 PATCH_FILE="$PERSISTFILE_BASENAME-patch"
39 COMMITMSG_FILE="$PERSISTFILE_BASENAME-commitmsg" 39 COMMITMSG_FILE="$PERSISTFILE_BASENAME-commitmsg"
40 TRUNK_REVISION_FILE="$PERSISTFILE_BASENAME-trunkrevision" 40 TRUNK_REVISION_FILE="$PERSISTFILE_BASENAME-trunkrevision"
41 START_STEP=0 41 START_STEP=0
42 CURRENT_STEP=0 42 CURRENT_STEP=0
43 43
44 die() { 44 die() {
45 [[ -n "$1" ]] && echo "Error: $1" 45 [[ -n "$1" ]] && echo "Error: $1"
46 echo "Exiting." 46 echo "Exiting."
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 [[ "$TEMP_BRANCH" != "$CURRENT_BRANCH" ]] && git branch -D $TEMP_BRANCH 136 [[ "$TEMP_BRANCH" != "$CURRENT_BRANCH" ]] && git branch -D $TEMP_BRANCH
137 [[ "$BRANCHNAME" != "$CURRENT_BRANCH" ]] && git branch -D $BRANCHNAME 137 [[ "$BRANCHNAME" != "$CURRENT_BRANCH" ]] && git branch -D $BRANCHNAME
138 # Clean up all temporary files. 138 # Clean up all temporary files.
139 rm -f "$PERSISTFILE_BASENAME"* 139 rm -f "$PERSISTFILE_BASENAME"*
140 } 140 }
141 141
142 # These two functions take a prefix for the variable names as first argument. 142 # These two functions take a prefix for the variable names as first argument.
143 read_and_persist_version() { 143 read_and_persist_version() {
144 for v in MAJOR_VERSION MINOR_VERSION BUILD_NUMBER PATCH_LEVEL; do 144 for v in MAJOR_VERSION MINOR_VERSION BUILD_NUMBER PATCH_LEVEL; do
145 VARNAME="$1${v%%_*}" 145 VARNAME="$1${v%%_*}"
146 VALUE=$(grep "#define $v" "$VERSION_FILE" | awk '{print $NF}') 146 VALUE=$(grep "#define V8_$v" "$VERSION_FILE" | awk '{print $NF}')
147 eval "$VARNAME=\"$VALUE\"" 147 eval "$VARNAME=\"$VALUE\""
148 persist "$VARNAME" 148 persist "$VARNAME"
149 done 149 done
150 } 150 }
151 restore_version_if_unset() { 151 restore_version_if_unset() {
152 for v in MAJOR MINOR BUILD PATCH; do 152 for v in MAJOR MINOR BUILD PATCH; do
153 restore_if_unset "$1$v" 153 restore_if_unset "$1$v"
154 done 154 done
155 } 155 }
156 156
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 echo -n "> " 189 echo -n "> "
190 read ANSWER 190 read ANSWER
191 done 191 done
192 } 192 }
193 193
194 # Takes a file containing the patch to apply as first argument. 194 # Takes a file containing the patch to apply as first argument.
195 apply_patch() { 195 apply_patch() {
196 git apply --index --reject $REVERSE_PATCH "$1" || \ 196 git apply --index --reject $REVERSE_PATCH "$1" || \
197 wait_for_resolving_conflicts "$1"; 197 wait_for_resolving_conflicts "$1";
198 } 198 }
OLDNEW
« no previous file with comments | « src/version.cc ('k') | tools/merge-to-branch.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698