dev-cmd/bottle: check for prefix when not /usr/local

Fixes incorrectly marking bottles as relocatable, e.g.

425d4ea43d/Formula/p/pkgconf.rb (L34-L36)

This cannot be done for `/usr/local` as it is used outside Homebrew.
Other default prefixes are Homebrew-specific.
This commit is contained in:
Michael Cho 2025-02-23 14:15:19 -05:00
parent 58e4e0f8b2
commit 05d3ce85cd
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85

View File

@ -559,7 +559,7 @@ module Homebrew
ohai "Detecting if #{local_filename} is relocatable..." if bottle_path.size > 1 * 1024 * 1024
prefix_check = if Homebrew.default_prefix?(prefix)
prefix_check = if prefix == HOMEBREW_DEFAULT_PREFIX
File.join(prefix, "opt")
else
prefix