From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: package.el dependencies Date: Mon, 26 Jan 2015 10:46:02 -0200 Message-ID: References: <87wq4dpqib.fsf@gmail.com> <873871p5vt.fsf@gmail.com> <87r3uim2nk.fsf@gmail.com> <87ppa1n9xr.fsf@gmail.com> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d233a595255050d8d8529 X-Trace: ger.gmane.org 1422276386 16147 80.91.229.3 (26 Jan 2015 12:46:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2015 12:46:26 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 26 13:46:26 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YFj3i-0001PK-1Z for ged-emacs-devel@m.gmane.org; Mon, 26 Jan 2015 13:46:26 +0100 Original-Received: from localhost ([::1]:41320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFj3h-0000hH-IF for ged-emacs-devel@m.gmane.org; Mon, 26 Jan 2015 07:46:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFj3M-0000bO-Pv for emacs-devel@gnu.org; Mon, 26 Jan 2015 07:46:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFj3L-0006vd-75 for emacs-devel@gnu.org; Mon, 26 Jan 2015 07:46:04 -0500 Original-Received: from mail-ob0-x22b.google.com ([2607:f8b0:4003:c01::22b]:56739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFj3K-0006vX-Sk for emacs-devel@gnu.org; Mon, 26 Jan 2015 07:46:03 -0500 Original-Received: by mail-ob0-f171.google.com with SMTP id va2so7428412obc.2 for ; Mon, 26 Jan 2015 04:46:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=OkNJr0tJjZkB/RO3ihndOvRRE8YqVTRkxs+KcgkVduw=; b=OXVeA890e9n24wIiu0v246kkMxnz44KqysjVt6JOPV/j7IKtHJbWmEfqL6MAB2LHhk nvfiITbFyzlX9gnFvVpuDN+8jeLOcoVAYUPqlNT6XJXlbE5Uv31vruFuXUcdqXy6hbxw CXI8ommkhRDpupKNhCRvkHcLEWKYemeNoT+OxwyFhZG32g+fdVsTLazCATLaLBByGVl2 8bRYsp5ZGD9qO9cJB1yshq4wZNJJgHcb40jmA9jYGO/XKYMTLUbDV24YPUDPTsgrImDO lPpwq79wHegHBoSFztbbh+dByPn2bIiQhFXODqoprw7QGX5/OkxQz/MryX34y02LFmkv 9+Pw== X-Received: by 10.202.90.139 with SMTP id o133mr11717621oib.99.1422276362324; Mon, 26 Jan 2015 04:46:02 -0800 (PST) Original-Received: by 10.76.125.1 with HTTP; Mon, 26 Jan 2015 04:46:02 -0800 (PST) In-Reply-To: <87ppa1n9xr.fsf@gmail.com> X-Google-Sender-Auth: HPeiZFGA8Gr14gnC9iLzqMt0F_4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181784 Archived-At: --001a113d233a595255050d8d8529 Content-Type: text/plain; charset=UTF-8 > > 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 :-)). --001a113d233a595255050d8d8529 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

> > I think the orphan dependencies s= hould be autoremoved immediately
> > after the package is deleted,
>
> No, not necessarily, it should not be an obligation, one can delete a<= br> > 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 dis= cussed some other time. Getting this feature out is more important, so I= 9;m ok with whatever you chose here.

Still, that doe= sn't say why you'd need an `autoremove-list'. That's someth= ing 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<= br> > > deleted (without a newer version installed) it is removed from th= e
> > 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 delet= ed packages?

We don't need this list to calculate unneeded depend= encies. All we need is the list of currently installed packages (package-al= ist) and the dependency tree of currently installed packages (available ins= ide 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 d= on't need to (and probably shouldn't) keep a list of unneeded packa= ges. Just calculating it with a function would be less code, and would be s= afer (you never know what might have happened between an Emacs restart).

Once your first patch is applied, I can provide an example implementati= on for this if you'd like (just to show I'm trying to help, and not= get in the way :-)).

--001a113d233a595255050d8d8529--