[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: package.el dependencies

From: Artur Malabarba
Subject: Re: package.el dependencies
Date: Mon, 26 Jan 2015 07:19:54 -0200

> I don't think it will be enough, we will have to store also a plain list
> of the package to autoremove because the info about the dependencies in
> package-alist will not be anymore available when deinstalling a package
> unless autoremove is launched right now before quitting emacs, which is
> not what we want.

I think the orphan dependencies should be autoremoved immediately after the package is deleted, so we don't need to save a list of packages to be autoremoved. Here are two ways I can see it happen.

1. When the user marks packages for deletion and then hits x, the package transaction is performed as usual. Afterwards, we run a function which loops through all packages and detect the ones that are not needed by anything nor installed explicitly (the orphans) and offer to delete them too.

2. Alternatively, this could be done as part of the same delete transaction which was manually requested by the user. But this would be a lot more complicated.

> 1) install a package, it is added to the package-installed-directly
> list.
> 2) store this list.
> 3) delete the package it is removed from package-alist, and we should
> also remove it from package-installed-directly list.
> 4) quit emacs
> 5) restart emacs, even if we kept the package in
> packages-installed-directly (why) we will not have the dependencies in

I agree. Why would we have kept it in this list? If a package is deleted (without a newer version installed) it is removed from the list.

> package-alist, so we will have to fetch these infos again, recompute the
> autoremove list etc... IMO it is simpler to delete the package from the
> packages-installed-directly list as soon it is removed and store also the
> autoremove list.

Why does this imply the need for an autoremove list? Dependencies should be autoremoved as soon as they're no longer necessary, not later. So we generally won't need this list.
If we do need it, it's safer to just calculate it than to try and keep it up to date between emacs sessions. I can provide a function for this if you'd like.

I hope I don't sound like I'm trying to make this difficult. I'm just trying to understand why we would need this extra autoremove list.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]