Skip to content

Commit

Permalink
audit: check build-time deps programmatically
Browse files Browse the repository at this point in the history
  • Loading branch information
jacknagel committed Apr 7, 2013
1 parent 73ca6b2 commit 7e04a9d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Library/Homebrew/cmd/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ def audit_deps
end

case dep.name
when *BUILD_TIME_DEPS
# Build deps should be tagged
problem <<-EOS.undent unless dep.tags.any? || f.name =~ /automake/ && dep.name == 'autoconf'
#{dep} dependency should be "depends_on '#{dep}' => :build"
EOS
when "git", "python", "ruby", "emacs", "mysql", "mercurial"
problem <<-EOS.undent
Don't use #{dep} as a dependency. We allow non-Homebrew
Expand Down Expand Up @@ -315,12 +320,6 @@ def audit_text
problem "Commented cmake call found"
end

# build tools should be flagged properly
# but don't complain about automake; it needs autoconf at runtime
if text =~ /depends_on ['"](#{BUILD_TIME_DEPS*'|'})['"]$/
problem "#{$1} dependency should be \"depends_on '#{$1}' => :build\""
end unless f.name =~ /automake/

# FileUtils is included in Formula
if text =~ /FileUtils\.(\w+)/
problem "Don't need 'FileUtils.' before #{$1}."
Expand Down

0 comments on commit 7e04a9d

Please sign in to comment.