From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJLV9-0002Vd-U4 for guix-patches@gnu.org; Fri, 09 Jun 2017 11:07:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJLV8-00015a-Pw for guix-patches@gnu.org; Fri, 09 Jun 2017 11:07:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:34532) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dJLV8-00015W-Mh for guix-patches@gnu.org; Fri, 09 Jun 2017 11:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dJLV8-00063J-EH for guix-patches@gnu.org; Fri, 09 Jun 2017 11:07:02 -0400 Subject: bug#27296: [PATCH 35/35] guix: Add texlive importer. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170609104559.17416-1-rekado@elephly.net> <20170609104559.17416-35-rekado@elephly.net> Date: Fri, 09 Jun 2017 17:05:56 +0200 In-Reply-To: <20170609104559.17416-35-rekado@elephly.net> (Ricardo Wurmus's message of "Fri, 9 Jun 2017 12:45:59 +0200") Message-ID: <87wp8li4kr.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ricardo Wurmus Cc: 27296@debbugs.gnu.org Ricardo Wurmus skribis: > * guix/import/texlive.scm: New file. > * guix/scripts/import/texlive.scm: New file. > * Makefile.am (MODULES): Add them. > * guix/scripts/import.scm (importers): Add texlive importer. Could you add a note in guix.texi as well as a basic test (possibly with mock of =E2=80=98http-get=E2=80=99) in tests/texlive.scm? > +(define* (sxml->package sxml #:optional (component "latex")) > + "Return the `package' s-expression for a Texlive package from the SXML > +expression describing it." > + (define (sxml-value path) > + (match ((sxpath path) sxml) > + (() #f) > + ((val) val))) > + (let* ((id (sxml-value '(entry @ id *text*))) > + (synopsis (sxml-value '(entry caption *text*))) > + (version (or (sxml-value '(entry version @ number *text*)) > + (sxml-value '(entry version @ date *text*)))) > + (license (string->license (sxml-value '(entry license @ type= *text*)))) > + (home-page (string-append "http://www.ctan.org/pkg/" id)) > + (ref (texlive-ref component id)) =E2=80=98sxml-match=E2=80=99 might work better for this, depending on the s= tructure of the XML tree. > + (checkout (with-store store (download-svn-to-store store ref)= ))) Note that as soon as we leave the dynamic extent of =E2=80=98with-store=E2= =80=99, the checkout can be GC=E2=80=99d. Thus, it=E2=80=99s safer to wrap the whole b= ody in =E2=80=98with-store=E2=80=99. Otherwise LGTM. Any plans for an updater in that module? Woow, that=E2=80=99s an impressive piece of work, and that was fast! I only commented on a couple of packages, the others look good to me. I think we=E2=80=99ll probably want a =E2=80=98texlive-full=E2=80=99 meta-p= ackage equivalent to our current =E2=80=98texlive=E2=80=99 package for some or our users (hi And= reas! :-)). Apart from that it=E2=80=99ll be interesting to see how many of the packages currently depending on =E2=80=98texlive=E2=80=99 can use =E2=80=98texlive-t= iny=E2=80=99. A big thank you for this change that we had all been waiting for! Ludo=E2=80=99.