Merge pull request #7915 from iMichka/link

link_overwrite: allow to overwrite files from alias
This commit is contained in:
Mike McQuaid 2020-07-06 09:42:52 +01:00 committed by GitHub
commit f72328d9c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1112,13 +1112,14 @@ 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 unrelated formula
return false unless (f.aliases + f.oldname).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