From 3e7fbf24fcb88404efc639691ba4b1b4b84e6ed3 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 19 Feb 2016 11:51:36 +0100 Subject: [PATCH] Fix dependent scls's paths Also fixes failing scl test --- operating_system.rb | 27 +++++++++++++++++++++++++-- ruby.spec | 9 +++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/operating_system.rb b/operating_system.rb index 4b2903d..f747494 100644 --- a/operating_system.rb +++ b/operating_system.rb @@ -48,6 +48,26 @@ module Gem :system => previous_but_one_dir_to(RbConfig::CONFIG['vendordir'], RbConfig::CONFIG['RUBY_INSTALL_NAME']), :local => previous_but_one_dir_to(RbConfig::CONFIG['sitedir'], RbConfig::CONFIG['RUBY_INSTALL_NAME']) } + + # Add additional default locations for enabled software collections + # Dependent scls needs to add themselves on $GEM_PATH + if ENV['GEM_PATH'] + gem_paths = ENV['GEM_PATH'].split(':') + + ENV['X_SCLS'].split(' ').each do |scl| + next if scl == '@SCL@' + + regexp = /#{scl}\/root\/usr\/share\/gems/ + scl_gem_path = gem_paths.grep(regexp)[0] + if scl_gem_path + prefix = scl_gem_path.gsub(/\A(.*)#{regexp}\z/, "\\1") + @default_locations["#{scl}_system".to_sym] = "#{prefix}#{scl}/root/usr" + @default_locations["#{scl}_local".to_sym] = "#{prefix}#{scl}/root/usr/local" + end + end if ENV['X_SCLS'] + end + + @default_locations end ## @@ -122,9 +142,12 @@ module Gem def default_ext_dir_for base_dir dir = if rpmbuild? - build_dir = base_dir.chomp Gem.default_dirs[:system][:gem_dir] + scl_prefix = ENV['X_SCLS'].split(' ').detect {|c| c != '@SCL@' && base_dir =~ /\/#{c}\//} + scl_prefix = scl_prefix ? scl_prefix + '_': nil + + build_dir = base_dir.chomp Gem.default_dirs[:"#{scl_prefix}system"][:gem_dir] if build_dir != base_dir - File.join build_dir, Gem.default_dirs[:system][:ext_dir] + File.join build_dir, Gem.default_dirs[:"#{scl_prefix}system"][:ext_dir] end else dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir} diff --git a/ruby.spec b/ruby.spec index afd468f..1e7dec5 100644 --- a/ruby.spec +++ b/ruby.spec @@ -23,7 +23,7 @@ %global ruby_archive %{ruby_archive}-%{?milestone}%{?!milestone:%{?revision:r%{revision}}} %endif -%global release 56 +%global release 57 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory three, since the @@ -626,12 +626,10 @@ sed -i 's/^/%lang(ja) /' .ruby-doc.ja %check # Ruby software collection tests -# - Failing -# - TODO: fix %{?scl:scl enable %scl - << \EOF mkdir -p ./lib/rubygems/defaults cp %{SOURCE1} ./lib/rubygems/defaults -make test-all TESTS="%{SOURCE14}" | grep ", 1 failures, 0 errors, " || exit 1 +make test-all TESTS="%{SOURCE14}" || exit 1 rm -rf ./lib/rubygems/defaults EOF} @@ -962,6 +960,9 @@ make check TESTS="-v $DISABLE_TESTS" %{ruby_libdir}/tkextlib %changelog +* Fri Feb 19 2016 Pavel Valena - 2.3.0-57 +- Fix dependent scls's paths + * Thu Feb 18 2016 Pavel Valena - 2.3.0-56 - Fix macros.ruby and macros.rubygems