Dne 14.12.2017 v 19:03 Vít Ondruch napsal(a): > > Dne 14.12.2017 v 18:41 Vít Ondruch napsal(a): >> Dne 14.12.2017 v 18:23 Jun Aruga napsal(a): >>> OK thanks for the info. >>> >>> Comparing the result of "gem list" command between upstream and our >>> Fedora package, I found the difference. >>> That can be confusing people. >>> >>> Some of the gem are not shown in the result such as cmath for Fedora >>> package ruby. >>> >>> When running below command on mock, we can load cmath that is not in >>> "gem list" on mock, maybe those are only shown as a result of "gem >>> list". >>> >>> ``` >>> irb(main):003:0> require 'cmath' >>> => true >>> ``` >>> >>> Is it possible to add those gems in the result as a compatibility for >>> upstream Ruby? >>> Hidden gems such as cmath are confusing users. >> Interesting. That is definitely unintentional. Will take a look into it. >> > This appears to be related to the default location of where the gems are > installed. Upstream Ruby installs the gems into their directory, we > install the gems into home directory. And therefore RubyGems on Fedora > are trying to load the specifications for the default gems from the home > directory "/builddir/.gem/ruby/specifications/default" (testing in > mock). So far, we never had the default gem specifications, so this was > not issue. > >
Here is updated build, which should fix the issues: https://koji.fedoraproject.org/koji/taskinfo?taskID=23793602 The patch used to fix this in attachment. I'd love some feedback prior I push this into git. Mainly, I'd like you to test: 1) If "gem install" as a regular user still works the same. 2) If "gem install" as root still works the same. 3) If the RPM packages in Fedora (probably just noarch) still installs and runs just fine. 4) If rubygem- RPM packages build using this ruby are still build and installed correctly. 5) Any additional scenario you can think of ... Thx for testing. Vít
From 60eb961c25f801ee43ca1be9393ab2f0a0546677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <[email protected]> Date: Tue, 19 Dec 2017 14:00:20 +0100 Subject: [PATCH] Add Gem.operating_system_defaults to allow packagers to override defaults. This change allows Ruby packagers to override defaults and lazily query them. This is very much the same change as #1644 to treat the operating_system defaults the same way as platform defaults. --- lib/rubygems/config_file.rb | 2 +- lib/rubygems/defaults.rb | 21 ++++++++++++++++++++- test/rubygems/test_gem.rb | 7 +++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index a4efed0f5a..deee38e6d9 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -48,7 +48,7 @@ class Gem::ConfigFile # For Ruby packagers to set configuration defaults. Set in # rubygems/defaults/operating_system.rb - OPERATING_SYSTEM_DEFAULTS = {} + OPERATING_SYSTEM_DEFAULTS = Gem.operating_system_defaults ## # For Ruby implementers to set configuration defaults. Set in diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb index 43d57fc808..b8222877ae 100644 --- a/lib/rubygems/defaults.rb +++ b/lib/rubygems/defaults.rb @@ -177,7 +177,26 @@ def self.vendor_dir # :nodoc: end ## - # Default options for gem commands. + # Default options for gem commands for Ruby packagers. + # + # The options here should be structured as an array of string "gem" + # command names as keys and a string of the default options as values. + # + # Example: + # + # def self.operating_system_defaults + # { + # 'install' => '--no-rdoc --no-ri --env-shebang', + # 'update' => '--no-rdoc --no-ri --env-shebang' + # } + # end + + def self.operating_system_defaults + {} + end + + ## + # Default options for gem commands for Ruby implementers. # # The options here should be structured as an array of string "gem" # command names as keys and a string of the default options as values. diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 3225a05c6b..62b80c4945 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1799,6 +1799,13 @@ def test_use_gemdeps_specific ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps end + def test_operating_system_defaults + operating_system_defaults = Gem.operating_system_defaults + + assert operating_system_defaults != nil + assert operating_system_defaults.is_a? Hash + end + def test_platform_defaults platform_defaults = Gem.platform_defaults
_______________________________________________ ruby-sig mailing list -- [email protected] To unsubscribe send an email to [email protected]
