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%?} |
} |