From: ludo@gnu.org (Ludovic Courtès)
To: Jan Nieuwenhuizen <janneke@gnu.org>
Cc: 32116@debbugs.gnu.org, 32118@debbugs.gnu.org
Subject: [bug#32116] [bug#32118] [PATCH 2/2] gexp: Allow bytevector as content of `plain-file'.
Date: Thu, 12 Jul 2018 00:11:31 +0200 [thread overview]
Message-ID: <87sh4ph17w.fsf@gnu.org> (raw)
In-Reply-To: <20180710174128.6360-3-janneke@gnu.org> (Jan Nieuwenhuizen's message of "Tue, 10 Jul 2018 19:41:28 +0200")
Jan Nieuwenhuizen <janneke@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'.
next prev parent reply other threads:[~2018-07-11 22:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 17:41 [bug#32116] Allow bytevector as content of plain-file for binary data Jan Nieuwenhuizen
2018-07-10 17:41 ` [bug#32117] [PATCH 1/2] store: Add `binary-file' Jan Nieuwenhuizen
2018-07-11 22:09 ` [bug#32116] " Ludovic Courtès
2018-07-12 4:30 ` bug#32116: " Jan Nieuwenhuizen
2018-07-11 22:09 ` Ludovic Courtès
2018-07-10 17:41 ` [bug#32118] [PATCH 2/2] gexp: Allow bytevector as content of `plain-file' Jan Nieuwenhuizen
2018-07-11 22:11 ` Ludovic Courtès [this message]
2018-07-12 4:31 ` [bug#32116] " Jan Nieuwenhuizen
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sh4ph17w.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=32116@debbugs.gnu.org \
--cc=32118@debbugs.gnu.org \
--cc=janneke@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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).