Fix brew unpack --patch
Applying patches in `brew unpack` was broken since b76e26c9cf1f
("Decouple applying patches from staging the source").
Closes Homebrew/homebrew#38997.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
ec7b513a53
commit
789390f378
@ -2,12 +2,6 @@ require "stringio"
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module UnpackPatch
|
|
||||||
def patch
|
|
||||||
super if ARGV.flag?("--patch")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def unpack
|
def unpack
|
||||||
formulae = ARGV.formulae
|
formulae = ARGV.formulae
|
||||||
raise FormulaUnspecifiedError if formulae.empty?
|
raise FormulaUnspecifiedError if formulae.empty?
|
||||||
@ -22,7 +16,6 @@ module Homebrew
|
|||||||
raise "Cannot write to #{unpack_dir}" unless unpack_dir.writable_real?
|
raise "Cannot write to #{unpack_dir}" unless unpack_dir.writable_real?
|
||||||
|
|
||||||
formulae.each do |f|
|
formulae.each do |f|
|
||||||
f.extend(UnpackPatch)
|
|
||||||
stage_dir = unpack_dir.join("#{f.name}-#{f.version}")
|
stage_dir = unpack_dir.join("#{f.name}-#{f.version}")
|
||||||
|
|
||||||
if stage_dir.exist?
|
if stage_dir.exist?
|
||||||
@ -33,7 +26,10 @@ module Homebrew
|
|||||||
oh1 "Unpacking #{f.name} to: #{stage_dir}"
|
oh1 "Unpacking #{f.name} to: #{stage_dir}"
|
||||||
|
|
||||||
ENV['VERBOSE'] = '1' # show messages about tar
|
ENV['VERBOSE'] = '1' # show messages about tar
|
||||||
f.brew { cp_r getwd, stage_dir }
|
f.brew do
|
||||||
|
f.patch if ARGV.flag?("--patch")
|
||||||
|
cp_r getwd, stage_dir
|
||||||
|
end
|
||||||
ENV['VERBOSE'] = nil
|
ENV['VERBOSE'] = nil
|
||||||
|
|
||||||
if ARGV.git?
|
if ARGV.git?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user