Auto-substitute certain variables in DATA patches

HOMEBREW_PREFIX for example.
This commit is contained in:
Max Howell 2011-08-23 23:25:47 +01:00
parent 4f4d70d457
commit 39453f5a9d

View File

@ -590,8 +590,8 @@ EOF
p = {:filename => '%03d-homebrew.diff' % n+=1, :compression => false} p = {:filename => '%03d-homebrew.diff' % n+=1, :compression => false}
if defined? DATA and url == DATA if defined? DATA and url == DATA
pn=Pathname.new p[:filename] pn = Pathname.new p[:filename]
pn.write DATA.read pn.write(DATA.read.to_s.gsub("HOMEBREW_PREFIX", HOMEBREW_PREFIX))
elsif url =~ %r[^\w+\://] elsif url =~ %r[^\w+\://]
out_fn = p[:filename] out_fn = p[:filename]
case url case url