aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-06-23 11:20:47 -0700
committerAdam Vandenberg2010-06-23 11:20:47 -0700
commitc51d74a2e36b9ca339a2b4ebd83c1c000e6f058b (patch)
treef867640cf182e9e9e394d73abb9dca9d06114ff0 /Library
parent8fb8c330a68d186b1bfd8a5cb3f46cb988f1d466 (diff)
downloadbrew-c51d74a2e36b9ca339a2b4ebd83c1c000e6f058b.tar.bz2
External command "brew audit <formula>"
"brew audit <formula>" will check the given formula for a couple of known issues: * Is an explicit mirror being used for a SourceForge download path? * Is the commented-out cmake support present?
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-audit.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/Library/Contributions/examples/brew-audit.rb b/Library/Contributions/examples/brew-audit.rb
new file mode 100755
index 000000000..2c5d3a80d
--- /dev/null
+++ b/Library/Contributions/examples/brew-audit.rb
@@ -0,0 +1,31 @@
+require 'formula'
+require 'utils'
+
+def ff
+ if ARGV.named.empty?
+ stuff = []
+ Formulary.read_all do |name,k|
+ stuff << Formula.factory(name)
+ end
+ return stuff
+ else
+ return ARGV.formulae
+ end
+end
+
+ff.each do |f|
+ problems = []
+ unless `grep "# depends_on 'cmake'" "#{f.path}"`.strip.empty?
+ problems << " * Commented cmake support still in #{f.name}"
+ end
+
+ unless `grep "\?use_mirror=" "#{f.path}"`.strip.empty?
+ problems << " * Remove 'use_mirror' from url for #{f.name}"
+ end
+
+ unless problems.empty?
+ puts "#{f.name}:"
+ puts problems * '\n'
+ puts
+ end
+end