Don't prune cellar paths when cellar is in /opt
Fixes Homebrew/homebrew#35382.
This commit is contained in:
parent
9f3d88158b
commit
f438af9915
@ -26,13 +26,14 @@ end
|
||||
LOGGER = Logger.new
|
||||
|
||||
class Cmd
|
||||
attr_reader :brewfix, :brewtmp, :sysroot
|
||||
attr_reader :prefix, :cellar, :tmpdir, :sysroot
|
||||
|
||||
def initialize path, args
|
||||
@arg0 = File.basename(path).freeze
|
||||
@args = args.freeze
|
||||
@brewfix = ENV['HOMEBREW_PREFIX']
|
||||
@brewtmp = ENV['HOMEBREW_TEMP']
|
||||
@prefix = ENV['HOMEBREW_PREFIX']
|
||||
@cellar = ENV['HOMEBREW_CELLAR']
|
||||
@tmpdir = ENV['HOMEBREW_TEMP']
|
||||
@sysroot = ENV['HOMEBREW_SDKROOT']
|
||||
end
|
||||
|
||||
@ -199,7 +200,7 @@ class Cmd
|
||||
|
||||
def keep? path
|
||||
case path
|
||||
when %r{^#{Regexp.escape(brewfix)}}o, %r{^#{Regexp.escape(brewtmp)}}o
|
||||
when %r{^#{Regexp.escape(prefix)}}o, %r{^#{Regexp.escape(cellar)}}o, %r{^#{Regexp.escape(tmpdir)}}o
|
||||
# maybe homebrew is installed to /sw or /opt/brew
|
||||
true
|
||||
when %r{^/opt}, %r{^/sw}, %r{/usr/X11}
|
||||
|
||||
@ -45,6 +45,7 @@ module Superenv
|
||||
self['HOMEBREW_OPTIMIZATION_LEVEL'] = 'Os'
|
||||
self['HOMEBREW_BREW_FILE'] = HOMEBREW_BREW_FILE.to_s
|
||||
self['HOMEBREW_PREFIX'] = HOMEBREW_PREFIX.to_s
|
||||
self['HOMEBREW_CELLAR'] = HOMEBREW_CELLAR.to_s
|
||||
self['HOMEBREW_TEMP'] = HOMEBREW_TEMP.to_s
|
||||
self['HOMEBREW_SDKROOT'] = effective_sysroot
|
||||
self['HOMEBREW_OPTFLAGS'] = determine_optflags
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user