Skip to content

Commit

Permalink
devel/rubygem-pdk: Fix packaging
Browse files Browse the repository at this point in the history
While here, mark broken with "modern" Ruby because it use some legacy
Ruby syntax but when corrected still fails with nonexistent dependencies:
puppetlabs/puppet-module-gems#166

With hat:	puppet
  • Loading branch information
smortex committed Jun 29, 2022
1 parent 1a97258 commit 14dd59d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
3 changes: 3 additions & 0 deletions devel/rubygem-pdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN_DEPENDS= rubygem-bundler>=1.15:sysutils/rubygem-bundler \
rubygem-tty-spinner>=0.5:devel/rubygem-tty-spinner \
rubygem-tty-which>=0.3:devel/rubygem-tty-which

BROKEN_RUBY30= yes
BROKEN_RUBY31= yes

USES= gem
USE_RUBY= yes

Expand Down
20 changes: 10 additions & 10 deletions devel/rubygem-pdk/files/patch-lib_pdk_cli_exec_command.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- lib/pdk/cli/exec/command.rb.orig 2022-02-13 01:06:51 UTC
--- lib/pdk/cli/exec/command.rb.orig 2022-06-29 04:55:12 UTC
+++ lib/pdk/cli/exec/command.rb
@@ -187,7 +187,7 @@ module PDK

resolved_env['GEM_HOME'] = PDK::Util::RubyVersion.gem_home
gem_path = PDK::Util::RubyVersion.gem_path
- resolved_env['GEM_PATH'] = gem_path.empty? ? resolved_env['GEM_HOME'] : gem_path
+ # resolved_env['GEM_PATH'] = gem_path.empty? ? resolved_env['GEM_HOME'] : gem_path

# Make sure invocation of Ruby prefers our private installation.
package_binpath = PDK::Util.package_install? ? File.join(PDK::Util.pdk_package_basedir, 'bin') : nil
@@ -187,7 +187,7 @@ module PDK

resolved_env['GEM_HOME'] = PDK::Util::RubyVersion.gem_home
gem_path = PDK::Util::RubyVersion.gem_path
- resolved_env['GEM_PATH'] = gem_path.empty? ? resolved_env['GEM_HOME'] : gem_path
+ # resolved_env['GEM_PATH'] = gem_path.empty? ? resolved_env['GEM_HOME'] : gem_path

# Make sure invocation of Ruby prefers our private installation.
package_binpath = PDK::Util.package_install? ? File.join(PDK::Util.pdk_package_basedir, 'bin') : nil
46 changes: 23 additions & 23 deletions devel/rubygem-pdk/files/patch-lib_pdk_util_bundler.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
--- lib/pdk/util/bundler.rb.orig 2022-02-13 01:09:14 UTC
--- lib/pdk/util/bundler.rb.orig 2022-06-29 05:24:26 UTC
+++ lib/pdk/util/bundler.rb
@@ -21,12 +21,7 @@ module PDK
return
end

- unless bundle.locked?
- # Generate initial default Gemfile.lock, either from package cache or
- # by invoking `bundle lock`
- bundle.lock!
- end
-
+ if bundle.locked?
# Check if all dependencies will be available once we update the lockfile.
begin
original_lockfile = bundle.gemfile_lock
@@ -40,6 +35,7 @@ module PDK
end

bundle.update_lock!(with: gem_overrides, local: all_deps_available)
+ end

# If there are missing dependencies after updating the lockfile, let `bundle install`
# go out and get them. If the specified puppet gem version points to a remote location
@@ -21,12 +21,7 @@ module PDK
return
end

- unless bundle.locked?
- # Generate initial default Gemfile.lock, either from package cache or
- # by invoking `bundle lock`
- bundle.lock!
- end
-
+ if bundle.locked?
# Check if all dependencies will be available once we update the lockfile.
begin
original_lockfile = bundle.gemfile_lock
@@ -40,6 +35,7 @@ module PDK
end

bundle.update_lock!(with: gem_overrides, local: all_deps_available)
+ end

# If there are missing dependencies after updating the lockfile, let `bundle install`
# go out and get them. If the specified puppet gem version points to a remote location

0 comments on commit 14dd59d

Please sign in to comment.