Merge pull request #3457 from sjackman/patch
Use patch found in the PATH
This commit is contained in:
commit
defd38af9b
@ -64,10 +64,9 @@ class EmbeddedPatch
|
|||||||
|
|
||||||
def apply
|
def apply
|
||||||
data = contents.gsub("HOMEBREW_PREFIX", HOMEBREW_PREFIX)
|
data = contents.gsub("HOMEBREW_PREFIX", HOMEBREW_PREFIX)
|
||||||
cmd = "/usr/bin/patch"
|
|
||||||
args = %W[-g 0 -f -#{strip}]
|
args = %W[-g 0 -f -#{strip}]
|
||||||
IO.popen("#{cmd} #{args.join(" ")}", "w") { |p| p.write(data) }
|
Utils.popen_write("patch", *args) { |p| p.write(data) }
|
||||||
raise ErrorDuringExecution.new(cmd, args) unless $CHILD_STATUS.success?
|
raise ErrorDuringExecution.new("patch", args) unless $CHILD_STATUS.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
@ -150,7 +149,7 @@ class ExternalPatch
|
|||||||
patch_files.each do |patch_file|
|
patch_files.each do |patch_file|
|
||||||
ohai "Applying #{patch_file}"
|
ohai "Applying #{patch_file}"
|
||||||
patch_file = patch_dir/patch_file
|
patch_file = patch_dir/patch_file
|
||||||
safe_system "/usr/bin/patch", "-g", "0", "-f", "-#{strip}", "-i", patch_file
|
safe_system "patch", "-g", "0", "-f", "-#{strip}", "-i", patch_file
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user