Fix dependent scls's paths

Also fixes failing scl test
This commit is contained in:
Pavel Valena 2016-02-19 11:51:36 +01:00
parent ce0f3786d7
commit 3e7fbf24fc
2 changed files with 30 additions and 6 deletions

View File

@ -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}

View File

@ -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 <pvalena@redhat.com> - 2.3.0-57
- Fix dependent scls's paths
* Thu Feb 18 2016 Pavel Valena <pvalena@redhat.com> - 2.3.0-56
- Fix macros.ruby and macros.rubygems