diff options
| author | Jack Nagel | 2013-07-23 11:21:37 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-07-23 11:22:15 -0500 |
| commit | a82c997bb96ddb75e2a4260cc1cad44f729579a8 (patch) | |
| tree | aaf09961a1edfa57ede2a5e5e97b8ea48f0704de /Library | |
| parent | 9d884d68433b5d7a9d744e7a9f24719c781d72bd (diff) | |
| download | homebrew-a82c997bb96ddb75e2a4260cc1cad44f729579a8.tar.bz2 | |
audit: fix dep name escaping
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index a49d01e06..3f3e6f56c 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -511,12 +511,14 @@ class FormulaAuditor end def audit_conditional_dep(dep, condition, line) - dep = Regexp.escape(dep) + quoted_dep = quote_dep(dep) + dep = Regexp.escape(dep.to_s) + case condition when /if build\.include\? ['"]with-#{dep}['"]$/, /if build\.with\? ['"]#{dep}['"]$/ - problem %{Replace #{line.inspect} with "depends_on #{quote_dep(dep)} => :optional"} + problem %{Replace #{line.inspect} with "depends_on #{quoted_dep} => :optional"} when /unless build\.include\? ['"]without-#{dep}['"]$/, /unless build\.without\? ['"]#{dep}['"]$/ - problem %{Replace #{line.inspect} with "depends_on #{quote_dep(dep)} => :recommended"} + problem %{Replace #{line.inspect} with "depends_on #{quoted_dep} => :recommended"} end end |
