aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMartin Afanasjew2016-01-27 00:54:46 +0100
committerMartin Afanasjew2016-01-28 12:53:17 +0100
commit9cab3011856d0d4308054887f7459dc91e444ed3 (patch)
tree8a6ea9a84863359eb301714b8f210954991e62b0 /Library
parent47d1c2c4e6a3136eec2733d1e305aab968953c1a (diff)
downloadbrew-9cab3011856d0d4308054887f7459dc91e444ed3.tar.bz2
diagnostic: improve check for 'gnubin' in PATH
Both `coreutils` and `findutils` suggest to add `#{opt_libexec}/gnubin` to PATH in their caveats to get the non-prefixed binaries from those formulae. Check this in addition to the version-specific directory that is less likely to be in PATH. Closes Homebrew/homebrew#48207. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/diagnostic.rb24
1 files changed, 16 insertions, 8 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index 1c74d9a0c..c2f11b5cf 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -1198,20 +1198,28 @@ module Homebrew
end
def check_for_non_prefixed_coreutils
- gnubin = "#{Formulary.factory("coreutils").prefix}/libexec/gnubin"
- if paths.include? gnubin then <<-EOS.undent
+ coreutils = Formula["coreutils"]
+ return unless coreutils.any_version_installed?
+
+ gnubin = %W[#{coreutils.opt_libexec}/gnubin #{coreutils.libexec}/gnubin]
+ return if (paths & gnubin).empty?
+
+ <<-EOS.undent
Putting non-prefixed coreutils in your path can cause gmp builds to fail.
- EOS
- end
+ EOS
end
def check_for_non_prefixed_findutils
- gnubin = "#{Formulary.factory("findutils").prefix}/libexec/gnubin"
+ findutils = Formula["findutils"]
+ return unless findutils.any_version_installed?
+
+ gnubin = %W[#{findutils.opt_libexec}/gnubin #{findutils.libexec}/gnubin]
default_names = Tab.for_name("findutils").with? "default-names"
- if paths.include?(gnubin) || default_names then <<-EOS.undent
+ return if !default_names && (paths & gnubin).empty?
+
+ <<-EOS.undent
Putting non-prefixed findutils in your path can cause python builds to fail.
- EOS
- end
+ EOS
end
def check_for_pydistutils_cfg_in_home