aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2014-03-13 19:51:23 -0500
committerJack Nagel2014-03-13 21:35:41 -0500
commitda5d6d28423914625cf6e896b65082848bdd79df (patch)
treee5222242e8237ef15de824e5dfeacf8ab7194b6b /Library/Homebrew/cmd
parentbf6c6b233eb4b9c884b39e4adee20fb88c919bfb (diff)
downloadhomebrew-da5d6d28423914625cf6e896b65082848bdd79df.tar.bz2
Teach audit about new patches implementation
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/audit.rb21
1 files changed, 13 insertions, 8 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 8b8489acc..624e223e7 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -292,19 +292,24 @@ class FormulaAuditor
"#{name} resource #{resource.name.inspect}: #{problem}"
}
end
+
+ spec.patches.select(&:external?).each { |p| audit_patch(p) }
end
end
def audit_patches
- Patches.new(f.patches).select(&:external?).each do |p|
- case p.url
- when %r[raw\.github\.com], %r[gist\.github\.com/raw], %r[gist\.github\.com/.+/raw$]
- unless p.url =~ /[a-fA-F0-9]{40}/
- problem "GitHub/Gist patches should specify a revision:\n#{p.url}"
- end
- when %r[macports/trunk]
- problem "MacPorts patches should specify a revision instead of trunk:\n#{p.url}"
+ patches = Patch.normalize_legacy_patches(f.patches)
+ patches.grep(LegacyPatch).each { |p| audit_patch(p) }
+ end
+
+ def audit_patch(patch)
+ case patch.url
+ when %r[raw\.github\.com], %r[gist\.github\.com/raw], %r[gist\.github\.com/.+/raw$]
+ unless patch.url =~ /[a-fA-F0-9]{40}/
+ problem "GitHub/Gist patches should specify a revision:\n#{patch.url}"
end
+ when %r[macports/trunk]
+ problem "MacPorts patches should specify a revision instead of trunk:\n#{patch.url}"
end
end