From 6a0086a0a7242e214bfdf8a1e0a79dc057e75eb0 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 2 Jun 2017 22:26:37 +0100 Subject: audit: fix false negative for formulae options. Handle the case where an if/unless is detected and then write off this line for option handling. --- Library/Homebrew/dev-cmd/audit.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'Library/Homebrew/dev-cmd') diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index bf7d2fc79..ccc14c3c6 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -959,6 +959,7 @@ class FormulaAuditor if line =~ /depends_on\s+['"](.+)['"]\s+=>\s+(.*)/ dep = $1 $2.split(" ").map do |o| + break if ["if", "unless"].include?(o) next unless o =~ /^\[?['"](.*)['"]/ problem "Dependency #{dep} should not use option #{$1}" end -- cgit v1.2.3