aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/brewkit.rb
diff options
context:
space:
mode:
authorMax Howell2009-07-31 02:51:17 +0100
committerMax Howell2009-07-31 04:59:02 +0100
commit118b41bfcdb13a4fec8da48e35de162ac62fe65c (patch)
treec9fdffd72da6a8a53b5fac4529aefaf7f7df4129 /Library/Homebrew/brewkit.rb
parent1d4e18988019e14e90646018072f83e988531820 (diff)
downloadhomebrew-118b41bfcdb13a4fec8da48e35de162ac62fe65c.tar.bz2
Refactor $foo into HOMEBREW_FOO
CONSTANTS are the far saner choice for these important parameters. Split env up so I can redefine the CONSTANTS in unittest.rb.
Diffstat (limited to 'Library/Homebrew/brewkit.rb')
-rw-r--r--Library/Homebrew/brewkit.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb
index 94cb8a014..1ff6e0af2 100644
--- a/Library/Homebrew/brewkit.rb
+++ b/Library/Homebrew/brewkit.rb
@@ -31,18 +31,18 @@ ENV['CC']='gcc-4.2'
ENV['CXX']='g++-4.2'
ENV['MAKEFLAGS']="-j#{OSX::NSProcessInfo.processInfo.processorCount}"
-unless $root.to_s == '/usr/local'
- ENV['CPPFLAGS']='-I'+$root+'include'
- ENV['LDFLAGS']='-L'+$root+'lib'
+unless HOMEBREW_PREFIX == '/usr/local'
+ ENV['CPPFLAGS']="-I#{HOMEBREW_PREFIX}/include"
+ ENV['LDFLAGS']="-L#{HOMEBREW_PREFIX}/lib"
end
def inreplace(path, before, after)
before=Regexp.escape before.to_s
after=Regexp.escape after.to_s
- before=before.gsub "/", "\\\/"
- after=after.gsub "/", "\\\/"
- before=before.gsub "'", '\''
- after=after.gsub "'", '\''
+ before.gsub! "/", "\\\/"
+ after.gsub! "/", "\\\/"
+ before.gsub! "'", '\''
+ after.gsub! "'", '\''
# TODO this sucks
# either use 'ed', or allow regexp and use a proper ruby function