ruby-changes:36934
From: usa <ko1@a...>
Date: Fri, 26 Dec 2014 01:48:47 +0900 (JST)
Subject: [ruby-changes:36934] usa:r49015 (trunk): * tool/rbinstall.rb: skip installing bundle gems if zlib is unavailable.
usa 2014-12-26 01:48:32 +0900 (Fri, 26 Dec 2014) New Revision: 49015 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49015 Log: * tool/rbinstall.rb: skip installing bundle gems if zlib is unavailable. Modified files: trunk/ChangeLog trunk/tool/rbinstall.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 49014) +++ ChangeLog (revision 49015) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Dec 26 01:41:40 2014 NAKAMURA Usaku <usa@r...> + + * tool/rbinstall.rb: skip installing bundle gems if zlib is unavailable. + Fri Dec 26 01:24:42 2014 NAKAMURA Usaku <usa@r...> * tool/downloader.rb: support old versions of ruby. Index: tool/rbinstall.rb =================================================================== --- tool/rbinstall.rb (revision 49014) +++ tool/rbinstall.rb (revision 49015) @@ -709,20 +709,28 @@ install?(:ext, :comm, :gem) do https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L709 end install?(:ext, :comm, :gem) do - require 'pathname' - gem_dir = Gem.default_dir - directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) - prepare "bundle gems", gem_dir, directories - Dir.glob(srcdir+'/gems/*.gem').each do |gem| - Gem.install gem, Gem::Requirement.default, :install_dir => with_destdir(Gem.dir), :domain => :local, :ignore_dependencies => true - gemname = Pathname(gem).basename - puts "#{" "*30}#{gemname}" + begin + require "zlib" + rescue LoadErroe + end + if defined?(Zlib) + require 'pathname' + gem_dir = Gem.default_dir + directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode) + prepare "bundle gems", gem_dir, directories + Dir.glob(srcdir+'/gems/*.gem').each do |gem| + Gem.install gem, Gem::Requirement.default, :install_dir => with_destdir(Gem.dir), :domain => :local, :ignore_dependencies => true + gemname = Pathname(gem).basename + puts "#{" "*30}#{gemname}" + end + # fix directory permissions + # TODO: Gem.install should accept :dir_mode option or something + File.chmod($dir_mode, *Dir.glob(with_destdir(Gem.dir)+"/**/")) + # fix .gemspec permissions + File.chmod($data_mode, *Dir.glob(with_destdir(Gem.dir)+"/specifications/*.gemspec")) + else + puts "skip installing bundle gems because of lacking zlib" end - # fix directory permissions - # TODO: Gem.install should accept :dir_mode option or something - File.chmod($dir_mode, *Dir.glob(with_destdir(Gem.dir)+"/**/")) - # fix .gemspec permissions - File.chmod($data_mode, *Dir.glob(with_destdir(Gem.dir)+"/specifications/*.gemspec")) end parse_args() -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/