link_overwrite: allow to overwrite files from alias
See https://github.com/Homebrew/homebrew-core/pull/54912#issuecomment-653893645 Formulary.factory("python") points to python@3.8, which breaks link_overwrite for that case. This changes checks if the formula is an alias, so that we can still override the files during installation.
This commit is contained in:
parent
505c1e7240
commit
5eae33b59d
@ -1112,13 +1112,15 @@ class Formula
|
|||||||
return false if tab_tap.nil?
|
return false if tab_tap.nil?
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Formulary.factory(keg.name)
|
f = Formulary.factory(keg.name)
|
||||||
rescue FormulaUnavailableError
|
rescue FormulaUnavailableError
|
||||||
# formula for this keg is deleted, so defer to allowlist
|
# formula for this keg is deleted, so defer to allowlist
|
||||||
rescue TapFormulaAmbiguityError, TapFormulaWithOldnameAmbiguityError
|
rescue TapFormulaAmbiguityError, TapFormulaWithOldnameAmbiguityError
|
||||||
return false # this keg belongs to another formula
|
return false # this keg belongs to another formula
|
||||||
else
|
else
|
||||||
return false # this keg belongs to another formula
|
# this keg belongs to another formula
|
||||||
|
# but it is not an alias
|
||||||
|
return false unless f.aliases.include? keg.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
to_check = path.relative_path_from(HOMEBREW_PREFIX).to_s
|
to_check = path.relative_path_from(HOMEBREW_PREFIX).to_s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user