summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
Diffstat (limited to 'tool')
-rwxr-xr-xtool/fetch-bundled_gems.rb14
-rwxr-xr-xtool/sync_default_gems.rb8
2 files changed, 13 insertions, 9 deletions
diff --git a/tool/fetch-bundled_gems.rb b/tool/fetch-bundled_gems.rb
index f50bda360a..b76feefd94 100755
--- a/tool/fetch-bundled_gems.rb
+++ b/tool/fetch-bundled_gems.rb
@@ -24,20 +24,22 @@ next unless n
next if n =~ /^#/
next if bundled_gems&.all? {|pat| !File.fnmatch?(pat, n)}
-if File.directory?(n)
- puts "updating #{color.notice(n)} ..."
- system("git", "fetch", "--all", chdir: n) or abort
-else
+unless File.exist?("#{n}/.git")
puts "retrieving #{color.notice(n)} ..."
- system(*%W"git clone #{u} #{n}") or abort
+ system(*%W"git clone --depth=1 --no-tags #{u} #{n}") or abort
end
if r
puts "fetching #{color.notice(r)} ..."
system("git", "fetch", "origin", r, chdir: n) or abort
+ c = r
+else
+ c = ["v#{v}", v].find do |c|
+ puts "fetching #{color.notice(c)} ..."
+ system("git", "fetch", "origin", "refs/tags/#{c}:refs/tags/#{c}", chdir: n)
+ end or abort
end
-c = r || "v#{v}"
checkout = %w"git -c advice.detachedHead=false checkout"
print %[checking out #{color.notice(c)} (v=#{color.info(v)}]
print %[, r=#{color.info(r)}] if r
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 932f37b77c..ca0b15dd19 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -136,9 +136,11 @@ module SyncDefaultGems
cp_r("#{upstream}/bundler/spec", "spec/bundler")
rm_rf("spec/bundler/bin")
- parallel_tests_content = File.read("#{upstream}/bundler/bin/parallel_rspec").gsub("../spec", "../bundler")
- File.write("spec/bin/parallel_rspec", parallel_tests_content)
- chmod("+x", "spec/bin/parallel_rspec")
+ ["parallel_rspec", "rspec"].each do |binstub|
+ content = File.read("#{upstream}/bundler/bin/#{binstub}").gsub("../spec", "../bundler")
+ File.write("spec/bin/#{binstub}", content)
+ chmod("+x", "spec/bin/#{binstub}")
+ end
%w[dev_gems test_gems rubocop_gems standard_gems].each do |gemfile|
["rb.lock", "rb"].each do |ext|