diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-07-05 10:31:15 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-07-05 10:31:15 +0900 |
| commit | 573c9913a1ac2760f5f5e5e91c0841465ff5b2ac (patch) | |
| tree | 41522da86dacbf4252e56e2ace72503c64860e4d /tasks | |
| parent | 8c838b0700ad99cd329832abca5789f3f43e8b3f (diff) | |
| parent | 3b225972747be555f2bc2d42cdddbc1bcf3e4b7b (diff) | |
| download | mruby-573c9913a1ac2760f5f5e5e91c0841465ff5b2ac.tar.gz mruby-573c9913a1ac2760f5f5e5e91c0841465ff5b2ac.zip | |
resolve AUTHORS conflict
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/mruby_build_commands.rake | 11 | ||||
| -rw-r--r-- | tasks/mruby_build_gem.rake | 18 |
2 files changed, 22 insertions, 7 deletions
diff --git a/tasks/mruby_build_commands.rake b/tasks/mruby_build_commands.rake index 1d69fa54d..b678b1f0e 100644 --- a/tasks/mruby_build_commands.rake +++ b/tasks/mruby_build_commands.rake @@ -220,19 +220,28 @@ module MRuby class Command::Git < Command attr_accessor :flags - attr_accessor :clone_options + attr_accessor :clone_options, :pull_options def initialize(build) super @command = 'git' @flags = [] @clone_options = "clone %{flags} %{url} %{dir}" + @pull_options = "pull" end def run_clone(dir, url, _flags = []) _pp "GIT", url, dir.relative_path _run clone_options, { :flags => [flags, _flags].flatten.join(' '), :url => url, :dir => filename(dir) } end + + def run_pull(dir, url) + root = Dir.pwd + Dir.chdir dir + _pp "GIT PULL", url, dir.relative_path + _run pull_options + Dir.chdir root + end end class Command::Mrbc < Command diff --git a/tasks/mruby_build_gem.rake b/tasks/mruby_build_gem.rake index 870ccfa57..975b032a6 100644 --- a/tasks/mruby_build_gem.rake +++ b/tasks/mruby_build_gem.rake @@ -40,13 +40,19 @@ module MRuby elsif params[:git] url = params[:git] gemdir = "build/mrbgems/#{url.match(/([-\w]+)(\.[-\w]+|)$/).to_a[1]}" - return gemdir if File.exists?(gemdir) - options = [params[:options]] || [] - options << "--branch \"#{params[:branch]}\"" if params[:branch] - - FileUtils.mkdir_p "build/mrbgems" - git.run_clone gemdir, url, options + if File.exists?(gemdir) + if $pull_gems + git.run_pull gemdir, url + else + gemdir + end + else + options = [params[:options]] || [] + options << "--branch \"#{params[:branch]}\"" if params[:branch] + FileUtils.mkdir_p "build/mrbgems" + git.run_clone gemdir, url, options + end else fail "unknown gem option #{params}" end |
