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> | ||||
| 
 | ||||
| 	* 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) | ||||
|   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 @@ install?(:local, :comm, :bin, :'bin-comm') do | |||
|   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 @@ install?(:local, :comm, :bin, :'bin-comm') do | |||
|     shebang.sub!(/\r$/, '') | ||||
|     body.gsub!(/\r$/, '') | ||||
| 
 | ||||
|     cmd = File.join(bindir, name) | ||||
|     cmd << ".#{$cmdtype}" if $cmdtype | ||||
|     open_for_install(cmd, $script_mode) do | ||||
|       case $cmdtype | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 nobu
						nobu