* Shawn Walker ([email protected]) wrote:
> On Jun 17, 2009, at 12:40 PM, Glenn Lagasse wrote:
>> * Shawn Walker ([email protected]) wrote:
>>> On Jun 17, 2009, at 11:58 AM, Shawn Walker wrote:
>>>> On Jun 17, 2009, at 11:43 AM, Glenn Lagasse wrote:
>>>>> * Shawn Walker ([email protected]) wrote:
>>>>>> On Jun 17, 2009, at 9:36 AM, Alexander Eremin wrote:
>>>>>>> Whats about -r' flag for uninstall?
>>>>>>
>>>>>>
>>>>>> That only works for the dependencies.  So, for example:
>>>>>>
>>>>>> foo depends on bar
>>>>>>
>>>>>> ..then:
>>>>>>
>>>>>> pkg uninstall -r bar
>>>>>>
>>>>>> Would remove foo and bar.
>>>>>>
>>>>>> But, pkg uninstall -r foo, would only remove foo.
>>>>>
>>>>> Really?  That seems totally backwards to me based on all the other
>>>>> package managers I've used that could uninstall dependencies.
>>>>>
>>>>> 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.
>>>>
>>>>
>>>> I didn't implement it, so I can't tell you, but that's the way it is
>>>> documented to work, and the way it works:
>>>>
>>>>         In the case of uninstall, the -r option will recursively
>>>>         uninstall any packages which are dependent on the initial
>>>>         package.
>>>
>>>
>>> Before I forget, the other reason would be that, currently,  
>>> recursion in
>>> the other direction would be fairly useless.
>>>
>>> For example, a recursive removal of Apache would eventually end up
>>> removing all packages on your system.  How does one know where to  
>>> stop
>>> the recursion?
>>
>> And this is the disconnect I'm seeing.  The recursive removal is  
>> working
>> backwards to any other system I've ever seen or used.  It's operating
>> bottom-up instead of top-down.
>
> From what I've seen it works bottom-up in other systems, and in ours it 
> works top-down, but perhaps I'm upside-down right now ;)
>
> pkg uninstall -r Apache right now wouldn't do the same thing it would on 
> another system.
>
>> baz and tells me that I'm potentially breaking foo.  Going backwards  
>> (up
>> the chain) just doesn't make any sense to me.  Using the current
>
> As far as I'm aware, that's exactly how it works on other systems.

Which ones?  I know that's not the case in the apt/rpm world.  Gentoo's
portage has the concept of 'reverse dependencies'.  It's somewhat like a
'bottom up' approach though slightly different iirc.

> In other words, if I recursively remove foo, which depends on bar, foo  
> and bar get removed.

That's contradictory to what you initially said.

In a simple scenario, foo depends on bar.  When I install foo, I get bar
(if it isn't already installed).  Now, let's talk about uninstall
options:

1) pkg uninstall foo

This removes foo and only foo

2) pkg uninstall -r foo

This removes foo and bar (as long as bar isn't installed to satisfy a
dependency for some other package)

3) pkg uninstall bar or pkg uninstall -r bar

This removes bar and only bar and warns you that you're potentially
breaking foo

These scenarios show what I mean by 'top-down'.  Foo is the top and bar
is below since foo depends on bar.  You said that pkg uninstall -r bar
would remove foo.  That's backwards to me and what I mean when I say
'bottom-up'.

Cheers,

-- 
Glenn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to