From 1e68ce5a3f632b10a8e3a74816e96744159f7252 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Wed, 23 Dec 2020 14:31:54 +0000 Subject: [PATCH 1/2] formula_auditor: do not allow depending on aliases --- Library/Homebrew/formula_auditor.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index c5d5c97408..9a42a7d795 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -235,8 +235,7 @@ module Homebrew problem "Dependency '#{dep.name}' was renamed; use new name '#{dep_f.name}'." end - if self.class.aliases.include?(dep.name) && - dep_f.core_formula? && !dep_f.versioned_formula? + if self.class.aliases.include?(dep.name) && dep_f.core_formula? problem "Dependency '#{dep.name}' from homebrew/core is an alias; " \ "use the canonical name '#{dep.to_formula.full_name}'." end From 2aaa83d3988944de4057289788f5e623ba90e6bd Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 24 Dec 2020 13:59:59 +0000 Subject: [PATCH 2/2] formula_auditor: check for aliases only core formulae --- Library/Homebrew/formula_auditor.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 9a42a7d795..afcfa525f7 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -235,11 +235,6 @@ module Homebrew problem "Dependency '#{dep.name}' was renamed; use new name '#{dep_f.name}'." end - if self.class.aliases.include?(dep.name) && dep_f.core_formula? - problem "Dependency '#{dep.name}' from homebrew/core is an alias; " \ - "use the canonical name '#{dep.to_formula.full_name}'." - end - if @core_tap && @new_formula && dep_f.keg_only? && @@ -272,6 +267,10 @@ module Homebrew next unless @core_tap + if self.class.aliases.include?(dep.name) + problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'." + end + if dep.tags.include?(:recommended) || dep.tags.include?(:optional) problem "Formulae in homebrew/core should not have optional or recommended dependencies" end