Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/mac/xcode: do not recommend softwareupdate CLI #14061

Merged
merged 1 commit into from Oct 31, 2022

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Oct 30, 2022

With macOS Ventura, Apple have changed this tool to force-upgrade macOS Monterey installs to macOS Ventura, without any ability to Ctrl+C cancel once it starts downloading. This behaviour cannot be opted out of, unless you manually check the list and install updates individually.

This is an extremely invasive thing to recommend for just updating the CLT, so we should recommend users to use System Preferences instead.

@Bo98 Bo98 added the critical Critical change which should be shipped as soon as possible. label Oct 30, 2022
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

@Bo98 Bo98 merged commit 4e48a9e into Homebrew:master Oct 31, 2022
@Bo98 Bo98 deleted the softwareupdate branch October 31, 2022 01:33
@cattyhouse
Copy link

it is possible to remove --all and use --install item1 item2 ... instead, --list to get the name of item

@Bo98
Copy link
Member Author

Bo98 commented Nov 1, 2022

Something like

clt_label=$(softwareupdate --list | grep -B 1 -E 'Command Line Tools' | awk -F'*' '/^ *\\*/ {print \$2}' | sed -e 's/^ *Label: //' -e 's/^ *//' | sort -V | tail -n1)
if [[ -n "${clt_label}" ]]; then softwareupdate --install "${clt_label}"; fi

I guess? Bit complex to be putting as an instruction though.

@cattyhouse
Copy link

cattyhouse commented Nov 1, 2022

@Bo98 it has a fixed name for Command Line Tools, i think. Just make it hard-coded, if the name changes in the future, it does not hurt.

@Bo98
Copy link
Member Author

Bo98 commented Nov 1, 2022

Doesn't work for me:

$ softwareupdate --install "Command Line Tools"
Software Update Tool

Finding available software
Command Line Tools: No such update
No updates are available.

It appears in --list as:

* Label: Command Line Tools for Xcode-14.1
	Title: Command Line Tools for Xcode, Version: 14.1, Size: 687455KiB, Recommended: YES

Only softwareupdate --install "Command Line Tools for Xcode-14.1" works

@cattyhouse
Copy link

that sucks. what about --install "*Command Line Tools*", pure guess

@Bo98
Copy link
Member Author

Bo98 commented Nov 1, 2022

$ softwareupdate --install "*Command Line Tools*"        
Software Update Tool

Finding available software
*Command Line Tools*: No such update
No updates are available.

@cattyhouse
Copy link

cattyhouse commented Nov 1, 2022

then grep '* Label: Command Line Tools' makes it simpler to parse.

@Bo98
Copy link
Member Author

Bo98 commented Nov 1, 2022

Older macOS versions don't have Label: but yeah can definitely be simpler if you don't need anything that works on all versions.

@github-actions github-actions bot added the outdated PR was locked due to age label Dec 2, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants