From: "Thompson, David" <dthompson2@worcester.edu>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Invalid nar signature
Date: Mon, 15 Dec 2014 16:24:44 -0500 [thread overview]
Message-ID: <CAJ=RwfY2beWW1znu-yHm57_nyx16JejLd8A9azhyrw5VMyZCCA@mail.gmail.com> (raw)
In-Reply-To: <87ppbkfw4w.fsf@gnu.org>
On Mon, Dec 15, 2014 at 4:20 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> "Thompson, David" <dthompson2@worcester.edu> skribis:
>
>> On Mon, Dec 15, 2014 at 12:19 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>>> I think this is due to a subtly misleading file format variation.
>>>
>>> If you look at ‘export-paths’, it does:
>>>
>>> while there are files to write
>>> write-long-long 1
>>> export-path file
>>> write-long-long 0
>>>
>>> ‘restore-file-set’ does the opposite, which is to read that long-long to
>>> determine whether there’s data coming up, and then to call
>>> ‘restore-file’.
>>
>> 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’s a normal sequence:
>
> --8<---------------cut here---------------start------------->8---
> $ wget -O t.nar.bz2 http://hydra.gnu.org/nar/wy70n5zk8qinxjz0wdk9q2hh1zjfb32j-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---
>
> ‘restore-file’ is what ‘guix substitute-binary --substitute’ uses. It
> expects a single store item–i.e., the variant /without/ the leading
> long-long, as you noticed.
>
> To produce that, use ‘write-file’ from (guix serialization):
>
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guile -c '(use-modules (guix serialization)) (write-file "/gnu/store/wy70n5zk8qinxjz0wdk9q2hh1zjfb32j-miscfiles-1.5" (current-output-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
next prev parent reply other threads:[~2014-12-15 21:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 2:22 Invalid nar signature David Thompson
2014-12-15 2:33 ` David Thompson
2014-12-15 17:19 ` Ludovic Courtès
2014-12-15 20:08 ` Thompson, David
2014-12-15 21:20 ` Ludovic Courtès
2014-12-15 21:24 ` Thompson, David [this message]
2014-12-15 22:49 ` David Thompson
2014-12-16 17:07 ` Ludovic Courtès
2015-01-15 2:38 ` David Thompson
2015-01-15 9:51 ` Ludovic Courtès
2015-01-15 13:39 ` Thompson, David
2015-01-15 16:22 ` Ludovic Courtès
2015-01-15 17:23 ` Thompson, David
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ=RwfY2beWW1znu-yHm57_nyx16JejLd8A9azhyrw5VMyZCCA@mail.gmail.com' \
--to=dthompson2@worcester.edu \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.