Skip to content

Commit

Permalink
Add comments for code removal
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Powell <thomas.powell@progress.com>
  • Loading branch information
tpowell-progress committed Mar 20, 2024
1 parent ccfedfd commit f94d8ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/software/openssl-customization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def get_sanitized_rbconfig(config)
end

embedded_ruby_lib_dir = get_sanitized_rbconfig("rubylibdir")

# use the value from the else clause here and remove the if/else once Ruby < 3.1
# is not supported in combination with OpenSSL >= 3.0
source_openssl_rb = if project.overrides[:openssl] && project.overrides[:ruby] &&
ChefUtils::VersionString.new(project.overrides[:ruby][:version]).satisfies?("< 3.1") &&
ChefUtils::VersionString.new(project.overrides[:openssl][:version]).satisfies?(">= 3.0")
Expand Down
7 changes: 6 additions & 1 deletion config/software/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@
configure_command << "--with-opt-dir=#{install_dir}/embedded"
end

# Remove this if clause once Ruby < 3.1 is not supported in combination with
# OpenSSL >= 3.0
if version.satisfies?("< 3.1") &&
project.overrides[:openssl] &&
ChefUtils::VersionString.new(project.overrides[:openssl][:version]).satisfies?(">= 3.0")
Expand All @@ -283,11 +285,14 @@
make "-j #{workers}", env: env
make "-j #{workers} install", env: env

# Remove this if clause once Ruby < 3.1 is not supported in combination with
# OpenSSL >= 3.0
if version.satisfies?("< 3.1") &&
project.overrides[:openssl] &&
ChefUtils::VersionString.new(project.overrides[:openssl][:version]).satisfies?(">= 3.0")

# use the same version as ruby 3.1.2 version has as default, so that the chef gemfile is just redundant
# use the same version as ruby 3.1.2 version has as default, so that the chef gemfile inclusion of the
# same openssl gem version is redundant for ruby 3.1[.2] projects
openssl_gem_version = project.overrides.dig(:ruby, :openssl_gem) || "3.0.0"
command "curl https://rubygems.org/downloads/openssl-#{openssl_gem_version}.gem --output openssl-#{openssl_gem_version}.gem"
command "#{install_dir}/embedded/bin/gem install openssl-#{openssl_gem_version}.gem --no-document"
Expand Down

0 comments on commit f94d8ab

Please sign in to comment.