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

ruby-changes:47809

From: nobu <ko1@a...>
Date: Sat, 16 Sep 2017 02:42:04 +0900 (JST)
Subject: [ruby-changes:47809] nobu:r59927 (trunk): rename ruby-runner as bin/ruby

nobu	2017-09-16 02:42:00 +0900 (Sat, 16 Sep 2017)

  New Revision: 59927

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

  Log:
    rename ruby-runner as bin/ruby
    
    * Makefile.in, configure.in, tool/runruby.rb: rename ruby-runner
      executable file as $(RUBY_INSTALL_NAME) under bin, to mimic
      dirty `#!/usr/bin/env` hack.

  Modified files:
    trunk/.gitattributes
    trunk/.gitignore
    trunk/Makefile.in
    trunk/configure.in
    trunk/test/dtrace/helper.rb
    trunk/tool/mkrunnable.rb
    trunk/tool/runruby.rb
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 59926)
+++ Makefile.in	(revision 59927)
@@ -265,7 +265,7 @@ $(ruby_pc): https://github.com/ruby/ruby/blob/trunk/Makefile.in#L265
 ruby-runner.h: template/ruby-runner.h.in
 		@./config.status --file=$@:$(srcdir)/template/$(@F).in
 
-ruby-runner$(EXEEXT): ruby-runner.c ruby-runner.h
+bin/$(PROGRAM): ruby-runner.c ruby-runner.h
 	$(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(RUBY_INSTALL_NAME) $(LDFLAGS) $(LIBS) $(OUTFLAG)$@ $<
 
 $(RBCONFIG): $(PREP)
@@ -417,7 +417,7 @@ clean-local:: https://github.com/ruby/ruby/blob/trunk/Makefile.in#L417
 	$(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
 		enc/encinit.c enc/encinit.$(OBJEXT)
 	-$(Q)$(RM) $(pkgconfig_DATA)
-	-$(Q)$(RMALL) ruby-runner$(EXEEXT) ruby-runner.h *.dSYM
+	-$(Q)$(RMALL) bin/$(PROGRAM) ruby-runner.h *.dSYM
 
 distclean-local::
 	$(Q)$(RM) ext/config.cache $(RBCONFIG) Doxyfile
Index: .gitattributes
===================================================================
--- .gitattributes	(revision 59926)
+++ .gitattributes	(revision 59927)
@@ -1,5 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/.gitattributes#L1
 *.gemspec diff=ruby
 *.rb diff=ruby
+bin svn-properties=svn:ignore=ruby
 bin/* diff=ruby
 tool/update-deps diff=ruby
 tool/make-snapshot diff=ruby
Index: tool/runruby.rb
===================================================================
--- tool/runruby.rb	(revision 59926)
+++ tool/runruby.rb	(revision 59927)
@@ -74,14 +74,14 @@ env = { https://github.com/ruby/ruby/blob/trunk/tool/runruby.rb#L74
   'RUBY_FIBER_MACHINE_STACK_SIZE' => '1',
 }
 
-runner = File.join(abs_archdir, "ruby-runner#{config['EXEEXT']}")
+runner = File.join(abs_archdir, "bin/ruby#{config['EXEEXT']}")
 runner = nil unless File.exist?(runner)
 abs_ruby = runner || File.expand_path(ruby)
 env["RUBY"] = abs_ruby
 env["GEM_PATH"] = env["GEM_HOME"] = File.expand_path("spec/rspec", srcdir)
 env["BUNDLE_RUBY"] = abs_ruby
 env["BUNDLE_GEM"] = "#{abs_ruby} -rrubygems #{srcdir}/bin/gem --backtrace"
-env["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
+env["PATH"] = [File.dirname(abs_ruby), abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
 
 if e = ENV["RUBYLIB"]
   libs |= e.split(File::PATH_SEPARATOR)
Index: tool/mkrunnable.rb
===================================================================
--- tool/mkrunnable.rb	(revision 59926)
+++ tool/mkrunnable.rb	(revision 59927)
@@ -115,8 +115,8 @@ rubyw_install_name = config["rubyw_insta https://github.com/ruby/ruby/blob/trunk/tool/mkrunnable.rb#L115
 goruby_install_name = "go" + ruby_install_name
 [ruby_install_name, rubyw_install_name, goruby_install_name].map do |ruby|
   ruby += exeext
-  if ruby and !ruby.empty?
-    ln_relative(ruby, "#{bindir}/#{ruby}")
+  if ruby and !ruby.empty? and !File.file?(target = "#{bindir}/#{ruby}")
+    ln_relative(ruby, target)
   end
 end
 so = config["LIBRUBY_SO"]
Index: test/dtrace/helper.rb
===================================================================
--- test/dtrace/helper.rb	(revision 59926)
+++ test/dtrace/helper.rb	(revision 59927)
@@ -46,8 +46,8 @@ module DTrace https://github.com/ruby/ruby/blob/trunk/test/dtrace/helper.rb#L46
       IO.popen(cmd, err: [:child, :out], &:readlines)
     end
 
-    exeext = Regexp.quote(RbConfig::CONFIG["EXEEXT"])
-    RUBYBIN = EnvUtil.rubybin.sub(/\/ruby-runner(?=#{exeext}\z)/, '/miniruby')
+    miniruby = "#{RbConfig::TOPDIR}/miniruby#{RbConfig::CONFIG["EXEEXT"]}"
+    RUBYBIN =  File.exist?(miniruby) ? miniruby : EnvUtil.rubybin
 
     def trap_probe d_program, ruby_program
       d = Tempfile.new(%w'probe .d')
Index: .gitignore
===================================================================
--- .gitignore	(revision 59926)
+++ .gitignore	(revision 59927)
@@ -130,6 +130,8 @@ lcov*.info https://github.com/ruby/ruby/blob/trunk/.gitignore#L130
 /benchmark/fasta.output.*
 /benchmark/wc.input
 
+/bin/ruby
+
 /enc/*.def
 /enc/*.exp
 /enc/*.lib
Index: configure.in
===================================================================
--- configure.in	(revision 59926)
+++ configure.in	(revision 59927)
@@ -4028,7 +4028,7 @@ AS_CASE("$cross_compiling:${LIBPATHENV}" https://github.com/ruby/ruby/blob/trunk/configure.in#L4028
     AC_MSG_CHECKING(whether wrapper for $LIBPATHENV is needed)
     AS_IF([env ${LIBPATHENV}=/lib /bin/sh -c ': ${'${LIBPATHENV}'?}' 2>/dev/null],
 	[AC_MSG_RESULT(no)],
-	[PREP="$PREP"' ruby-runner$(EXEEXT)'
+	[PREP="$PREP"' bin/$(PROGRAM)'
 	AC_MSG_RESULT(yes)]
     )
 ])

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

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