-
Notifications
You must be signed in to change notification settings - Fork 1.7k
updated deprecated homebrew cask commands #1481
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
updated deprecated homebrew cask commands #1481
Conversation
Which versions support the new commands, and which ones do not? Maybe the code needs to be able to handle both cases. Also, you need a changelog fragment. |
It looks like Homebrew has removed the old syntax:
|
Co-authored-by: Felix Fontein <[email protected]>
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.
Besides this, looks good. Cannot verify that it works since I'm not using Homebrew though.
e0d51da
to
e8ca4e1
Compare
@dsnyder0pc can you test again? |
Previous fix didn't do the trick. I'm going to wait for this to be fixed upstream. ansible-collections/community.general#1481
I used this command to use the code from this PR for the moment: ansible-galaxy collection install --force git+https://github.com/jaanhio/community.general.git,update-deprecated-homebrew-cask-commands |
* updated deprecated homebrew cask commands * added methods for brew version deprecation check * added comments and changelog fragment * added unit test for version comparison * switch to use disutils LooseVersion for version comparison * updated changelog message and minor refactor for building brew command based on version * added caching logic for retrieval of brew version and updated PR changelog yaml * Update changelogs/fragments/1481-deprecated-brew-cask-command.yaml Co-authored-by: Felix Fontein <[email protected]> * Update plugins/modules/packaging/os/homebrew_cask.py * Update plugins/modules/packaging/os/homebrew_cask.py Co-authored-by: Felix Fontein <[email protected]> * Update plugins/modules/packaging/os/homebrew_cask.py Co-authored-by: Felix Fontein <[email protected]> * switch to use subprocess.check_output instead of subprocess.run * replace subprocess with run_command * removed unused subprocess import * removed error handling logic to depend on check_rc=True instead Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit ed81317)
@jaanhio thanks for fixing this! |
Thanks @jaanhio and the reviewers for this new year gift! 🙂 |
* updated deprecated homebrew cask commands * added methods for brew version deprecation check * added comments and changelog fragment * added unit test for version comparison * switch to use disutils LooseVersion for version comparison * updated changelog message and minor refactor for building brew command based on version * added caching logic for retrieval of brew version and updated PR changelog yaml * Update changelogs/fragments/1481-deprecated-brew-cask-command.yaml Co-authored-by: Felix Fontein <[email protected]> * Update plugins/modules/packaging/os/homebrew_cask.py * Update plugins/modules/packaging/os/homebrew_cask.py Co-authored-by: Felix Fontein <[email protected]> * Update plugins/modules/packaging/os/homebrew_cask.py Co-authored-by: Felix Fontein <[email protected]> * switch to use subprocess.check_output instead of subprocess.run * replace subprocess with run_command * removed unused subprocess import * removed error handling logic to depend on check_rc=True instead Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit ed81317) Co-authored-by: Jianhao Tan <[email protected]>
Backport is merged and will be in the release on January 4th, which in turn will be included in the next Ansible 2.10.x release (planned for January 5th). If someone wants to backport this to ansible/ansible's stable-2.9 branch, it can also appear in the next 2.9.x release. |
thanks all for the guidance and advice provided! happy new year all! |
FYI the version detection fails fails when brew updates itself before running the command.
|
SUMMARY
Replaced deprecated
brew cask
commands with--cask
(e.gbrew install --cask <app>
)See https://brew.sh/2020/12/01/homebrew-2.6.0/ & Homebrew/brew#8899
Fixes #1524.
ISSUE TYPE
COMPONENT NAME
plugins/modules/homebrew_cask.py
ADDITIONAL INFORMATION