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
|
LOGGER = Logger.new
|
||||||
|
|
||||||
class Cmd
|
class Cmd
|
||||||
attr_reader :brewfix, :brewtmp, :sysroot
|
attr_reader :prefix, :cellar, :tmpdir, :sysroot
|
||||||
|
|
||||||
def initialize path, args
|
def initialize path, args
|
||||||
@arg0 = File.basename(path).freeze
|
@arg0 = File.basename(path).freeze
|
||||||
@args = args.freeze
|
@args = args.freeze
|
||||||
@brewfix = ENV['HOMEBREW_PREFIX']
|
@prefix = ENV['HOMEBREW_PREFIX']
|
||||||
@brewtmp = ENV['HOMEBREW_TEMP']
|
@cellar = ENV['HOMEBREW_CELLAR']
|
||||||
|
@tmpdir = ENV['HOMEBREW_TEMP']
|
||||||
@sysroot = ENV['HOMEBREW_SDKROOT']
|
@sysroot = ENV['HOMEBREW_SDKROOT']
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -199,7 +200,7 @@ class Cmd
|
|||||||
|
|
||||||
def keep? path
|
def keep? path
|
||||||
case 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
|
# maybe homebrew is installed to /sw or /opt/brew
|
||||||
true
|
true
|
||||||
when %r{^/opt}, %r{^/sw}, %r{/usr/X11}
|
when %r{^/opt}, %r{^/sw}, %r{/usr/X11}
|
||||||
|
|||||||
@ -45,6 +45,7 @@ module Superenv
|
|||||||
self['HOMEBREW_OPTIMIZATION_LEVEL'] = 'Os'
|
self['HOMEBREW_OPTIMIZATION_LEVEL'] = 'Os'
|
||||||
self['HOMEBREW_BREW_FILE'] = HOMEBREW_BREW_FILE.to_s
|
self['HOMEBREW_BREW_FILE'] = HOMEBREW_BREW_FILE.to_s
|
||||||
self['HOMEBREW_PREFIX'] = HOMEBREW_PREFIX.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_TEMP'] = HOMEBREW_TEMP.to_s
|
||||||
self['HOMEBREW_SDKROOT'] = effective_sysroot
|
self['HOMEBREW_SDKROOT'] = effective_sysroot
|
||||||
self['HOMEBREW_OPTFLAGS'] = determine_optflags
|
self['HOMEBREW_OPTFLAGS'] = determine_optflags
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user