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

ruby-changes:48318

From: nobu <ko1@a...>
Date: Thu, 26 Oct 2017 08:35:53 +0900 (JST)
Subject: [ruby-changes:48318] nobu:r60431 (trunk): test-bundled-gems-fetch

nobu	2017-10-26 08:35:46 +0900 (Thu, 26 Oct 2017)

  New Revision: 60431

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60431

  Log:
    test-bundled-gems-fetch
    
    * tool/fetch-bundled_gems.rb: get rid of tool/git-refresh which
      requries Bourne shell.

  Modified files:
    trunk/Makefile.in
    trunk/tool/fetch-bundled_gems.rb
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 60430)
+++ Makefile.in	(revision 60431)
@@ -476,8 +476,10 @@ enc/encinit.$(OBJEXT): enc/encinit.c $(S https://github.com/ruby/ruby/blob/trunk/Makefile.in#L476
 
 test-bundled-gems-precheck: $(arch)-fake.rb programs
 
-yes-test-bundled-gems-prepare: test-bundled-gems-precheck
-	$(Q) $(BASERUBY) $(srcdir)/tool/fetch-bundled_gems.rb $(srcdir)
+test-bundled-gems-fetch: $(PREP)
+	$(Q) $(BASERUBY) -C $(srcdir)/gems ../tool/fetch-bundled_gems.rb src bundled_gems
+
+yes-test-bundled-gems-prepare: test-bundled-gems-precheck test-bundled-gems-fetch
 	$(XRUBY) -C "$(srcdir)" bin/gem install --no-ri --no-rdoc \
 		--install-dir .bundle --conservative 'minitest:~> 5' 'test-unit' 'rake' 'hoe' 'yard' 'pry' 'packnga'
 
Index: tool/fetch-bundled_gems.rb
===================================================================
--- tool/fetch-bundled_gems.rb	(revision 60430)
+++ tool/fetch-bundled_gems.rb	(revision 60431)
@@ -1,17 +1,27 @@ https://github.com/ruby/ruby/blob/trunk/tool/fetch-bundled_gems.rb#L1
-require 'fileutils'
+#!ruby -an
+BEGIN {
+  require 'fileutils'
 
-File.readlines("#{ARGV[0]}/gems/bundled_gems").each do |gem|
-  n, v, u = gem.split
+  dir = ARGV.shift
+  ARGF.eof?
+  FileUtils.mkdir_p(dir)
+  Dir.chdir(dir)
+}
 
+n, v, u = $F
+case n
+when "minitest"
+  v = "master"
+when "test-unit"
+else
   v = "v" + v
+end
 
-  case n
-  when "minitest"
-    v = "master"
-  when "test-unit"
-    v = v[1..-1]
-  end
-
-  FileUtils.mkdir_p "#{ARGV[0]}/gems/src"
-  `#{ARGV[0]}/tool/git-refresh -C #{ARGV[0]}/gems/src --branch #{v} #{u} #{n}`
+if File.directory?(n)
+  puts "updating #{n} ..."
+  system(*%W"git fetch", chdir: n) or abort
+else
+  puts "retrieving #{n} ..."
+  system(*%W"git clone #{u} #{n}") or abort
 end
+system(*%W"git checkout #{v}", chdir: n) or abort

Property changes on: tool/fetch-bundled_gems.rb
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

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

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