|
From: | Artur Malabarba |
Subject: | Re: package.el dependencies |
Date: | Mon, 26 Jan 2015 10:46:02 -0200 |
> > I think the orphan dependencies should be autoremoved immediately
> > after the package is deleted,
>
> No, not necessarily, it should not be an obligation, one can delete a
> package and make a cleanup later, it is what apt-get does.
Though, I'd prefer doing the cleanup immediately (it's what I've always done with arch linux's pacman), this can be discussed some other time. Getting this feature out is more important, so I'm ok with whatever you chose here.
Still, that doesn't say why you'd need an `autoremove-list'. That's something that's easy to calculate (I can write the implementation if you'd like).
> > 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.
>
> You assume the dependencies unneeded are removed straight after
> deleting, which is not the case.
Not really. The package-installed-explicitly is a list of installed packages which the user manually requested, why would it ever contain deleted packages?
We don't need this list to calculate unneeded dependencies. All we need is the list of currently installed packages (package-alist) and the dependency tree of currently installed packages (available inside the entries of package-alist).
Maybe I just didn't quite understand what's the implementation you have in mind, and maybe we're just talking different things. But, from what I understand, we don't need to (and probably shouldn't) keep a list of unneeded packages. Just calculating it with a function would be less code, and would be safer (you never know what might have happened between an Emacs restart).
Once your first patch is applied, I can provide an example implementation for this if you'd like (just to show I'm trying to help, and not get in the way :-)).
[Prev in Thread] | Current Thread | [Next in Thread] |