Merge pull request #3457 from sjackman/patch

Use patch found in the PATH
This commit is contained in:
Mike McQuaid 2017-11-20 08:21:57 +00:00 committed by GitHub
commit defd38af9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,10 +64,9 @@ class EmbeddedPatch
def apply
data = contents.gsub("HOMEBREW_PREFIX", HOMEBREW_PREFIX)
cmd = "/usr/bin/patch"
args = %W[-g 0 -f -#{strip}]
IO.popen("#{cmd} #{args.join(" ")}", "w") { |p| p.write(data) }
raise ErrorDuringExecution.new(cmd, args) unless $CHILD_STATUS.success?
Utils.popen_write("patch", *args) { |p| p.write(data) }
raise ErrorDuringExecution.new("patch", args) unless $CHILD_STATUS.success?
end
def inspect
@ -150,7 +149,7 @@ class ExternalPatch
patch_files.each do |patch_file|
ohai "Applying #{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