diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-02-21 20:30:08 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-02-22 02:07:59 +0900 |
commit | 289080e4d86c70f8231a74a78892b2db65a86e9a (patch) | |
tree | e46529c82bb4778930a156b23477a578e7cc1d4c /tool | |
parent | 241c4cfdd47c3f5df0738bb636d3f3954101de49 (diff) | |
download | ruby-289080e4d86c70f8231a74a78892b2db65a86e9a.tar.gz |
Clone and create dummy gemspec in sequential build
Diffstat (limited to 'tool')
-rw-r--r-- | tool/lib/bundled_gem.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tool/lib/bundled_gem.rb b/tool/lib/bundled_gem.rb index a08124b679..81549acbdf 100644 --- a/tool/lib/bundled_gem.rb +++ b/tool/lib/bundled_gem.rb @@ -83,4 +83,15 @@ module BundledGem File.write(gemfile, spec.to_ruby) end end + + def checkout(gemdir, repo, rev, git: $git) + return unless rev + unless File.exist?("#{gemdir}/.git") + puts "Cloning #{repo}" + system("#{git} clone #{repo} #{gemdir}") or raise + end + puts "Update #{File.basename(gemdir)} to #{rev}" + system("#{git} fetch origin #{rev}", chdir: gemdir) + system("#{git} checkout --detach #{rev}", chdir: gemdir) + end end |