GNU bug report logs -
#32116
Allow bytevector as content of plain-file for binary data.
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Currently, plain-file does not handle binary content correctly. As discussed
on IRC[0] I added bytevector support to plain-file.
This allows for using a package source directly from git, doing something like
--8<---------------cut here---------------start------------->8---
(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)))
...
))
--8<---------------cut here---------------end--------------->8---
Greetings,
janneke
[0] https://gnunet.org/bot/log/guix/2018-07-10#T1763807
This bug report was last modified 6 years and 316 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.