From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH] Elpa importer improvements Date: Tue, 27 Dec 2016 11:54:55 +0300 Message-ID: <87ful9px9c.fsf@gmail.com> References: <8760mn5kqq.fsf@zancanaro.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLnXB-00020V-MZ for guix-devel@gnu.org; Tue, 27 Dec 2016 03:55:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLnXA-0002dc-HS for guix-devel@gnu.org; Tue, 27 Dec 2016 03:55:01 -0500 In-Reply-To: <8760mn5kqq.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Wed, 14 Dec 2016 13:04:45 +1100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Carlo Zancanaro Cc: Guix-devel , Federico Beffa Carlo Zancanaro (2016-12-14 13:04 +1100) wrote: > I was trying to import some elpa packages recently and found some > issues, so here are some patches to fix them. > > 1. call-with-downloaded-file had behaviour different to how it was > documented to behave. This was primarily a problem when trying to import > packages with no description (eg. color-theme-solarized on melpa). > > 2. Package dependencies need to be propagated so that emacs can find > them. > Has anyone looked at this? This is relatively minor, but now that the > 0.12.0 release is done I thought a ping might be appropriate. Thanks for pinging! I've also Cc-ed Federico and Ludovic who wrote and changed this part of code. > From 0e561aee91b5d389d72906d059ddf486a322f20a Mon Sep 17 00:00:00 2001 > From: Carlo Zancanaro > Date: Wed, 14 Dec 2016 12:31:12 +1100 > Subject: [PATCH 1/2] import: elpa: Fix call-with-downloaded-file > > * guix/import/elpa.scm (call-with-downloaded-file): Make function behavio= ur > match documentation string. > --- > guix/import/elpa.scm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm > index 320a09e8c..5f8b7a9e5 100644 > --- a/guix/import/elpa.scm > +++ b/guix/import/elpa.scm > @@ -89,7 +89,13 @@ NAMES (strings)." > "Fetch URL, store the content in a temporary file and call PROC with t= hat > file. Returns the value returned by PROC. On error call ERROR-THUNK and > return its value or leave if it's false." > - (proc (http-fetch/cached (string->uri url)))) > + (catch #t > + (lambda () > + (proc (http-fetch/cached (string->uri url)))) > + (lambda (key . args) > + (if error-thunk > + (error-thunk) > + (apply throw key args))))) So here you fixed a regression introduced by commit 218622a73=C2=B9, thanks! I think it's better to call 'leave' on the last line as it was done originally. =C2=B9 http://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D218622a73794c= 3b0d0d81db9176a59125c58df41 > From 88f23b9c369841837a83225b52e19f4c029906ab Mon Sep 17 00:00:00 2001 > From: Carlo Zancanaro > Date: Wed, 14 Dec 2016 12:34:15 +1100 > Subject: [PATCH 2/2] import: elpa: Import dependencies as propagated-inpu= ts > > * guix/import/elpa.scm (elpa-package->sexp): Import dependencies as > propagated-inputs. > --- > guix/import/elpa.scm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm > index 5f8b7a9e5..897ce6a69 100644 > --- a/guix/import/elpa.scm > +++ b/guix/import/elpa.scm > @@ -228,7 +228,7 @@ type ''." > (bytevector->nix-base32-string (file-sha256 tarb= all)) > "failed to download package"))))) > (build-system emacs-build-system) > - ,@(maybe-inputs 'inputs dependencies) > + ,@(maybe-inputs 'propagated-inputs dependencies) > (home-page ,(elpa-package-home-page pkg)) > (synopsis ,(elpa-package-synopsis pkg)) > (description ,(elpa-package-description pkg)) Using 'propagated-inputs' looks right to me. --=20 Alex