diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 088aea1955..a0ec97af68 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