diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index d558ce4494..70526559ee 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -118,6 +118,31 @@ module Homebrew @aliases ||= Formula.aliases + Formula.tap_aliases end + SYNCED_VERSIONS_FORMULAE_FILE = "synced_versions_formulae.json" + + def audit_synced_versions_formulae + synced_versions_formulae_file = formula.tap.path/SYNCED_VERSIONS_FORMULAE_FILE + return unless synced_versions_formulae_file.file? + + name = formula.name + version = formula.version + + synced_versions_formulae = JSON.parse(synced_versions_formulae_file.read) + synced_versions_formulae.each do |synced_version_formulae| + next unless synced_version_formulae.include? name + + synced_version_formulae.each do |synced_formula| + next if synced_formula == name + + if (synced_version = Formulary.factory(synced_formula).version) != version + problem "Version of `#{synced_formula}` (#{synced_version}) should match version of `#{name}` (#{version})" + end + end + + break + end + end + def audit_formula_name name = formula.name