Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* 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
  • Loading branch information...
commit 31a974dfdb4ce245cd85cf58050e73f0d1a45ef5 1 parent 61d197a
@nobu nobu authored
Showing with 18 additions and 12 deletions.
  1. +7 −0 ChangeLog
  2. +11 −12 tool/rbinstall.rb
View
7 ChangeLog
@@ -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>
* test/mkmf/base.rb (TestMkmf#config_value): extract macro value from
View
23 tool/rbinstall.rb
@@ -197,7 +197,8 @@ def install_recursive(srcdir, dest, options = {})
noinst = opts.delete(:no_install)
glob = opts.delete(:glob) || "*"
subpath = (srcdir.size+1)..-1
- prune = skip = FalseProc
+ prune = []
+ skip = []
if noinst
if Array === noinst
prune = noinst.grep(/#{File::SEPARATOR}/o).map!{|f| f.chomp(File::SEPARATOR)}
@@ -209,10 +210,10 @@ def install_recursive(srcdir, dest, options = {})
skip = [noinst]
end
end
- skip |= %w"#*# *~ *.old *.bak *.orig *.rej *.diff *.patch *.core"
- prune = path_matcher(prune)
- skip = path_matcher(skip)
end
+ skip |= %w"#*# *~ *.old *.bak *.orig *.rej *.diff *.patch *.core"
+ prune = path_matcher(prune)
+ skip = path_matcher(skip)
File.directory?(srcdir) or return rescue return
paths = [[srcdir, dest, true]]
found = []
@@ -239,7 +240,11 @@ def install_recursive(srcdir, dest, options = {})
makedirs(d)
else
makedirs(File.dirname(d))
- install src, d, opts
+ if block_given?
+ yield src, d, opts
+ else
+ install src, d, opts
+ end
end
end
end
@@ -435,12 +440,7 @@ def prepare(mesg, basedir, subdirs=nil)
else
trans = proc {|base| base}
end
- for src in Dir[File.join(srcdir, "bin/*")]
- 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)
-
+ install_recursive(File.join(srcdir, "bin"), bindir) do |src, cmd|
name = RbConfig.expand(trans[File.basename(src)])
shebang = ''
@@ -457,7 +457,6 @@ def prepare(mesg, basedir, subdirs=nil)
shebang.sub!(/\r$/, '')
body.gsub!(/\r$/, '')
- cmd = File.join(bindir, name)
cmd << ".#{$cmdtype}" if $cmdtype
open_for_install(cmd, $script_mode) do
case $cmdtype
Please sign in to comment.
Something went wrong with that request. Please try again.