mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
delete HOMEBREW_REPOSITORY & some variables
This commit is contained in:
parent
4bb1c5d546
commit
e6eeb2cbed
@ -175,13 +175,11 @@ class FormulaInstaller
|
||||
|
||||
bottle = formula.bottle_specification
|
||||
unless bottle.compatible_locations?
|
||||
# TODO: delete HOMEBREW_REPOSITORY reference after Homebrew 2.7.0 is released.
|
||||
if output_warning
|
||||
opoo <<~EOS
|
||||
Building #{formula.full_name} from source as the bottle needs:
|
||||
- HOMEBREW_CELLAR: #{bottle.cellar} (yours is #{HOMEBREW_CELLAR})
|
||||
- HOMEBREW_PREFIX: #{bottle.prefix} (yours is #{HOMEBREW_PREFIX})
|
||||
- HOMEBREW_REPOSITORY: #{bottle.repository} (yours is #{HOMEBREW_REPOSITORY})
|
||||
EOS
|
||||
end
|
||||
return false
|
||||
|
@ -7,13 +7,8 @@ class Keg
|
||||
REPOSITORY_PLACEHOLDER = "@@HOMEBREW_REPOSITORY@@"
|
||||
LIBRARY_PLACEHOLDER = "@@HOMEBREW_LIBRARY@@"
|
||||
|
||||
# TODO: delete this after Homebrew 2.7.0 is released.
|
||||
REPOSITORY_LIBRARY_PLACEHOLDER = "#{REPOSITORY_PLACEHOLDER}/Library"
|
||||
|
||||
Relocation = Struct.new(:old_prefix, :old_cellar, :old_repository, :old_library,
|
||||
:new_prefix, :new_cellar, :new_repository, :new_library,
|
||||
# TODO: delete these after Homebrew 2.7.0 is released.
|
||||
:old_repository_library, :new_repository_library) do
|
||||
:new_prefix, :new_cellar, :new_repository, :new_library) do
|
||||
# Use keyword args instead of positional args for initialization.
|
||||
def initialize(**kwargs)
|
||||
super(*members.map { |k| kwargs[k] })
|
||||
@ -47,14 +42,10 @@ class Keg
|
||||
old_cellar: HOMEBREW_CELLAR.to_s,
|
||||
new_prefix: PREFIX_PLACEHOLDER,
|
||||
new_cellar: CELLAR_PLACEHOLDER,
|
||||
# TODO: delete these after Homebrew 2.7.0 is released.
|
||||
old_library: HOMEBREW_LIBRARY.to_s,
|
||||
new_library: REPOSITORY_LIBRARY_PLACEHOLDER,
|
||||
old_repository: HOMEBREW_REPOSITORY.to_s,
|
||||
new_repository: REPOSITORY_PLACEHOLDER,
|
||||
# TODO: add these after Homebrew 2.7.0 is released.
|
||||
# old_library: HOMEBREW_LIBRARY.to_s,
|
||||
# new_library: LIBRARY_PLACEHOLDER,
|
||||
old_library: HOMEBREW_LIBRARY.to_s,
|
||||
new_library: LIBRARY_PLACEHOLDER,
|
||||
)
|
||||
relocate_dynamic_linkage(relocation)
|
||||
replace_text_in_files(relocation)
|
||||
@ -70,9 +61,6 @@ class Keg
|
||||
new_cellar: HOMEBREW_CELLAR.to_s,
|
||||
new_repository: HOMEBREW_REPOSITORY.to_s,
|
||||
new_library: HOMEBREW_LIBRARY.to_s,
|
||||
# TODO: delete these after Homebrew 2.7.0 is released.
|
||||
old_repository_library: REPOSITORY_LIBRARY_PLACEHOLDER,
|
||||
new_repository_library: HOMEBREW_LIBRARY.to_s,
|
||||
)
|
||||
relocate_dynamic_linkage(relocation) unless skip_linkage
|
||||
replace_text_in_files(relocation, files: files)
|
||||
@ -89,8 +77,6 @@ class Keg
|
||||
relocation.old_prefix => relocation.new_prefix,
|
||||
relocation.old_cellar => relocation.new_cellar,
|
||||
relocation.old_library => relocation.new_library,
|
||||
# TODO: delete this after Homebrew 2.7.0 is released.
|
||||
relocation.old_repository_library => relocation.new_repository_library,
|
||||
}.compact
|
||||
# when HOMEBREW_PREFIX == HOMEBREW_REPOSITORY we should use HOMEBREW_PREFIX for all relocations to avoid
|
||||
# being unable to differentiate between them.
|
||||
|
@ -385,17 +385,7 @@ class BottleSpecification
|
||||
compatible_cellar = cellar == HOMEBREW_CELLAR.to_s
|
||||
compatible_prefix = prefix == HOMEBREW_PREFIX.to_s
|
||||
|
||||
# Only check the repository matches if the prefix is the default.
|
||||
# This is because the bottle DSL does not allow setting a custom repository
|
||||
# but does allow setting a custom prefix.
|
||||
# TODO: delete this after Homebrew 2.7.0 is released.
|
||||
compatible_repository = if Homebrew.default_prefix?(prefix)
|
||||
repository == HOMEBREW_REPOSITORY.to_s
|
||||
else
|
||||
true
|
||||
end
|
||||
|
||||
compatible_cellar && compatible_prefix && compatible_repository
|
||||
compatible_cellar && compatible_prefix
|
||||
end
|
||||
|
||||
# Does the {Bottle} this {BottleSpecification} belongs to need to be relocated?
|
||||
|
Loading…
x
Reference in New Issue
Block a user