Skip to content
Snippets Groups Projects
Commit 02f48dd7 authored by Jack Nagel's avatar Jack Nagel
Browse files

MacOS: avoid checking clt_version in clt_installed?


Checking "not clt_version.empty?" is unnecessary if we are also checking
that dev_tools_path is /usr/bin.

Signed-off-by: default avatarJack Nagel <jacknagel@gmail.com>
parent 0b1d759c
No related branches found
No related tags found
No related merge requests found
......@@ -28,14 +28,11 @@ module MacOS extend self
end
end
# This is true ift he standard UNIX tools are present under /usr. For
# Xcode < 4.3, this is the standard location. Otherwise, it means that
# the user has installed the "Command Line Tools for Xcode" package.
def clt_installed?
# If the command line tools are installed, most unix standard
# tools, libs and headers are in /usr.
# Returns true, also for older Xcode/OSX versions that had everything in /usr
# Beginning with Xcode 4.3, the dev tools are no longer installed
# in /usr and SDKs no longer in /Developer by default.
# But Apple provides an optional "Command Line Tools for Xcode" package.
not clt_version.empty? or dev_tools_path == Pathname.new("/usr/bin")
dev_tools_path == Pathname.new("/usr/bin")
end
def clt_version
......@@ -53,10 +50,7 @@ module MacOS extend self
from_xcode =~ /version: (.*)$/
$1
else
# We return "" instead of nil because we want clt_installed? to be true on older Macs.
# So clt_version.empty? does not mean there are no unix tools in /usr, it just means
# that the "Command Line Tools for Xcode" package is not installed
"" # No CLT or recipe available to pkgutil.
nil
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment