From c56681a227395c91698d1548c1944ecf02b77e24 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Wed, 16 Dec 2020 14:03:10 -0800 Subject: [PATCH] Comment needed changes if HOMEBREW_LIBRARY changes --- Library/Homebrew/formula_cellar_checks.rb | 2 ++ Library/Homebrew/keg_relocate.rb | 3 +++ Library/Homebrew/test/global_spec.rb | 2 ++ bin/brew | 2 ++ 4 files changed, 9 insertions(+) diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index f7ffc988f0..cd568a8466 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -7,6 +7,8 @@ require "utils/shell" # # @api private module FormulaCellarChecks + # If the location of HOMEBREW_LIBRARY changes + # keg_relocate.rb, test/global_spec.rb, and this constant need to change. REPOSITORY_AND_NOT_LIBRARY_REGEX = %r{#{HOMEBREW_REPOSITORY}(?!/Library/)}.freeze def check_env_path(bin) diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index e9838640f5..a10ebe27b2 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -5,6 +5,9 @@ class Keg PREFIX_PLACEHOLDER = "@@HOMEBREW_PREFIX@@" CELLAR_PLACEHOLDER = "@@HOMEBREW_CELLAR@@" REPOSITORY_PLACEHOLDER = "@@HOMEBREW_REPOSITORY@@" + + # If the location of HOMEBREW_LIBRARY changes + # formula_cellar_checks.rb, test/global_spec.rb, and this constant need to change. LIBRARY_PLACEHOLDER = "@@HOMEBREW_REPOSITORY@@/Library" Relocation = Struct.new(:old_prefix, :old_cellar, :old_repository, :old_library, diff --git a/Library/Homebrew/test/global_spec.rb b/Library/Homebrew/test/global_spec.rb index 914cb3cf84..644c32bd16 100644 --- a/Library/Homebrew/test/global_spec.rb +++ b/Library/Homebrew/test/global_spec.rb @@ -9,6 +9,8 @@ describe "brew", :integration_test do .and be_a_success end + # If the location of HOMEBREW_LIBRARY changes + # keg_relocate.rb, formula_cellar_checks.rb, and this test need to change. it "ensures that HOMEBREW_LIBRARY=HOMEBREW_REPOSITORY/Library" do expect(HOMEBREW_LIBRARY.to_s).to eq("#{HOMEBREW_REPOSITORY}/Library") end diff --git a/bin/brew b/bin/brew index d247d13264..d93497ef3e 100755 --- a/bin/brew +++ b/bin/brew @@ -58,6 +58,8 @@ then fi fi +# If the location of HOMEBREW_LIBRARY changes +# keg_relocate.rb, formula_cellar_checks.rb, and test/global_spec.rb need to change. HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library" # Copy and export all HOMEBREW_* variables previously mentioned in