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

Formulae that require user intervention cause Brewlet to update forever #31

Open
andypiper opened this issue Oct 20, 2022 · 9 comments
Open
Assignees

Comments

@andypiper
Copy link

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
Copy link
Author

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

@andypiper
Copy link
Author

andypiper commented Oct 22, 2022

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
Copy link
Author

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?

@zkokaja
Copy link
Owner

zkokaja commented Oct 31, 2022

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 zkokaja self-assigned this Oct 31, 2022
@zkokaja
Copy link
Owner

zkokaja commented Nov 6, 2022

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: 0bfe3ad

@andypiper
Copy link
Author

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.

@zkokaja
Copy link
Owner

zkokaja commented Nov 12, 2022

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

@zkokaja
Copy link
Owner

zkokaja commented Nov 20, 2022

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: c90f1da

@andypiper
Copy link
Author

Yep - working great for me now. Thank you!

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

No branches or pull requests

2 participants