utils/gems: prevent lockfile modification during installation

This commit is contained in:
Bo Anderson 2022-10-08 16:02:37 +01:00
parent c87c97e4d7
commit 5e31f41a52
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -129,6 +129,7 @@ module Homebrew
old_gem_home = ENV.fetch("GEM_HOME", nil)
old_bundle_gemfile = ENV.fetch("BUNDLE_GEMFILE", nil)
old_bundle_with = ENV.fetch("BUNDLE_WITH", nil)
old_bundle_frozen = ENV.fetch("BUNDLE_FROZEN", nil)
install_bundler!
@ -140,6 +141,7 @@ module Homebrew
ENV["BUNDLE_GEMFILE"] = File.join(ENV.fetch("HOMEBREW_LIBRARY"), "Homebrew", "Gemfile")
ENV["BUNDLE_WITH"] = groups.join(" ")
ENV["BUNDLE_FROZEN"] = "true"
if @bundle_installed_groups != groups
bundle = File.join(find_in_path("bundle"), "bundle")
@ -180,6 +182,7 @@ module Homebrew
ENV["GEM_HOME"] = old_gem_home
ENV["BUNDLE_GEMFILE"] = old_bundle_gemfile
ENV["BUNDLE_WITH"] = old_bundle_with
ENV["BUNDLE_FROZEN"] = old_bundle_frozen
end
end
end