aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/software_spec.rb
diff options
context:
space:
mode:
authorXu Cheng2016-03-22 15:19:33 +0800
committerXu Cheng2016-03-22 19:44:16 +0800
commit478f18a8f57705a0c16b27b257f022f91c0b630b (patch)
tree1a06651ca0def50aee66ef09a96075eac3586497 /Library/Homebrew/software_spec.rb
parentca5b7440c69a37b5f03f7b8949df27d8824d307d (diff)
downloadbrew-478f18a8f57705a0c16b27b257f022f91c0b630b.tar.bz2
software_spec: add ExternalPatch to dependency_collector
Since we support `apply` DSL in the `patch` block, external patch files could be any compressed archive. As result, it could introduce dependencies like xz, 7z etc. Add the resource of ExternalPatch to dependency_collector, so we could track these resource dependencies. Closes Homebrew/homebrew#50318. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/software_spec.rb')
-rw-r--r--Library/Homebrew/software_spec.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index 8f5f7c178..0720fab3d 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -165,7 +165,9 @@ class SoftwareSpec
end
def patch(strip = :p1, src = nil, &block)
- patches << Patch.create(strip, src, &block)
+ p = Patch.create(strip, src, &block)
+ dependency_collector.add(p.resource) if p.is_a? ExternalPatch
+ patches << p
end
def fails_with(compiler, &block)