setup: uninstalling an orphaned package

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

setup: uninstalling an orphaned package

Ken Brown-6
In ChooserPage::applyCommandLinePackageSelection() we have the following
code:

       bool wanted    = pkg.isManuallyWanted();
       bool deleted   = pkg.isManuallyDeleted();
       bool basemisc  = (pkg.categories.find ("Base") !=
pkg.categories.end ()
                     || pkg.categories.find ("Orphaned") != pkg.categories.end ());
[...]
       bool reinstall = (wanted  || basemisc) && deleted;

One strange consequence of this is that if the user tries to uninstall
an orphaned package on the command line, then setup will instead try to
reinstall it.

This behavior was introduced in the following commit:

commit a667a8b289ccb6e70ec6bf4c70cceeca4d3fb5d3
Author: Corinna Vinschen <[hidden email]>
Date:   Thu Jul 25 12:03:49 2013 +0000

[...]
Uninstalled packages in categories "Base" or "Misc" are always selected
for installation; installed packages in these categories are not
eligible for deletion and will be reinstalled or upgraded instead.
[...]

I can't understand the rationale for this.  Did "Misc" (which has since
been renamed to "Orphaned") used to have a different meaning?

I found it very surprising when I tried to uninstall a bunch of packages
in unattended mode, and setup failed with download errors because it
tried to reinstall orphaned packages.

Ken
Reply | Threaded
Open this post in threaded view
|

Re: setup: uninstalling an orphaned package

Ken Brown-6
On 3/26/2018 1:55 PM, Ken Brown wrote:

> In ChooserPage::applyCommandLinePackageSelection() we have the following
> code:
>
>        bool wanted    = pkg.isManuallyWanted();
>        bool deleted   = pkg.isManuallyDeleted();
>        bool basemisc  = (pkg.categories.find ("Base") !=
> pkg.categories.end ()
>               || pkg.categories.find ("Orphaned") != pkg.categories.end
> ());
> [...]
>        bool reinstall = (wanted  || basemisc) && deleted;
>
> One strange consequence of this is that if the user tries to uninstall
> an orphaned package on the command line, then setup will instead try to
> reinstall it.
>
> This behavior was introduced in the following commit:
>
> commit a667a8b289ccb6e70ec6bf4c70cceeca4d3fb5d3
> Author: Corinna Vinschen <[hidden email]>
> Date:   Thu Jul 25 12:03:49 2013 +0000
>
> [...]
> Uninstalled packages in categories "Base" or "Misc" are always selected
> for installation; installed packages in these categories are not
> eligible for deletion and will be reinstalled or upgraded instead.
> [...]
>
> I can't understand the rationale for this.  Did "Misc" (which has since
> been renamed to "Orphaned") used to have a different meaning?
>
> I found it very surprising when I tried to uninstall a bunch of packages
> in unattended mode, and setup failed with download errors because it
> tried to reinstall orphaned packages.
Patch attached.

Ken


0001-Allow-command-line-uninstallation-of-specific-orphan.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: setup: uninstalling an orphaned package

Jon TURNEY
On 27/03/2018 20:04, Ken Brown wrote:

> On 3/26/2018 1:55 PM, Ken Brown wrote:
>> In ChooserPage::applyCommandLinePackageSelection() we have the
>> following code:
>>
>>        bool wanted    = pkg.isManuallyWanted();
>>        bool deleted   = pkg.isManuallyDeleted();
>>        bool basemisc  = (pkg.categories.find ("Base") !=
>> pkg.categories.end ()
>>               || pkg.categories.find ("Orphaned") !=
>> pkg.categories.end ());
>> [...]
>>        bool reinstall = (wanted  || basemisc) && deleted;
>>
>> One strange consequence of this is that if the user tries to uninstall
>> an orphaned package on the command line, then setup will instead try
>> to reinstall it.
>>
[...]
>
> Patch attached.

Applied, thanks.