summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-09 18:01:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-04-09 18:01:26 +0000
commit8191f129b5607d4b4a2ae71625eac1ebc8d98ef0 (patch)
tree2c52f83aa140b6b4b2983217eb1184d975d4f799
parent7bce5959703d814e62f0edc7408d157fca49d38b (diff)
downloadruby-8191f129b5607d4b4a2ae71625eac1ebc8d98ef0.tar.gz
* instruby.rb, mkconfig.rb: deal with --program-transform-name
better. now supports s, y commands and single addressing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rwxr-xr-xinstruby.rb26
-rwxr-xr-xmkconfig.rb33
-rw-r--r--version.h4
4 files changed, 59 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 4225462396..4431282620 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Apr 10 03:01:24 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * instruby.rb, mkconfig.rb: deal with --program-transform-name
+ better. now supports s, y commands and single addressing.
+
Thu Apr 9 23:59:11 2009 Tanaka Akira <akr@fsij.org>
* configure.in: don't override the rule for ruby.
diff --git a/instruby.rb b/instruby.rb
index fbbecbdac7..5d3e3820e3 100755
--- a/instruby.rb
+++ b/instruby.rb
@@ -381,11 +381,35 @@ install?(:local, :comm, :bin, :'bin-comm') do
if File::ALT_SEPARATOR
ruby_bin = ruby_shebang.tr(File::SEPARATOR, File::ALT_SEPARATOR)
end
+ if trans = CONFIG["program_transform_name"]
+ exp = []
+ trans.gsub!(/\$\$/, '$')
+ trans.scan(%r[\G[\s;]*(/(?:\\.|[^/])*/)?([sy])(\W)((?:\\.|(?!\3).)*)\3((?:\\.|(?!\3).)*)\3([gi]*)]) do
+ |addr, cmd, sep, pat, rep, opt|
+ addr &&= Regexp.new(addr[/\A\/(.*)\/\z/, 1])
+ case cmd
+ when 's'
+ next if pat == '^' and rep.empty?
+ exp << [addr, (opt.include?('g') ? :gsub! : :sub!),
+ Regexp.new(pat, opt.include?('i')), rep]
+ when 'y'
+ exp << [addr, :tr!, Regexp.quote(pat), rep]
+ end
+ end
+ trans = proc do |base|
+ exp.each {|addr, opt, pat, rep| base.__send__(opt, pat, rep) if !addr or addr =~ base}
+ base
+ end
+ elsif /ruby/ =~ ruby_install_name
+ trans = proc {|base| ruby_install_name.sub(/ruby/, base)}
+ else
+ trans = proc {|base| base}
+ end
for src in Dir[File.join(srcdir, "bin/*")]
next unless File.file?(src)
next if /\/[.#]|(\.(old|bak|orig|rej|diff|patch|core)|~|\/core)$/i =~ src
- name = ruby_install_name.sub(/ruby/, File.basename(src))
+ name = trans[File.basename(src)]
shebang = ''
body = ''
diff --git a/mkconfig.rb b/mkconfig.rb
index d715cc40d9..2a1ec927f2 100755
--- a/mkconfig.rb
+++ b/mkconfig.rb
@@ -83,12 +83,33 @@ File.foreach "config.status" do |line|
when /^\$\{ac_\w+\}$/; next
when /^\$ac_\w+$/; next
end
- if /^program_transform_name$/ =~ name and /^s(\\?.)(.*)\1$/ =~ val
- next if $install_name
- sep = %r"#{Regexp.quote($1)}"
- ptn = $2.gsub(/\$\$/, '$').split(sep, 2)
- name = "ruby_install_name"
- val = "ruby".sub(/#{ptn[0]}/, ptn[1])
+ if /^program_transform_name$/ =~ name
+ val.sub!(/\As(\W)(?:\^|\$\$)\1\1(;|\z)/, '')
+ if val.empty?
+ $install_name ||= "ruby"
+ next
+ end
+ unless $install_name
+ $install_name = "ruby"
+ val.gsub!(/\$\$/, '$')
+ val.scan(%r[\G[\s;]*(/(?:\\.|[^/])*/)?([sy])(\W)((?:\\.|(?!\3).)*)\3((?:\\.|(?!\3).)*)\3([gi]*)]) do
+ |addr, cmd, sep, pat, rep, opt|
+ if addr
+ Regexp.new(addr[/\A\/(.*)\/\z/, 1]) =~ $install_name or next
+ end
+ case cmd
+ when 's'
+ pat = Regexp.new(pat, opt.include?('i'))
+ if opt.include?('g')
+ $install_name.gsub!(pat, rep)
+ else
+ $install_name.sub!(pat, rep)
+ end
+ when 'y'
+ $install_name.tr!(Regexp.quote(pat), rep)
+ end
+ end
+ end
end
val.gsub!(/ +(?!-)/, "=") if name == "configure_args" && /mswin32/ =~ RUBY_PLATFORM
val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump
diff --git a/version.h b/version.h
index baaa0cc8a5..f809d5c367 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
-#define RUBY_RELEASE_DATE "2009-04-09"
+#define RUBY_RELEASE_DATE "2009-04-10"
#define RUBY_PATCHLEVEL -1
#define RUBY_BRANCH_NAME "trunk"
@@ -8,7 +8,7 @@
#define RUBY_VERSION_TEENY 1
#define RUBY_RELEASE_YEAR 2009
#define RUBY_RELEASE_MONTH 4
-#define RUBY_RELEASE_DAY 9
+#define RUBY_RELEASE_DAY 10
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];