Decouple applying patches from staging the source

This commit is contained in:
Jack Nagel 2014-12-26 17:44:44 -05:00
parent 051658db65
commit 2ff86eb417
2 changed files with 10 additions and 5 deletions

View File

@ -115,6 +115,8 @@ class Build
end end
formula.brew do formula.brew do
formula.patch
if ARGV.git? if ARGV.git?
system "git", "init" system "git", "init"
system "git", "add", "-A" system "git", "add", "-A"

View File

@ -367,12 +367,18 @@ class Formula
false false
end end
def patch
ohai "Patching"
active_spec.patches.each(&:apply)
end
# yields self with current working directory set to the uncompressed tarball # yields self with current working directory set to the uncompressed tarball
# @private # @private
def brew def brew
stage do stage do
prepare_patches
begin begin
patch
yield self yield self
ensure ensure
cp Dir["config.log", "CMakeCache.txt"], HOMEBREW_LOGS+name cp Dir["config.log", "CMakeCache.txt"], HOMEBREW_LOGS+name
@ -723,7 +729,7 @@ class Formula
end end
end end
def patch def prepare_patches
active_spec.add_legacy_patches(patches) active_spec.add_legacy_patches(patches)
return if patchlist.empty? return if patchlist.empty?
@ -732,9 +738,6 @@ class Formula
active_spec.patches.select(&:external?).each do |patch| active_spec.patches.select(&:external?).each do |patch|
patch.verify_download_integrity(patch.fetch) patch.verify_download_integrity(patch.fetch)
end end
ohai "Patching"
active_spec.patches.each(&:apply)
end end
def self.method_added method def self.method_added method