aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-04-22 15:04:21 +0100
committerGitHub2017-04-22 15:04:21 +0100
commit044bd974e435dabfebf5385cb5649f8ddb34de94 (patch)
tree6fc344dab7694974047ad4404b0bb28ce3e45ea9
parent206d6de845c9041bbbd4d955e56befb338295e96 (diff)
parent185b1787c61d6201f38e5fabad397cdaeb0a6762 (diff)
downloadbrew-044bd974e435dabfebf5385cb5649f8ddb34de94.tar.bz2
Merge pull request #2484 from MikeMcQuaid/unversion-formula-tap-match
audit: lookup unversioned formulae with Formulary.
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 07d2e71cb..f3bfb4c0c 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -336,7 +336,18 @@ class FormulaAuditor
problem "File should end with a newline" unless text.trailing_newline?
if formula.versioned_formula?
- unversioned_formula = Pathname.new formula.path.to_s.gsub(/@.*\.rb$/, ".rb")
+ unversioned_formula = begin
+ # build this ourselves as we want e.g. homebrew/core to be present
+ full_name = if formula.tap
+ "#{formula.tap}/#{formula.name}"
+ else
+ formula.name
+ end
+ Formulary.factory(full_name.gsub(/@.*$/, "")).path
+ rescue FormulaUnavailableError, TapFormulaAmbiguityError,
+ TapFormulaWithOldnameAmbiguityError
+ Pathname.new formula.path.to_s.gsub(/@.*\.rb$/, ".rb")
+ end
unless unversioned_formula.exist?
unversioned_name = unversioned_formula.basename(".rb")
problem "#{formula} is versioned but no #{unversioned_name} formula exists"