summaryrefslogtreecommitdiff
path: root/tool/rbinstall.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 16:48:32 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-25 16:48:32 +0000
commit4eaa327852feb07ee3a042cbad1258085e0e556d (patch)
tree310c2806428b27d3732f6b55c025f9d537ef94e5 /tool/rbinstall.rb
parente7011a3ec99e83769371ba3ecf4b0a184d3057dc (diff)
* tool/rbinstall.rb: skip installing bundle gems if zlib is unavailable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-xtool/rbinstall.rb36
1 files changed, 22 insertions, 14 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 98e601e..4a6bae0 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -709,20 +709,28 @@ install?(:ext, :comm, :gem) do
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}"
- 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"))
+ 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
end
parse_args()