mirror of https://github.com/lukechilds/node.git
Browse Source
google build tool gclient doesn't support svn anymore. Updating v8 build script to use git instead. PR-URL: https://github.com/nodejs/node/pull/9393 Reviewed By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>v6
Jaideep Bajwa
8 years ago
committed by
Michael Dawson
2 changed files with 30 additions and 21 deletions
@ -1,38 +1,47 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
|
|
||||
|
# Get V8 branch from v8/include/v8-version.h |
||||
git_origin=$(git config --get remote.origin.url | sed 's/.\+[\/:]\([^\/]\+\/[^\/]\+\)$/\1/') |
MAJOR=$(grep V8_MAJOR_VERSION deps/v8/include/v8-version.h | cut -d ' ' -f 3) |
||||
git_branch=$(git rev-parse --abbrev-ref HEAD) |
MINOR=$(grep V8_MINOR_VERSION deps/v8/include/v8-version.h | cut -d ' ' -f 3) |
||||
v8ver=${1:-v8} #default v8 |
BRANCH=$MAJOR.$MINOR |
||||
svn_prefix=https://github.com |
|
||||
svn_path="$svn_prefix/$git_origin/branches/$git_branch/deps/$v8ver" |
|
||||
#svn_path="$git_origin/branches/$git_branch/deps/$v8ver" |
|
||||
gclient_string="solutions = [{'name': 'v8', 'url': '$svn_path', 'managed': False}]" |
|
||||
|
|
||||
# clean up if someone presses ctrl-c |
# clean up if someone presses ctrl-c |
||||
trap cleanup INT |
trap cleanup INT |
||||
|
|
||||
function cleanup() { |
function cleanup() { |
||||
trap - INT |
trap - INT |
||||
|
|
||||
rm .gclient || true |
rm .gclient || true |
||||
rm .gclient_entries || true |
rm .gclient_entries || true |
||||
rm -rf _bad_scm/ || true |
rm -rf _bad_scm/ || true |
||||
|
find v8 -name ".git" | xargs rm -rf || true |
||||
#if v8ver isn't v8, move the v8 folders |
echo "git cleanup" |
||||
#back to what they were |
git reset --hard HEAD |
||||
if [ "$v8ver" != "v8" ]; then |
git clean -fdq |
||||
mv v8 $v8ver |
# unstash local changes |
||||
mv .v8old v8 |
git stash pop |
||||
fi |
|
||||
exit 0 |
exit 0 |
||||
} |
} |
||||
|
|
||||
cd deps |
cd deps |
||||
echo $gclient_string > .gclient |
# stash local changes |
||||
if [ "$v8ver" != "v8" ]; then |
git stash |
||||
mv v8 .v8old |
rm -rf v8 |
||||
mv $v8ver v8 |
|
||||
|
echo "Fetching V8 from chromium.googlesource.com" |
||||
|
fetch v8 |
||||
|
if [ "$?" -ne 0 ]; then |
||||
|
echo "V8 fetch failed" |
||||
|
exit 1 |
||||
fi |
fi |
||||
|
echo "V8 fetched" |
||||
|
|
||||
|
cd v8 |
||||
|
|
||||
|
echo "Checking out branch:$BRANCH" |
||||
|
git checkout remotes/branch-heads/$BRANCH |
||||
|
|
||||
|
echo "Sync dependencies" |
||||
gclient sync |
gclient sync |
||||
|
|
||||
|
cd .. |
||||
cleanup |
cleanup |
||||
|
Loading…
Reference in new issue