mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* tool/rbinstall.rb (install_recursive): always skip default ignored
files. if block is given, call it instead of calling install. * tool/rbinstall.rb (bin-comm): use install_recursive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
61d197a62d
commit
31a974dfdb
2 changed files with 18 additions and 12 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Fri Dec 10 18:27:49 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* tool/rbinstall.rb (install_recursive): always skip default ignored
|
||||||
|
files. if block is given, call it instead of calling install.
|
||||||
|
|
||||||
|
* tool/rbinstall.rb (bin-comm): use install_recursive.
|
||||||
|
|
||||||
Fri Dec 10 18:12:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Dec 10 18:12:31 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* test/mkmf/base.rb (TestMkmf#config_value): extract macro value from
|
* test/mkmf/base.rb (TestMkmf#config_value): extract macro value from
|
||||||
|
|
|
@ -197,7 +197,8 @@ def install_recursive(srcdir, dest, options = {})
|
||||||
noinst = opts.delete(:no_install)
|
noinst = opts.delete(:no_install)
|
||||||
glob = opts.delete(:glob) || "*"
|
glob = opts.delete(:glob) || "*"
|
||||||
subpath = (srcdir.size+1)..-1
|
subpath = (srcdir.size+1)..-1
|
||||||
prune = skip = FalseProc
|
prune = []
|
||||||
|
skip = []
|
||||||
if noinst
|
if noinst
|
||||||
if Array === noinst
|
if Array === noinst
|
||||||
prune = noinst.grep(/#{File::SEPARATOR}/o).map!{|f| f.chomp(File::SEPARATOR)}
|
prune = noinst.grep(/#{File::SEPARATOR}/o).map!{|f| f.chomp(File::SEPARATOR)}
|
||||||
|
@ -209,10 +210,10 @@ def install_recursive(srcdir, dest, options = {})
|
||||||
skip = [noinst]
|
skip = [noinst]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
skip |= %w"#*# *~ *.old *.bak *.orig *.rej *.diff *.patch *.core"
|
skip |= %w"#*# *~ *.old *.bak *.orig *.rej *.diff *.patch *.core"
|
||||||
prune = path_matcher(prune)
|
prune = path_matcher(prune)
|
||||||
skip = path_matcher(skip)
|
skip = path_matcher(skip)
|
||||||
end
|
|
||||||
File.directory?(srcdir) or return rescue return
|
File.directory?(srcdir) or return rescue return
|
||||||
paths = [[srcdir, dest, true]]
|
paths = [[srcdir, dest, true]]
|
||||||
found = []
|
found = []
|
||||||
|
@ -239,9 +240,13 @@ def install_recursive(srcdir, dest, options = {})
|
||||||
makedirs(d)
|
makedirs(d)
|
||||||
else
|
else
|
||||||
makedirs(File.dirname(d))
|
makedirs(File.dirname(d))
|
||||||
|
if block_given?
|
||||||
|
yield src, d, opts
|
||||||
|
else
|
||||||
install src, d, opts
|
install src, d, opts
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def open_for_install(path, mode)
|
def open_for_install(path, mode)
|
||||||
|
@ -435,12 +440,7 @@ install?(:local, :comm, :bin, :'bin-comm') do
|
||||||
else
|
else
|
||||||
trans = proc {|base| base}
|
trans = proc {|base| base}
|
||||||
end
|
end
|
||||||
for src in Dir[File.join(srcdir, "bin/*")]
|
install_recursive(File.join(srcdir, "bin"), bindir) do |src, cmd|
|
||||||
next unless File.file?(src)
|
|
||||||
s = src.downcase
|
|
||||||
next if %w(old bak orig rej diff patch core).include? File.extname(s)
|
|
||||||
next if /^\.\#|(~|core)$/i =~ File.basename(s)
|
|
||||||
|
|
||||||
name = RbConfig.expand(trans[File.basename(src)])
|
name = RbConfig.expand(trans[File.basename(src)])
|
||||||
|
|
||||||
shebang = ''
|
shebang = ''
|
||||||
|
@ -457,7 +457,6 @@ install?(:local, :comm, :bin, :'bin-comm') do
|
||||||
shebang.sub!(/\r$/, '')
|
shebang.sub!(/\r$/, '')
|
||||||
body.gsub!(/\r$/, '')
|
body.gsub!(/\r$/, '')
|
||||||
|
|
||||||
cmd = File.join(bindir, name)
|
|
||||||
cmd << ".#{$cmdtype}" if $cmdtype
|
cmd << ".#{$cmdtype}" if $cmdtype
|
||||||
open_for_install(cmd, $script_mode) do
|
open_for_install(cmd, $script_mode) do
|
||||||
case $cmdtype
|
case $cmdtype
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue