aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-12-26 17:44:44 -0500
committerJack Nagel2014-12-26 17:44:44 -0500
commit2ff86eb4175db91a918379736c414c122a9a1236 (patch)
tree5b9f86594de55545db913394b3093d21a38a8e9a
parent051658db6552882a4306b9a4240137b9def8db17 (diff)
downloadbrew-2ff86eb4175db91a918379736c414c122a9a1236.tar.bz2
Decouple applying patches from staging the source
-rw-r--r--Library/Homebrew/build.rb2
-rw-r--r--Library/Homebrew/formula.rb13
2 files changed, 10 insertions, 5 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index 0a78f2326..65367db95 100644
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -115,6 +115,8 @@ class Build
end
formula.brew do
+ formula.patch
+
if ARGV.git?
system "git", "init"
system "git", "add", "-A"
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 55faf8778..cc25c2482 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -367,12 +367,18 @@ class Formula
false
end
+ def patch
+ ohai "Patching"
+ active_spec.patches.each(&:apply)
+ end
+
# yields self with current working directory set to the uncompressed tarball
# @private
def brew
stage do
+ prepare_patches
+
begin
- patch
yield self
ensure
cp Dir["config.log", "CMakeCache.txt"], HOMEBREW_LOGS+name
@@ -723,7 +729,7 @@ class Formula
end
end
- def patch
+ def prepare_patches
active_spec.add_legacy_patches(patches)
return if patchlist.empty?
@@ -732,9 +738,6 @@ class Formula
active_spec.patches.select(&:external?).each do |patch|
patch.verify_download_integrity(patch.fetch)
end
-
- ohai "Patching"
- active_spec.patches.each(&:apply)
end
def self.method_added method