From fd71a05905f3019ebf4638100b8482855728d627 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Thu, 9 Apr 2015 17:08:25 -0500 Subject: [PATCH] fix checkout and clean tasks * for some reason, the git clean task inside the gyp directory was returning an exit status of `1'` even though it was cleaning out files. Just ignore the exit status * chomp the output of the `git-svn` invocation. At least on OSX, it was throwing a specious warning about "-f" not being a valid command, and if the force checkout was actually necessary, it was failing --- Rakefile | 6 +++++- ext/libv8/checkout.rb | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index c4935bc6..0f870aee 100644 --- a/Rakefile +++ b/Rakefile @@ -74,7 +74,11 @@ task :clean do sh "rm -rf pkg" sh "git clean -df" sh "cd #{V8_Source} && git checkout -f && git clean -dxf" - sh "cd #{GYP_Source} && git checkout -f && git clean -dxf" + if Dir.chdir GYP_Source + sh "git checkout -f" + puts "git clean -dxf" + `git clean -dxf` + end end task :devkit do diff --git a/ext/libv8/checkout.rb b/ext/libv8/checkout.rb index 4ddd340a..b7102a39 100644 --- a/ext/libv8/checkout.rb +++ b/ext/libv8/checkout.rb @@ -31,7 +31,7 @@ def checkout! # --git-dir is needed for older versions of git and git-svn `git --git-dir=../../.git/modules/vendor/gyp/ svn init #{GYP_SVN} -Ttrunk` `git config --replace-all svn-remote.svn.fetch trunk:refs/remotes/origin/master` - svn_rev = `git --git-dir=../../.git/modules/vendor/gyp/ svn find-rev r#{rev} | tail -n 1` + svn_rev = `git --git-dir=../../.git/modules/vendor/gyp/ svn find-rev r#{rev} | tail -n 1`.chomp `git checkout #{svn_rev} -f` end end @@ -43,7 +43,7 @@ def git?(dir) def check_git_svn! # msysgit provides git svn return if RUBY_PLATFORM =~ /mingw/ - + unless system 'git help svn 2>&1 > /dev/null' fail "git-svn not installed!\nPlease install git-svn." end