aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-04-03 17:52:58 -0700
committerAdam Vandenberg2010-04-03 17:54:49 -0700
commitf4852f2fbf0552e72ff9bc1f3355b8653011bc3f (patch)
tree5e03c37fb066d3bb4403fdd2cb948a61501bfa41 /Library
parentc949ce4448512f1fda81bec8892776ea179b0353 (diff)
downloadhomebrew-f4852f2fbf0552e72ff9bc1f3355b8653011bc3f.tar.bz2
Add s.get_make_var
This allows more complicated transformations to happen, such as stripping out part of the variable.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/utils.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 088aea195..a0ec97af6 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -167,6 +167,12 @@ module HomebrewInreplaceExtension
gsub! Regexp.new("^#{flag}[ \\t]*=(.*)$\n?"), ""
end
end
+ # Finds the specified variable
+ def get_make_var flag
+ m = match Regexp.new("^#{flag}[ \\t]*=[ \\t]*(.*)$")
+ return m[1] if m
+ return nil
+ end
end
def inreplace path, before=nil, after=nil