On Wed, Jun 17, 2009 at 09:43:37AM -0700, Glenn Lagasse wrote:
> If I install foo and bar isn't installed then both foo and bar get
> installed. If I uninstall foo (using -r) and bar isn't a dependency for
> anything else I'd expect bar to get uninstalled as well. If both foo
> and bar are installed and I uninstall bar I'd expect a warning saying
> that bar is a dependency of foo.
>
> Why does it work the way you describe? I'm not really seeing the logic.
Think of the dependency tree. From any given package, you can uninstall
recursively in either direction. A simplified example:
A B
\ /
C
/ \
D E
That is, A and B are leaf packages, both depending on C, and C depends on
both D and E.
If you recursively remove from C, by far the simplest thing to do is to
remove all the things that depend on it (and so on until you hit leaf
packages). But it's not just simple, it's also a useful thing to do: "I
want to get package C off my system, so do what it takes to make that
happen."
If you recurse in the other direction, though (assume for the moment that A
and B are no longer installed, so that C is a leaf package), then after you
remove C, you have a decision to make -- now that D and E are both leaf
packages, both could be removed as far as the package graph is concerned,
since nothing depends on them.
But what if the user had explicitly asked to place E on the system -- that
is, they'd done "pkg install E" followed by "pkg install C" at some later
point. It would be rude to remove E, as they might not know that a
recursive removal of C would do so, and they haven't expressed an explicit
interest in having E removed. This is "user intent".
Stephen and I talked about this scenario a long long time ago, and although
he was hesitant to allow for recursive removal in this direction at all, he
conceded that with user intent, it would make sense to him. But intent
hasn't been implemented, and so we don't have this removal functionality,
either.
Danek
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss