OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright 2013 the V8 project authors. All rights reserved. | 2 # Copyright 2013 the V8 project authors. All rights reserved. |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
(...skipping 12 matching lines...) Expand all Loading... |
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 |
29 | 29 |
30 ########## Global variable definitions | 30 ########## Global variable definitions |
31 | 31 |
32 BASE_URL="https://code.google.com/p/v8/source/list" | 32 BASE_URL="https://code.google.com/p/v8/source/list" |
33 VERSION="src/version.cc" | |
34 MAJOR="MAJOR_VERSION" | |
35 MINOR="MINOR_VERSION" | |
36 BUILD="BUILD_NUMBER" | |
37 PATCH="PATCH_LEVEL" | |
38 | 33 |
39 V8="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | 34 V8="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" |
40 | 35 |
41 ########## Function definitions | 36 ########## Function definitions |
42 | 37 |
43 cd $V8 | 38 cd $V8 |
44 | 39 |
45 usage() { | 40 usage() { |
46 cat << EOF | 41 cat << EOF |
47 usage: $0 OPTIONS | 42 usage: $0 OPTIONS |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 echo $rev $svn $id | 99 echo $rev $svn $id |
105 done | 100 done |
106 } | 101 } |
107 | 102 |
108 svn_rev() { | 103 svn_rev() { |
109 git svn find-rev $2 svn/$1 | 104 git svn find-rev $2 svn/$1 |
110 } | 105 } |
111 | 106 |
112 v8_rev() { | 107 v8_rev() { |
113 cd $(git rev-parse --show-toplevel) | 108 cd $(git rev-parse --show-toplevel) |
114 rev=$(git show $1:$VERSION \ | 109 # Newer revisions have version defines in include/v8.h. |
| 110 rev=$(git show $1:include/v8.h \ |
115 | grep "#define" \ | 111 | grep "#define" \ |
116 | grep "$MAJOR\|$MINOR\|$BUILD\|$PATCH" \ | 112 | grep "V8_\(MAJOR_VERSION\|MINOR_VERSION\|BUILD_NUMBER\|PATCH_LEVEL\)" \ |
117 | grep -o "[0-9]\+$" \ | 113 | grep -o "[0-9]\+$" \ |
118 | tr "\\n" ".") | 114 | tr "\\n" ".") |
| 115 if [[ -z ${rev%?} ]]; then |
| 116 # Compatibility with revisions that have version defines in src/version.cc. |
| 117 rev=$(git show $1:src/version.cc \ |
| 118 | grep "#define" \ |
| 119 | grep "\(MAJOR_VERSION\|MINOR_VERSION\|BUILD_NUMBER\|PATCH_LEVEL\)" \ |
| 120 | grep -o "[0-9]\+$" \ |
| 121 | tr "\\n" ".") |
| 122 fi |
119 echo ${rev%?} | 123 echo ${rev%?} |
120 } | 124 } |
121 | 125 |
122 merges_to_branch() { | 126 merges_to_branch() { |
123 git cherry -v svn/trunk svn/$1 | while read merge; do | 127 git cherry -v svn/trunk svn/$1 | while read merge; do |
124 h=$(echo $merge | cut -d" " -f2) | 128 h=$(echo $merge | cut -d" " -f2) |
125 svn=$(svn_rev $1 $h) | 129 svn=$(svn_rev $1 $h) |
126 merges=$(echo $merge | grep -o "r[0-9]\+") | 130 merges=$(echo $merge | grep -o "r[0-9]\+") |
127 rev=$(v8_rev $h) | 131 rev=$(v8_rev $h) |
128 echo $rev r$svn $merges | 132 echo $rev r$svn $merges |
(...skipping 23 matching lines...) Expand all Loading... |
152 p) echo $(point_merges "$(tag_log $(v8_hash $OPTARG)^1)") | 156 p) echo $(point_merges "$(tag_log $(v8_hash $OPTARG)^1)") |
153 ;; | 157 ;; |
154 u) url_for $OPTARG | 158 u) url_for $OPTARG |
155 ;; | 159 ;; |
156 ?) echo "Illegal option: -$OPTARG" | 160 ?) echo "Illegal option: -$OPTARG" |
157 usage | 161 usage |
158 exit 1 | 162 exit 1 |
159 ;; | 163 ;; |
160 esac | 164 esac |
161 done | 165 done |
OLD | NEW |