From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: Invalid nar signature Date: Mon, 15 Dec 2014 16:24:44 -0500 Message-ID: References: <87zjapejo3.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87ppbkompf.fsf@gnu.org> <87ppbkfw4w.fsf@gnu.org> 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]:42621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0d8R-0007G6-9Y for guix-devel@gnu.org; Mon, 15 Dec 2014 16:25:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0d8I-0008RS-10 for guix-devel@gnu.org; Mon, 15 Dec 2014 16:24:55 -0500 Received: from na3sys009aog131.obsmtp.com ([74.125.149.247]:59055 helo=mail-pa0-f49.google.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0d8H-0008Pk-Pc for guix-devel@gnu.org; Mon, 15 Dec 2014 16:24:45 -0500 Received: by mail-pa0-f49.google.com with SMTP id eu11so12441971pac.8 for ; Mon, 15 Dec 2014 13:24:44 -0800 (PST) In-Reply-To: <87ppbkfw4w.fsf@gnu.org> 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: guix-devel On Mon, Dec 15, 2014 at 4:20 PM, Ludovic Court=C3=A8s wrote: > "Thompson, David" skribis: > >> On Mon, Dec 15, 2014 at 12:19 PM, Ludovic Court=C3=A8s wr= ote: >>> I think this is due to a subtly misleading file format variation. >>> >>> If you look at =E2=80=98export-paths=E2=80=99, it does: >>> >>> while there are files to write >>> write-long-long 1 >>> export-path file >>> write-long-long 0 >>> >>> =E2=80=98restore-file-set=E2=80=99 does the opposite, which is to read = that long-long to >>> determine whether there=E2=80=99s data coming up, and then to call >>> =E2=80=98restore-file=E2=80=99. >> >> Thanks. I'm still a little confused, though. I'm not sure what >> change I need to make in order to satisfy the substituter. Do I need >> to write a variant of export-paths that leaves off the initial >> write-long-long call? > > For illustration purposes, here=E2=80=99s a normal sequence: > > --8<---------------cut here---------------start------------->8--- > $ wget -O t.nar.bz2 http://hydra.gnu.org/nar/wy70n5zk8qinxjz0wdk9q2hh1zjf= b32j-miscfiles-1.5 > $ bunzip2 t.nar.bz2 > $ ./pre-inst-env guile -c '(use-modules (guix serialization)) (call-with-= input-file "t.nar" (lambda (port) (restore-file port "restored")))' > $ ls restored/ > share > --8<---------------cut here---------------end--------------->8--- > > =E2=80=98restore-file=E2=80=99 is what =E2=80=98guix substitute-binary --= substitute=E2=80=99 uses. It > expects a single store item=E2=80=93i.e., the variant /without/ the leadi= ng > long-long, as you noticed. > > To produce that, use =E2=80=98write-file=E2=80=99 from (guix serializatio= n): > > --8<---------------cut here---------------start------------->8--- > $ ./pre-inst-env guile -c '(use-modules (guix serialization)) (write-file= "/gnu/store/wy70n5zk8qinxjz0wdk9q2hh1zjfb32j-miscfiles-1.5" (current-outpu= t-port))' > t.nar > $ ./pre-inst-env guile -c '(use-modules (guix serialization)) (call-with-= input-file "t.nar" (lambda (port) (restore-file port "restored")))' > $ ls restored/ > share > --8<---------------cut here---------------end--------------->8--- Perfect, thanks! - Dave