From c5bd5c4aa7f0595c91431407ff5bda4b1938afc3 Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Sun, 6 Nov 2016 03:46:22 -0800 Subject: [PATCH] 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. --- Library/Homebrew/dev-cmd/bottle.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index b1a3ebb431..7e98f2ebb1 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -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