aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2014-07-11 12:46:14 -0500
committerJack Nagel2014-07-11 12:46:41 -0500
commit9c591db61ce0a4fb4629fcef580d92af04635584 (patch)
tree35ab6994919c3a1e32a5f225973325f3769bd923 /Library/Homebrew/cmd
parentc003ae33c10cbaa7c1b293fb6d2cd57814f4250a (diff)
downloadhomebrew-9c591db61ce0a4fb4629fcef580d92af04635584.tar.bz2
audit: warn when using old-style patches
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/audit.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index ad4132726..085db0710 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -298,8 +298,11 @@ class FormulaAuditor
end
def audit_patches
- patches = Patch.normalize_legacy_patches(f.patches)
- patches.grep(LegacyPatch).each { |p| audit_patch(p) }
+ legacy_patches = Patch.normalize_legacy_patches(f.patches).grep(LegacyPatch)
+ if legacy_patches.any?
+ problem "Use the patch DSL instead of defining a 'patches' method"
+ legacy_patches.each { |p| audit_patch(p) }
+ end
end
def audit_patch(patch)