-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v8: update make-v8.sh to use git #9393
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c3deb42
v8: update make-v8.sh to use git
3c54a7e
addressed comments and added a rsync command to copy local
73e7c69
Using git clean quiet option instead of directing stdout to /dev/null
7d8effd
perform git cleanup for all branches
fd9fd66
removed passing branch as an argument instead quering from
0171280
remove unnecessary branch checking
60bcadb
Addressed comments
971ef91
Remove .git directory from fetched copy of v8
8c995f4
Use git stash to preserve local changes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work if the cwd when running the script is the Node.js src root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which should be the case always, since this script is only run by make and the Makefile is in that directory.