-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
google build tool gclient doesn't support svn anymore. Updating v8 build script to use git instead. PR-URL: #9393 Reviewed By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
- Loading branch information
1 parent
3daf116
commit 45df0ee
Showing
2 changed files
with
30 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,47 @@ | ||
#!/bin/bash | ||
|
||
|
||
git_origin=$(git config --get remote.origin.url | sed 's/.\+[\/:]\([^\/]\+\/[^\/]\+\)$/\1/') | ||
git_branch=$(git rev-parse --abbrev-ref HEAD) | ||
v8ver=${1:-v8} #default v8 | ||
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}]" | ||
# Get V8 branch from v8/include/v8-version.h | ||
MAJOR=$(grep V8_MAJOR_VERSION deps/v8/include/v8-version.h | cut -d ' ' -f 3) | ||
MINOR=$(grep V8_MINOR_VERSION deps/v8/include/v8-version.h | cut -d ' ' -f 3) | ||
BRANCH=$MAJOR.$MINOR | ||
|
||
# clean up if someone presses ctrl-c | ||
trap cleanup INT | ||
|
||
function cleanup() { | ||
trap - INT | ||
|
||
rm .gclient || true | ||
rm .gclient_entries || true | ||
rm -rf _bad_scm/ || true | ||
|
||
#if v8ver isn't v8, move the v8 folders | ||
#back to what they were | ||
if [ "$v8ver" != "v8" ]; then | ||
mv v8 $v8ver | ||
mv .v8old v8 | ||
fi | ||
find v8 -name ".git" | xargs rm -rf || true | ||
echo "git cleanup" | ||
git reset --hard HEAD | ||
git clean -fdq | ||
# unstash local changes | ||
git stash pop | ||
exit 0 | ||
} | ||
|
||
cd deps | ||
echo $gclient_string > .gclient | ||
if [ "$v8ver" != "v8" ]; then | ||
mv v8 .v8old | ||
mv $v8ver v8 | ||
# stash local changes | ||
git stash | ||
rm -rf v8 | ||
|
||
echo "Fetching V8 from chromium.googlesource.com" | ||
fetch v8 | ||
if [ "$?" -ne 0 ]; then | ||
echo "V8 fetch failed" | ||
exit 1 | ||
fi | ||
echo "V8 fetched" | ||
|
||
cd v8 | ||
|
||
echo "Checking out branch:$BRANCH" | ||
git checkout remotes/branch-heads/$BRANCH | ||
|
||
echo "Sync dependencies" | ||
gclient sync | ||
|
||
cd .. | ||
cleanup |