gem, fix sed usage

This commit is contained in:
Max Howell 2023-12-29 07:12:30 +00:00
parent e179a909bc
commit 7f110f2627
No known key found for this signature in database
GPG key ID: 741BB84EF5BB9EEC

View file

@ -24,24 +24,24 @@ build:
--no-rdoc --no-rdoc
- run: | - run: |
patch -p1 < "$SRCROOT"/props/fit-n-finish.1.patch patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/fit-n-finish.1.patch
patch -p1 < "$SRCROOT"/props/fit-n-finish.2.patch patch -p1 --no-backup-if-mismatch < "$SRCROOT"/props/fit-n-finish.2.patch
sed -ie '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}}
- run: sed -ie '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 < "$SRCROOT"/props/fit-n-finish.3.patch - run: patch -p1 --no-backup-if-mismatch "" < "$SRCROOT"/props/fit-n-finish.3.patch
working-directory: ${{prefix}} working-directory: ${{prefix}}
if: '<3.5' if: '<3.5'
- run: patch -p1 < "$SRCROOT"/props/fit-n-finish.4.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'
- run: sed -ie - 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
working-directory: ${{prefix}}/lib/rubygems working-directory: ${{prefix}}/lib/rubygems
@ -111,16 +111,17 @@ test:
# test for https://github.com/pkgxdev/pantry/issues/4010 # test for https://github.com/pkgxdev/pantry/issues/4010
- run: | - run: |
export GEM_HOME=$HOME/.bundler
mv $FIXTURE Gemfile mv $FIXTURE Gemfile
bundle install --path vendor/bundle GEM_HOME=$HOME/.bundler bundle install --path vendor/bundle
fixture: | fixture: |
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'warbler', platforms: :jruby gem 'warbler', platforms: :jruby
# verifies that our bundler can be used as a gem # verifies that our bundler can be used as a gem
- run: - run:
ruby $FIXTURE rm -rf {{deps.ruby-lang.org.prefix}}/lib/ruby/gems/*/bundler*
rm -rf {{deps.ruby-lang.org.prefix}}/lib/ruby/gems/*/rubygems*
GEM_HOME=$HOME/.bundler ruby $FIXTURE
fixture: fixture:
content: | content: |
require 'bundler/inline' require 'bundler/inline'