aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaun Jackman2017-11-19 13:54:00 -0800
committerShaun Jackman2017-11-19 13:54:46 -0800
commite32299e6527e51a06dbe3966dcaae0bca775808f (patch)
treeb08090e01fbbd334cc14bd643cdfa9e16d3c3c2f
parent935cf28c40d5d0fad5b05ab4da92177d53501d5c (diff)
downloadbrew-e32299e6527e51a06dbe3966dcaae0bca775808f.tar.bz2
patch: Use patch found in the PATH
-rw-r--r--Library/Homebrew/patch.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb
index a44add10e..1b379ba0f 100644
--- a/Library/Homebrew/patch.rb
+++ b/Library/Homebrew/patch.rb
@@ -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