aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2012-05-07 17:44:57 -0500
committerJack Nagel2012-05-07 17:44:57 -0500
commit2d68a3f319421349a9acc3dc9bc34568a6eccd7a (patch)
tree6e60ff24cd47a4c9afd0a5641469244765c0f3bd
parentff12e45434a7535fdf4403d8787156a5b0df72e7 (diff)
downloadhomebrew-2d68a3f319421349a9acc3dc9bc34568a6eccd7a.tar.bz2
audit: check MacPorts patch URLs
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-rwxr-xr-xLibrary/Homebrew/cmd/audit.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 985cce0b4..8157de70f 100755
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -120,11 +120,6 @@ def audit_formula_text name, text
problems << " * Use 'ARGV.include?' instead of 'ARGV.flag?'"
end
- # MacPorts patches should specify a revision, not trunk
- if text =~ %r[macports/trunk]
- problems << " * MacPorts patches should specify a revision instead of trunk"
- end
-
# Avoid hard-coding compilers
if text =~ %r[(system|ENV\[.+\]\s?=)\s?['"](/usr/bin/)?(gcc|llvm-gcc|clang)['" ]]
problems << " * Use \"\#{ENV.cc}\" instead of hard-coding \"#{$3}\""
@@ -211,9 +206,13 @@ def audit_formula_patches f
patches = Patches.new(f.patches)
patches.each do |p|
next unless p.external?
- if p.url =~ %r[raw\.github\.com]
+ case p.url
+ when %r[raw\.github\.com], %r[gist\.github\.com/raw]
problems << " * Using raw GitHub URLs is not recommended:"
- problems << " * #{p.url}"
+ problems << " #{p.url}"
+ when %r[macports/trunk]
+ problems << " * MacPorts patches should specify a revision instead of trunk:"
+ problems << " #{p.url}"
end
end
return problems