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 07:19:54 -0200 Message-ID: References: <87wq4dpqib.fsf@gmail.com> <873871p5vt.fsf@gmail.com> <87r3uim2nk.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=089e0117606b2e590d050d8aa4cb X-Trace: ger.gmane.org 1422264020 4595 80.91.229.3 (26 Jan 2015 09:20:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2015 09:20:20 +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 10:20:19 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 1YFfqD-0001tT-PB for ged-emacs-devel@m.gmane.org; Mon, 26 Jan 2015 10:20:18 +0100 Original-Received: from localhost ([::1]:40558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFfqD-0003FW-6k for ged-emacs-devel@m.gmane.org; Mon, 26 Jan 2015 04:20:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFfps-0003DD-FO for emacs-devel@gnu.org; Mon, 26 Jan 2015 04:19:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFfpr-0003xh-8F for emacs-devel@gnu.org; Mon, 26 Jan 2015 04:19:56 -0500 Original-Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]:60437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFfpr-0003xZ-21 for emacs-devel@gnu.org; Mon, 26 Jan 2015 04:19:55 -0500 Original-Received: by mail-ob0-f178.google.com with SMTP id nt9so6716951obb.9 for ; Mon, 26 Jan 2015 01:19:54 -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=i6r0BViHUACUhaOM2A271F9EQygmoBodaaruof1qv94=; b=x/ZGXobV4/6xrEaAvt9+DLaPwmBxNLb1JR0czYwu31elnVBsKGwp9bTDEK5ycZCLMK Bbp0S227C8jea2+ERwRP6/lyQXbrdnPLhq13UYrgIu0JL1oBbfT5fMBbafKOTHM7DCAY zEzzNaqG2IeLThrUVD4EB16UQaAVsRL1YI5WcO+wZ1AQ7ZzL+nthX6eDjzFZ+3xzlC/W W1gFWYhVA4JQboS6kNwZG8J7zjf5KihQXy0dYBUcx/sy1ZIjIVJRO6HqQyJhrKN+3+Ji GN9crMZdx2NqTX7ra3X0MjrcHK8Rf87S5xB4miV38E6Pkdh/UtLpLXHO61sgJ9jc0dbz ioYw== X-Received: by 10.60.179.37 with SMTP id dd5mr12182103oec.4.1422263994700; Mon, 26 Jan 2015 01:19:54 -0800 (PST) Original-Received: by 10.76.125.1 with HTTP; Mon, 26 Jan 2015 01:19:54 -0800 (PST) Original-Received: by 10.76.125.1 with HTTP; Mon, 26 Jan 2015 01:19:54 -0800 (PST) In-Reply-To: <87r3uim2nk.fsf@gmail.com> X-Google-Sender-Auth: 6WER2jqAHa9FKFUDFLIIUuxSKPQ X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::232 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:181781 Archived-At: --089e0117606b2e590d050d8aa4cb Content-Type: text/plain; charset=UTF-8 > 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. --089e0117606b2e590d050d8aa4cb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

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

I think the orphan dependencies should be autoremoved immedi= ately 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 funct= ion which loops through all packages and detect the ones that are not neede= d by anything nor installed explicitly (the orphans) and offer to delete th= em too.

2. Alternatively, this could be done as part of the same del= ete 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-instal= led-directly
> list.
> 2) store this list.
> 3) delete the package it is removed from package-alist, and we should<= br> > 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 packag= e is deleted (without a newer version installed) it is removed from the lis= t.

> package-alist, so we will have to fetch these infos aga= in, recompute the
> autoremove list etc... IMO it is simpler to delete the package from th= e
> 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? Depende= ncies 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 di= fficult. I'm just trying to understand why we would need this extra aut= oremove list.

--089e0117606b2e590d050d8aa4cb--