aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-08-19 12:32:55 -0500
committerJack Nagel2013-08-19 12:32:55 -0500
commit21d3402f8ea7844115d20e2d32b612af5bdaab60 (patch)
tree9789ffd22bff0ad07c67d4bbb26557799a0d087d /Library
parent3128931238fd74695a54fcbd0c74b2a6d8976f0a (diff)
downloadbrew-21d3402f8ea7844115d20e2d32b612af5bdaab60.tar.bz2
Extend Superenv onto ENV instead of defining it on the singleton class
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/superenv.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb
index 31f6da620..bb32d0a29 100644
--- a/Library/Homebrew/superenv.rb
+++ b/Library/Homebrew/superenv.rb
@@ -22,8 +22,7 @@ def superenv?
true
end
-# Note that this block is guarded with `if superenv?`
-class << ENV
+module Superenv
attr_accessor :keg_only_deps, :deps, :x11
alias_method :x11?, :x11
@@ -288,7 +287,6 @@ class << ENV
# This should be a safe hack to prevent that exception cropping up.
# Main consqeuence of this is that ENV['CFLAGS'] is never nil even when it
# is which can break if checks, but we don't do such a check in our code.
- alias_method :"old_[]", :[]
def [] key
if has_key? key
fetch(key)
@@ -304,8 +302,7 @@ class << ENV
a
end
end
-
-end if superenv?
+end
if not superenv?
@@ -313,6 +310,7 @@ if not superenv?
# we must do this or tools like pkg-config won't get found by configure scripts etc.
ENV.prepend 'PATH', "#{HOMEBREW_PREFIX}/bin", ':' unless ORIGINAL_PATHS.include? HOMEBREW_PREFIX/'bin'
else
+ ENV.extend(Superenv)
ENV.keg_only_deps = []
ENV.deps = []
end