-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Fix it so upgrade from previous versions actually works #19354
base: master
Are you sure you want to change the base?
Conversation
Unless you delete these subdirectories before installing, Brew will still report the old version as being installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Need to think of a different approach here.
echo "Deleting ${brew_dir}/${subdir} for clean upgrade..." | ||
/bin/rm -rf "${brew_dir:?}"/"${subdir}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't do this unconditionally because it'll mean that anyone with e.g. contributions to Homebrew they haven't pushed yet will be destroyed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't do this unconditionally because it'll mean that anyone with e.g. contributions to Homebrew they haven't pushed yet will be destroyed.
What's the minimum we'd have to destroy to get brew to actually report back the new version if you install a newer package?
I don't see how the code in this PR would run at all, as Also, if the intent is to update Homebrew when the installer .pkg is run on an existing installation, then I'd think simply running |
👍🏻 |
Good point, but if I move the
That also kind of defeats the whole point of a package, which is to deliver a payload. If the whole thing can be done by script, maybe the "package" itself should be a payload-free package and just script the installation or update of brew. But if that's the PR you'll accept, I'd rather have it actually update brew than be broken (which it currently is). I'm not a fan of unimplemented perfect being the enemy of implemented good. Let me know what you'll accept. If the only way to get this PR accepted is to do a |
With a
This is the output on Sequoia arm64 when running the 4.4.22 installer over a 4.4.21 installation:
When unmodified, this part of the script:
So this series of commands may need a rework to ensure the latest tag is checked out by the end. |
Unless you delete these subdirectories before installing, Brew will still report the old version as being installed.
Fixes this issue: Mac installer packages do not upgrade Homebrew from older versions