From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdNL9-00080f-8o for guix-patches@gnu.org; Wed, 11 Jul 2018 18:12:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdNL8-0005mB-Ew for guix-patches@gnu.org; Wed, 11 Jul 2018 18:12:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:48148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fdNL8-0005m7-AM for guix-patches@gnu.org; Wed, 11 Jul 2018 18:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fdNL8-0007aN-49 for guix-patches@gnu.org; Wed, 11 Jul 2018 18:12:02 -0400 Subject: [bug#32116] [bug#32118] [PATCH 2/2] gexp: Allow bytevector as content of `plain-file'. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180710174128.6360-1-janneke@gnu.org> <20180710174128.6360-3-janneke@gnu.org> Date: Thu, 12 Jul 2018 00:11:31 +0200 In-Reply-To: <20180710174128.6360-3-janneke@gnu.org> (Jan Nieuwenhuizen's message of "Tue, 10 Jul 2018 19:41:28 +0200") Message-ID: <87sh4ph17w.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Jan Nieuwenhuizen Cc: 32116@debbugs.gnu.org, 32118@debbugs.gnu.org Jan Nieuwenhuizen 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 (): 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'.