Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Headless logic issue for macOS Catalina #33

Closed
coatless opened this issue Dec 30, 2019 · 0 comments
Closed

Headless logic issue for macOS Catalina #33

coatless opened this issue Dec 30, 2019 · 0 comments

Comments

@coatless
Copy link
Collaborator

Poking softwareupdate on macOS 10.14 gives:

* Command Line Tools (macOS Mojave version 10.14) for Xcode-10.3
        #        Command Line Tools (macOS Mojave version 10.14) for Xcode (10.3), 199140K [recommended]

With macOS Catalina 10.15, the output changed to:

* Label: Command Line Tools for Xcode-11.3
	Title: Command Line Tools for Xcode, Version: 11.3, Size: 224878K, Recommended: YES, 

We initially attempted to fix this by splitting on OS:

https://github.com/rmacoslib/r-macos-rtools/blob/8816c5c0a37f9db3177db1406d07b38e5f8083da/scripts/postinstall#L68-L83

I think the issue here is we're using head instead of tail.


Elsewhere around the macOS community, homebrew approaches the headless install with:

  clt_label_command = "/usr/sbin/softwareupdate -l | " \
                      "grep -B 1 -E 'Command Line Tools' | " \
                      "awk -F'*' '/^ *\\*/ {print $2}' | " \
                      "sed -e 's/^ *Label: //' -e 's/^ *//' | " \
                      "sort -V | " \
                      "tail -n1"
  clt_label = `#{clt_label_command}`.chomp

This is limited to macOS 10.13 and above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant