aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 07d2e71cb..95d54caee 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"
@@ -1417,8 +1428,8 @@ class ResourceAuditor
def audit_urls
# Check GNU urls; doesn't apply to mirrors
- if url =~ %r{^(?:https?|ftp)://(?!alpha).+/gnu/}
- problem "Please use \"https://ftpmirror.gnu.org\" instead of #{url}."
+ if url =~ %r{^(?:https?|ftp)://ftpmirror.gnu.org/(.*)}
+ problem "Please use \"https://ftp.gnu.org/gnu/#{$1}\" instead of #{url}."
end
if mirrors.include?(url)