Add autoremove, force-removal-of-dependent-packages for opkg.remove#47240
Add autoremove, force-removal-of-dependent-packages for opkg.remove#47240chotea wants to merge 1 commit intosaltstack:developfrom
Conversation
Add extra options for opkg remove: - --force-removal-of-dependent-packages - Remove package and all dependencies - --autoremove - Remove packages that were installed automatically to satisfy dependencies Signed-off-by: Cristian Hotea <cristian.hotea@ni.com>
isbm
left a comment
There was a problem hiding this comment.
...and adding a unit test would be a great wrap-up, alongside with the suggestions. 😉
| A list of packages to delete. Must be passed as a python list. The | ||
| ``name`` parameter will be ignored if this option is passed. | ||
|
|
||
| remove_dependent_packages |
There was a problem hiding this comment.
Maybe "remove_dependencies" would be better. What else than "packages" can be possibly removed in the context of "dependency"?
| cmd = ['opkg', 'remove'] | ||
| if kwargs.get('remove_dependent_packages', False): | ||
| cmd.append('--force-removal-of-dependent-packages') | ||
| if kwargs.get('auto_remove', False): |
There was a problem hiding this comment.
You actually not need to write default False to .get(...). In this case perfectly enough to:
if kwargs.get('auto_remove'):
cmd.append...It will either return None (no param) or any value. You can validate it though, if you want to force people pass True/False instead of 1/0 etc.
|
|
||
| .. versionadded:: Fluorine | ||
|
|
||
| auto_remove |
There was a problem hiding this comment.
auto_remove_deps perhaps?
|
@chotea Have you had a chance to review the feedback on this PR? |
|
@chotea Any chance you were able to come back to this one? |
|
Yes. I implemented the feedback and wrote some tests. I wasn't able to update this PR because I was shifted to something with more priority. I will come back ASAP. |
|
@chotea Awesome! We look forward to seeing the updates. :) |
|
Since we haven't heard back here for a while, I'm closing this PR. We'd still love to have this change, so when you're ready to implement the feedback, let us know and we will gladly open this up again. If it's easier for you to just submit a new PR, that's fine too. Thank you! |
|
@rallytime Can you please reopen this PR? I have implemented the feedback and wrote unit tests for opkg module. |
|
@chotea Hrm, it appears that the |
What does this PR do?
This PR adds support for opkg remove in terms of giving the possibility of specifying two extra parameters: force-removal-of-dependent-packages, autoremove
Previous Behavior
The implementation was always calling opkg remove without any extra parameters.
New Behavior
Now we check these 2 force-options in kwargs and append them to the command if necessary:
satisfy dependencies
Tests written?
No
Commits signed with GPG?
No