[前][次][番号順一覧][スレッド一覧]

ruby-changes:63307

From: Soutaro <ko1@a...>
Date: Fri, 9 Oct 2020 18:41:43 +0900 (JST)
Subject: [ruby-changes:63307] 02e17d473a (master): Let bundled_gems specify commits to test (#3641)

https://git.ruby-lang.org/ruby.git/commit/?id=02e17d473a

From 02e17d473a5edef69b8c03a8e2b91fdd0c27ed75 Mon Sep 17 00:00:00 2001
From: Soutaro Matsumoto <matsumoto@s...>
Date: Fri, 9 Oct 2020 18:41:20 +0900
Subject: Let bundled_gems specify commits to test (#3641)


diff --git a/gems/bundled_gems b/gems/bundled_gems
index 13309a4..25335ea 100644
--- a/gems/bundled_gems
+++ b/gems/bundled_gems
@@ -1,7 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/gems/bundled_gems#L1
+# gem-name version-to-bundle repository-url [optional-commit-hash-to-test-or-defaults-to-v-version]
 minitest 5.14.2 https://github.com/seattlerb/minitest
 power_assert 1.2.0 https://github.com/ruby/power_assert
 rake 13.0.1 https://github.com/ruby/rake
-test-unit 3.3.6 https://github.com/test-unit/test-unit
+test-unit 3.3.6 https://github.com/test-unit/test-unit 3.3.6
 rexml 3.2.4 https://github.com/ruby/rexml
-rss 0.2.9 https://github.com/ruby/rss
+rss 0.2.9 https://github.com/ruby/rss 0.2.9
 rbs 0.12.2 https://github.com/ruby/rbs
diff --git a/tool/fetch-bundled_gems.rb b/tool/fetch-bundled_gems.rb
index 4ba1848..ebb70e8 100755
--- a/tool/fetch-bundled_gems.rb
+++ b/tool/fetch-bundled_gems.rb
@@ -8,18 +8,20 @@ BEGIN { https://github.com/ruby/ruby/blob/trunk/tool/fetch-bundled_gems.rb#L8
   Dir.chdir(dir)
 }
 
-n, v, u = $F
+n, v, u, r = $F
+
+next if n =~ /^#/
 
 if File.directory?(n)
   puts "updating #{n} ..."
-  system("git", (v == "master" ? "pull" : "fetch"), chdir: n) or abort
+  system("git", "fetch", chdir: n) or abort
 else
   puts "retrieving #{n} ..."
   system(*%W"git clone #{u} #{n}") or abort
 end
+c = r || "v#{v}"
 checkout = %w"git -c advice.detachedHead=false checkout"
-unless system(*checkout, v.sub(/\A(?=\d)/, 'v'), chdir: n)
-  unless /\A\d/ =~ v and system(*checkout, v, chdir: n)
-    abort
-  end
+puts "checking out #{c} (v=#{v}, r=#{r}) ..."
+unless system(*checkout, c, "--", chdir: n)
+  abort
 end
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]