From 651be7da37708886845d4520827d34cdfc3e07e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Mon, 22 Feb 2016 17:01:02 +0100 Subject: [PATCH] Optimize operating_system.rb a bit. It would be better to stay with --{install-dir,bindir} pair, but this is currently broken and it does not currently generate documentation: https://github.com/rubygems/rubygems/issues/1470 --- operating_system.rb | 12 ++++++------ ruby.spec | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/operating_system.rb b/operating_system.rb index f1e8a43..d7d5702 100644 --- a/operating_system.rb +++ b/operating_system.rb @@ -116,10 +116,10 @@ module Gem # RubyGems default overrides. def default_dir - scl_prefix = ENV['X_SCLS'].split(' ').detect {|c| c != '@SCL@'} - scl_prefix = scl_prefix ? scl_prefix + '_': nil - if opt_build_root? + scl_prefix = ENV['X_SCLS'].split(' ').detect {|c| c != '@SCL@'} + scl_prefix = scl_prefix ? scl_prefix + '_': nil + Gem.default_dirs[:"#{scl_prefix}system"][:gem_dir] elsif Process.uid == 0 Gem.default_dirs[:local][:gem_dir] @@ -134,10 +134,10 @@ module Gem end def default_bindir - scl_prefix = ENV['X_SCLS'].split(' ').detect {|c| c != '@SCL@'} - scl_prefix = scl_prefix ? scl_prefix + '_': nil - if opt_build_root? + scl_prefix = ENV['X_SCLS'].split(' ').detect {|c| c != '@SCL@'} + scl_prefix = scl_prefix ? scl_prefix + '_': nil + Gem.default_dirs[:"#{scl_prefix}system"][:bin_dir] elsif Process.uid == 0 Gem.default_dirs[:local][:bin_dir] diff --git a/ruby.spec b/ruby.spec index 0a11f25..d6c217d 100644 --- a/ruby.spec +++ b/ruby.spec @@ -957,6 +957,7 @@ make check TESTS="-v $DISABLE_TESTS" * Mon Feb 22 2016 Vít Ondruch - 2.3.0-59 - Don't prefix bundling provides. - Don't enable collections for build. +- Optimize operating_system.rb a bit. * Fri Feb 19 2016 Pavel Valena - 2.3.0-58 - Fix default_dir and default_bindir