Subject: bug#44306: package-delete exiting on encountering system/dependency packages

From: Boruch Baum <[email-masked]>
Date: Sat, 31 Oct 2020 22:48:28 -0400

On 2020-10-30 13:34, Stefan Kangas wrote:
> Lars Ingebrigtsen <[email-masked]> writes:
>
> > Boruch Baum <[email-masked]> writes:
> >
> >> When attempting to perform package-autoremove to clean up obsolete
> >> packages, my emacs would abort with an error that `foo' is a system
> >> package. Thus, it had become impossible to perform the operation. I
> >> altered function package-delete to replace its two calls to function
> >> `error' with simple `message' and can now clean up the packages.
> >
> > It kinda sounds like there something wrong in what package-autoremove is
> > trying to delete.
>
> Indeed.  The question is why these packages are considered for removal
> at all.

The function that builds the candidate list, package--removable-packages,
doesn't take into account the criteria used in function 'package-delete'.

> If we can avoid doing that, the error "Package `%s' is used by `%s' as
> dependency, not deleting" seems correct to me - it will catch bugs.

That's not really my point. My point in the bug report is that while
technically the use of function 'error' is correct in this case, it works
out to be counter-productive and should be replaced with a simple use of
the function 'message' logging the condition to the *Messages* buffer.
Using the error function aborts the entire auro-remove process for all
packages on the list, and in this case isn't even useful for the specific
package because the function is written to independently reject further
processing for the package.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0