From 82da3b43cc3113fda36348824239a58d4f399e91 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Sat, 2 Mar 2019 12:59:26 -0800 Subject: [PATCH] audit: Keg-only :provided_by_macos dep okay on Linux Disable this brew audit error on Linux: * Dependency 'zlib' may be unnecessary as it is provided by macOS; try to build this formula without it. --- Library/Homebrew/dev-cmd/audit.rb | 8 ++++---- Library/Homebrew/test/dev-cmd/audit_spec.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 0efd28627f..e76bd1e97d 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -386,10 +386,10 @@ module Homebrew problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.full_name}'." end - if @new_formula && dep_f.keg_only_reason && - !["openssl", "apr", "apr-util"].include?(dep.name) && - !["openblas"].include?(dep.name) && - dep_f.keg_only_reason.reason == :provided_by_macos + if @new_formula && + dep_f.keg_only_reason&.reason == :provided_by_macos && + dep_f.keg_only_reason.valid? && + !["apr", "apr-util", "openblas", "openssl"].include?(dep.name) new_formula_problem( "Dependency '#{dep.name}' may be unnecessary as it is provided " \ "by macOS; try to build this formula without it.", diff --git a/Library/Homebrew/test/dev-cmd/audit_spec.rb b/Library/Homebrew/test/dev-cmd/audit_spec.rb index 548a6c4316..daf5cf6d0e 100644 --- a/Library/Homebrew/test/dev-cmd/audit_spec.rb +++ b/Library/Homebrew/test/dev-cmd/audit_spec.rb @@ -252,7 +252,7 @@ module Homebrew its(:problems) { are_expected.to be_empty } end - describe "which is not whitelisted" do + describe "which is not whitelisted", :needs_macos do subject { fa } let(:fa) do