From a867e78f62c807b65ff4f80587d1a512252febf0 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 9 Nov 2020 15:23:35 +0000 Subject: [PATCH] uses_from_macos: fix force_homebrew_on_linux behaviour. Otherwise the dependencies are read incorrectly on Linux when we're trying to analyse Homebrew. --- Library/Homebrew/extend/os/mac/software_spec.rb | 2 ++ Library/Homebrew/extend/os/software_spec.rb | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/software_spec.rb b/Library/Homebrew/extend/os/mac/software_spec.rb index 221c0c4ca6..c15aa85ee7 100644 --- a/Library/Homebrew/extend/os/mac/software_spec.rb +++ b/Library/Homebrew/extend/os/mac/software_spec.rb @@ -1,6 +1,8 @@ # typed: false # frozen_string_literal: true +# The Library/Homebrew/extend/os/software_spec.rb conditional logic will need to be more nuanced +# if this file ever includes more than `uses_from_macos`. class SoftwareSpec undef uses_from_macos diff --git a/Library/Homebrew/extend/os/software_spec.rb b/Library/Homebrew/extend/os/software_spec.rb index 15da2d0e5a..9f130f7150 100644 --- a/Library/Homebrew/extend/os/software_spec.rb +++ b/Library/Homebrew/extend/os/software_spec.rb @@ -1,8 +1,9 @@ # typed: strict # frozen_string_literal: true -if OS.linux? - require "extend/os/linux/software_spec" -elsif OS.mac? +# This logic will need to be more nuanced if this file includes more than `uses_from_macos`. +if OS.mac? || Homebrew::EnvConfig.force_homebrew_on_linux? require "extend/os/mac/software_spec" +elsif OS.linux? + require "extend/os/linux/software_spec" end