aboutsummaryrefslogtreecommitdiffstats
path: root/Library/ENV
diff options
context:
space:
mode:
authorXiyue Deng2012-10-31 02:44:18 -0700
committerMax Howell2012-11-01 09:51:41 -0400
commit6762780f3efd4dcdc2d59438d2a5a93c054c372f (patch)
treedc0de8938c78c21a9b31f8259274e3ef570c840d /Library/ENV
parentbeb5f9761415899f587a0a61ec795381b9e1764b (diff)
downloadbrew-6762780f3efd4dcdc2d59438d2a5a93c054c372f.tar.bz2
Whitelist Homebrew's own prefix in superenv.
This allows Homebrew to be installed into /opt or /sw. Closes Homebrew/homebrew#15780. Signed-off-by: Max Howell <mxcl@me.com> Cleaned up the patch a little. Still ugly though, but logic is unusual so that's just how it is.
Diffstat (limited to 'Library/ENV')
-rwxr-xr-xLibrary/ENV/4.3/cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc
index cdf69e5f3..6c1b4a0b7 100755
--- a/Library/ENV/4.3/cc
+++ b/Library/ENV/4.3/cc
@@ -120,12 +120,16 @@ class Cmd
args << "-I#{path}" if iset.add?(path.cleanpath)
when /^-L(.+)/
path = $1.chuzzle || whittler.next
- case path.cleanpath
+ doit = case path.cleanpath
+ when %r{^#$brewfix}
+ # maybe homebrew is installed to /sw or /opt/brew
+ true
when %r{^/opt}, %r{^/sw}, %r{/usr/X11}
- # NOOP
+ false
else
- args << "-L#{path}" if lset.add?(path.cleanpath)
+ true
end
+ args << "-L#{path}" if doit and lset.add?(path.cleanpath)
else
args << arg
end