GNU bug report logs - #32118
[PATCH 2/2] gexp: Allow bytevector as content of `plain-file'.

Previous Next

Package: guix-patches;

Reported by: Jan Nieuwenhuizen <janneke <at> gnu.org>

Date: Tue, 10 Jul 2018 17:42:03 UTC

Severity: normal

Tags: patch

Merged with 32116, 32117

Done: Jan Nieuwenhuizen <janneke <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 32116 <at> debbugs.gnu.org, 32118 <at> debbugs.gnu.org
Subject: [bug#32118] [PATCH 2/2] gexp: Allow bytevector as content of `plain-file'.
Date: Thu, 12 Jul 2018 00:11:31 +0200
Jan Nieuwenhuizen <janneke <at> gnu.org> skribis:

> This allows for using a package source directly from git, doing something like
>
>     (define (command->bytevector command)
>       (let ((port (apply open-pipe* OPEN_READ command)))
>         (let ((output (get-bytevector-all port)))
>           (close-port port)
>           output)))
>
>     (define-public hello-git
>       (package
>         (name "hello")
>         (version "git")
>         (source (let* ((commit "stable-2.0")
>                        (content (command->bytevector
>                                  `("git" "archive" "--format" "tar" "--prefix"
>                                    ,(string-append commit "/") ,commit)))
>                        (file-name (string-append "hello-" commit)))
>                   (plain-file file-name content)))
>         ...
>         ))
>
> * guix/gexp.scm (<plain-file>): Also allow bytevector content.
> (plain-file-compiler): Handle bytevector content.
> * doc/guix.texi (G-Expressions): Describe plain-file now also taking
> bytevectors.

LGTM, thanks!

Ludo'.




This bug report was last modified 6 years and 314 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.