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

Uninstall with dependents #738

Open
gregsdennis opened this issue May 16, 2016 · 3 comments
Open

Uninstall with dependents #738

gregsdennis opened this issue May 16, 2016 · 3 comments

Comments

@gregsdennis
Copy link

gregsdennis commented May 16, 2016

I'd like to be able to uninstall a package and all of its dependents. For example, given an application and two plugins that are installed via separate packages:

  • App
  • Plugin1 (depends on App)
  • Plugin2 (depends on App)

I'd like to run a single command which uninstalls all three. Something like:

choco uninstall *App* --remove-dependents

This allows the user to uninstall an app and all of its plugins without having to remember which plugins are installed and running separate commands for each.

Currently, when I try to uninstall App, I get a message that states choco cannot continue because Plugin1 and Plugin2 depend on it. The new feature would override this message and uninstall all related packages.

NOTE This is the opposite of the --remove-depedencies switch which would remove any dependencies that also have no dependents.

choco uninstall Plugin1 --remove-dependencies would uninstall Plugin1 but would fail to uninstall App because Plugin2 is still installed. Afterward, running choco uninstall Plugin2 --remove-dependencies would uninstall both Plugin2 and App.

Reference:

image

UPDATE: As Chocolatey Gitter chat is now unavailable, I've added a screenshot of the Gitter chat.

@ferventcoder
Copy link
Member

This is something that would likely come after an upgrade to NuGet core v3. #508

@ferventcoder ferventcoder added this to the 0.9.11 milestone May 16, 2016
@gregsdennis
Copy link
Author

I would expect the sequencing of the uninstalls to be inverted according to the dependency tree. So with the example above, Plugin1 and Plugin2 would be uninstalled first, then App would be uninstalled last.

@ferventcoder
Copy link
Member

ferventcoder commented May 17, 2016

As a bit of a better explanation -

A package does not know of its dependents. So to determine something like this we have to graph the dependency tree for all installed packages and then inverse it. Then we'd walk through each package to determine if it has a dependency on App. And then look to see if each of those items have a dependency on each other to build an uninstall order.

NuGet was believed to handle all of these kind of things, but we keep finding weird edge cases. Some of them are corrected in NuGet v3, but until we get there we won't know if the team approached this scenario or if we will need to build it into NuGet.

HTH

Some of the following items will be corrected by #508:

@gep13 gep13 modified the milestones: 0.11.x, 0.10.x Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants