Fix gem 3.5.5; rename patches for readability

gem 3.5.5 fixed the bad location for this path
This commit is contained in:
Max Howell 2024-01-18 16:39:22 -05:00
parent 186ee41804
commit dd02ec2804
No known key found for this signature in database
GPG key ID: 741BB84EF5BB9EEC
5 changed files with 38 additions and 22 deletions

View file

@ -20,21 +20,6 @@ diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
index b186375..de168c4 100644 index b186375..de168c4 100644
--- a/lib/rubygems/defaults.rb --- a/lib/rubygems/defaults.rb
+++ b/lib/rubygems/defaults.rb +++ b/lib/rubygems/defaults.rb
@@ -20,13 +20,7 @@ def self.default_sources
# specified in the environment
def self.default_spec_cache_dir
- default_spec_cache_dir = File.join Gem.user_home, ".gem", "specs"
-
- unless File.exist?(default_spec_cache_dir)
- default_spec_cache_dir = File.join Gem.data_home, "gem", "specs"
- end
-
- default_spec_cache_dir
+ File.join Gem.data_home, "specs"
end
##
@@ -34,7 +28,7 @@ def self.default_spec_cache_dir @@ -34,7 +28,7 @@ def self.default_spec_cache_dir
# specified in the environment # specified in the environment

View file

@ -14,8 +14,8 @@ runtime:
build: build:
dependencies: dependencies:
gnu.org/patch: '*' ruby-lang.org: ~3.1 # testing a theory
ruby-lang.org: ~3.1 # testing a theory # NOTE ^^ we dont know what this comment means either!
script: script:
- ruby setup.rb - ruby setup.rb
--prefix={{prefix}} --prefix={{prefix}}
@ -23,24 +23,55 @@ build:
--no-ri --no-ri
--no-rdoc --no-rdoc
# 3.5.5 fixed this
- run: patch -p1 --no-backup-if-mismatch < $PROP
if: <3.5.5
working-directory: ${{prefix}}
prop: |+
--- a/lib/rubygems/defaults.rb
+++ b/lib/rubygems/defaults.rb
@@ -20,13 +20,7 @@ def self.default_sources
# specified in the environment
def self.default_spec_cache_dir
- default_spec_cache_dir = File.join Gem.user_home, ".gem", "specs"
-
- unless File.exist?(default_spec_cache_dir)
- default_spec_cache_dir = File.join Gem.data_home, "gem", "specs"
- end
-
- default_spec_cache_dir
+ File.join Gem.cache_home, "gem", "specs"
end
##
- run: patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/fit-n-finish.patch
working-directory: ${{prefix}}
# makes rubys default system dir be fixed in /usr/local/lib/ruby
# rather the relative to ~/.pkgx/ruby-lang.org
- run: | - run: |
patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/fit-n-finish.1.patch patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/default-sys-dir.patch
patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/fit-n-finish.2.patch
sed -i -e 's/Gem.default_dir/Gem.default_system_dir/' lib/rubygems/path_support.rb sed -i -e 's/Gem.default_dir/Gem.default_system_dir/' lib/rubygems/path_support.rb
working-directory: ${{prefix}} working-directory: ${{prefix}}
# removes redudnant `gem` directory that looks gross in our directory formatting
- run: sed -i -e 's/Gem.state_home, "gem",/Gem.state_home,/' defaults.rb - run: sed -i -e 's/Gem.state_home, "gem",/Gem.state_home,/' defaults.rb
working-directory: ${{prefix}}/lib/rubygems working-directory: ${{prefix}}/lib/rubygems
if: '>=3.4' if: '>=3.4'
- run: patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/fit-n-finish.3.patch # ensure `gem` tries to install to ~/.gem if /usr/local is not writable
- run: patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/user-install-pre3.5.patch
working-directory: ${{prefix}} working-directory: ${{prefix}}
if: '<3.5' if: '<3.5'
- run: patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/user-install-post3.5.patch
- run: patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/fit-n-finish.4.patch
working-directory: ${{prefix}} working-directory: ${{prefix}}
if: '>=3.5' if: '>=3.5'
# fixes bug where gem wont create the full directory path when installing
# which typically isnt a problem since the directory already exists in a standard
# install but we fuck with the paths way more
- run: sed -i -e - run: sed -i -e
's/Dir\.mkdir dir, \*\[options\[:dir_mode\].*/FileUtils.mkdir_p dir, *[options[:dir_mode] \&\& 0o755].compact/' 's/Dir\.mkdir dir, \*\[options\[:dir_mode\].*/FileUtils.mkdir_p dir, *[options[:dir_mode] \&\& 0o755].compact/'
installer.rb installer.rb