Brewlet icon indicating copy to clipboard operation
Brewlet copied to clipboard

Formulae that require user intervention cause Brewlet to update forever

Open andypiper opened this issue 3 years ago • 9 comments

Some Homebrew formulae (casks) require CLI intervention when upgrading (for example, I am aware of dotnet-sdk, virtualbox and vagrant). Their installers require the administrator password in order to uninstall/reinstall components.

When these are installed on a system, Brewlet will still run an update, but will endlessly show that it is updating because these prompts are never shown or responded to.

Not sure what the best option might be for handling these.

andypiper avatar Oct 20 '22 19:10 andypiper

virtualbox does not always require admin password; powershell is another cask install that does.

andypiper avatar Oct 21 '22 11:10 andypiper

Found another one (1password-cli)

I think running brew upgrade --formulae would mean that only the non-casks would be upgraded, so this might be a workaround here.

andypiper avatar Oct 22 '22 09:10 andypiper

It's correct that brew upgrade --formulae only upgrades the non-Casks. So, given that more than a few Casks do require intervention and an admin / user password to be entered, on option here might be:

  • change the operation of "Upgrade" to run brew upgrade --formulae
    • optionally, afterwards, prompt the user to upgrade casks from the CLI (if there are still packages waiting to be upgraded)

Thoughts?

andypiper avatar Oct 28 '22 17:10 andypiper

Thanks so much for bringing this up and offering solutions. I aim to dig into this sometime within this week. I wonder if there is a flag in a formula that indicates whether super user permission are required—I'll look for it. I think restricting upgrades to formulae is a fine solution otherwise, especially since many casks update themselves outside of brew anyways.

zkokaja avatar Oct 31 '22 13:10 zkokaja

Didn't find any flags in info --json=v2 that reliably indicate whether an upgrade requires interaction. I decided to add a preference that you can toggle that switches between brew upgrade and brew upgrade --formula. Feel free to test it and let me know how it works. I'll also test it in the meantime and will merge when it's ready. New branch created for this change: https://github.com/zkokaja/Brewlet/commit/0bfe3ad5a13d81101d408b8963c52cad0ddb0ad2

zkokaja avatar Nov 06 '22 15:11 zkokaja

Somehow I think it is losing the actual brew command when this is run with "do not upgrade casks" set - I get an error in the log saying Error: Unknown command: upgrade --formula (note how it is missing the path to the brew command itself.

andypiper avatar Nov 10 '22 16:11 andypiper

Ah that's strange, I'll take a look! Thank you

zkokaja avatar Nov 12 '22 04:11 zkokaja

Added a fix and tested that it works for formulae! Now waiting for one my casks to be outdated and I'll test whether it ignores it as it should. New commit: c90f1da21a99f333e6ad845e4e6eaa8f4142f13e

zkokaja avatar Nov 20 '22 20:11 zkokaja

Yep - working great for me now. Thank you!

andypiper avatar Nov 21 '22 12:11 andypiper