Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Library/Homebrew/patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ def contents; end

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
Expand Down Expand Up @@ -150,7 +149,7 @@ def apply
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
Expand Down