Use patch arguments directly

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Przemysław Kryger 2024-10-23 16:26:14 +01:00 committed by GitHub
parent a03d65b5c9
commit 13a26d5517
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,8 +140,7 @@ class ExternalPatch
patch_files.each do |patch_file|
ohai "Applying #{patch_file}"
patch_file = patch_dir/patch_file
args = %W[-g 0 -f -#{strip}]
Utils.safe_popen_write("patch", *args) do |p|
Utils.safe_popen_write("patch", "-g", "0", "-f", "-#{strip}") do |p|
File.foreach(patch_file) do |line|
data = line.gsub("HOMEBREW_PREFIX", HOMEBREW_PREFIX)
p.write(data)