bottle: improve relocatability check

Given how common it is for formulae to hard-code `etc` and `var`, check
for those paths (`/usr/local/etc` and `/usr/local/var`) when determing
relocatability.
This commit is contained in:
ilovezfs 2016-11-06 03:46:22 -08:00
parent f14a3a17de
commit c5bd5c4aa7

View File

@ -251,6 +251,8 @@ module Homebrew
relocatable = false if keg_contain?(cellar, keg, ignores)
if prefix != prefix_check
relocatable = false if keg_contain_absolute_symlink_starting_with?(prefix, keg)
relocatable = false if keg_contain?("#{prefix}/etc", keg, ignores)
relocatable = false if keg_contain?("#{prefix}/var", keg, ignores)
end
skip_relocation = relocatable && !keg.require_relocation?
end