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

Unified Diff: tools/v8-info.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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/push-to-trunk.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/v8-info.sh
diff --git a/tools/v8-info.sh b/tools/v8-info.sh
index 1f25d147a571ebe8d4c435f6507441c15437cd3c..b901736ced4f5aedbb3ba2e4d8377da40f84501c 100755
--- a/tools/v8-info.sh
+++ b/tools/v8-info.sh
@@ -30,11 +30,6 @@
########## Global variable definitions
BASE_URL="https://code.google.com/p/v8/source/list"
-VERSION="src/version.cc"
-MAJOR="MAJOR_VERSION"
-MINOR="MINOR_VERSION"
-BUILD="BUILD_NUMBER"
-PATCH="PATCH_LEVEL"
V8="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
@@ -111,11 +106,20 @@ svn_rev() {
v8_rev() {
cd $(git rev-parse --show-toplevel)
- rev=$(git show $1:$VERSION \
+ # Newer revisions have version defines in include/v8.h.
+ rev=$(git show $1:include/v8.h \
| grep "#define" \
- | grep "$MAJOR\|$MINOR\|$BUILD\|$PATCH" \
+ | grep "V8_\(MAJOR_VERSION\|MINOR_VERSION\|BUILD_NUMBER\|PATCH_LEVEL\)" \
| grep -o "[0-9]\+$" \
| tr "\\n" ".")
+ if [[ -z ${rev%?} ]]; then
+ # Compatibility with revisions that have version defines in src/version.cc.
+ rev=$(git show $1:src/version.cc \
+ | grep "#define" \
+ | grep "\(MAJOR_VERSION\|MINOR_VERSION\|BUILD_NUMBER\|PATCH_LEVEL\)" \
+ | grep -o "[0-9]\+$" \
+ | tr "\\n" ".")
+ fi
echo ${rev%?}
}
« no previous file with comments | « tools/push-to-trunk.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698