GNU bug report logs - #32117
[PATCH 1/2] store: Add `binary-file'.

Previous Next

Package: guix-patches;

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

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

Severity: normal

Tags: patch

Merged with 32116, 32118

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32117 in the body.
You can then email your comments to 32117 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#32117; Package guix-patches. (Tue, 10 Jul 2018 17:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 10 Jul 2018 17:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: guix-patches <at> gnu.org
Subject: [PATCH 1/2] store: Add `binary-file'.
Date: Tue, 10 Jul 2018 19:41:27 +0200
* guix/store.scm (binary-file): New function.
* doc/guix.texi (G-Expressions): Describe binary-file*.
---
 doc/guix.texi  |  7 ++++++-
 guix/store.scm | 15 ++++++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a8e53a530..04d7a79ac 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -27,7 +27,7 @@ Copyright @copyright{} 2016, 2017, 2018 Chris Marusich@*
 Copyright @copyright{} 2016, 2017, 2018 Efraim Flashner@*
 Copyright @copyright{} 2016 John Darrington@*
 Copyright @copyright{} 2016, 2017 Nils Gillmann@*
-Copyright @copyright{} 2016, 2017 Jan Nieuwenhuizen@*
+Copyright @copyright{} 2016, 2017, 2018 Jan Nieuwenhuizen@*
 Copyright @copyright{} 2016 Julien Lepiller@*
 Copyright @copyright{} 2016 Alex ter Weele@*
 Copyright @copyright{} 2017, 2018 Clément Lassieur@*
@@ -5463,6 +5463,11 @@ as in:
 This is the declarative counterpart of @code{text-file*}.
 @end deffn
 
+@deffn {Monadic Procedure} binary-file* @var{name} @var{data} @dots{}
+Return as a monadic value a derivation that builds a text file
+containing @var{data}.  @var{data} is a bytevector.
+@end deffn
+
 @deffn {Scheme Procedure} file-union @var{name} @var{files}
 Return a @code{<computed-file>} that builds a directory containing all of @var{files}.
 Each item in @var{files} must be a two-element list where the first element is the
diff --git a/guix/store.scm b/guix/store.scm
index bac42f273..cc5c24a77 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2018 Jan Nieuwenhuizen <janneke <at> gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -77,6 +78,7 @@
             add-data-to-store
             add-text-to-store
             add-to-store
+            binary-file
             build-things
             build
             query-failed-paths
@@ -1362,7 +1364,18 @@ taking the store as its first argument."
 ;; Store monad operators.
 ;;
 
-(define* (text-file name text
+(define* (binary-file name
+                      data ;bytevector
+                      #:optional (references '()))
+  "Return as a monadic value the absolute file name in the store of the file
+containing DATA, a bytevector.  REFERENCES is a list of store items that the
+resulting text file refers to; it defaults to the empty list."
+  (lambda (store)
+    (values (add-data-to-store store name data references)
+            store)))
+
+(define* (text-file name
+                    text ;string
                     #:optional (references '()))
   "Return as a monadic value the absolute file name in the store of the file
 containing TEXT, a string.  REFERENCES is a list of store items that the
-- 
2.18.0





Merged 32116 32117. Request was from Jan Nieuwenhuizen <janneke <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 10 Jul 2018 18:04:02 GMT) Full text and rfc822 format available.

Merged 32116 32117 32118. Request was from Jan Nieuwenhuizen <janneke <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 10 Jul 2018 18:04:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#32117; Package guix-patches. (Wed, 11 Jul 2018 22:10:02 GMT) Full text and rfc822 format available.

Message #12 received at 32117 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 32116 <at> debbugs.gnu.org, 32117 <at> debbugs.gnu.org
Subject: Re: [bug#32117] [PATCH 1/2] store: Add `binary-file'.
Date: Thu, 12 Jul 2018 00:09:33 +0200
Hello,

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

> * guix/store.scm (binary-file): New function.
> * doc/guix.texi (G-Expressions): Describe binary-file*.

[...]

> +@deffn {Monadic Procedure} binary-file* @var{name} @var{data} @dots{}

There’s no ‘*’ in the actual procedure name.

Also, could you move this @deffn to “The Store Monad”, right after
‘text-file’?

Apart from that it LGTM, thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#32117; Package guix-patches. (Wed, 11 Jul 2018 22:11:02 GMT) Full text and rfc822 format available.

Message #15 received at 32117 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Jan Nieuwenhuizen <janneke <at> gnu.org>
Cc: 32116 <at> debbugs.gnu.org, 32117 <at> debbugs.gnu.org
Subject: Re: [bug#32117] [PATCH 1/2] store: Add `binary-file'.
Date: Thu, 12 Jul 2018 00:09:54 +0200
Hello,

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

> * guix/store.scm (binary-file): New function.
> * doc/guix.texi (G-Expressions): Describe binary-file*.

[...]

> +@deffn {Monadic Procedure} binary-file* @var{name} @var{data} @dots{}

There’s no ‘*’ in the actual procedure name.

Also, could you move this @deffn to “The Store Monad”, right after
‘text-file’?

Apart from that it LGTM, thanks!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#32117; Package guix-patches. (Thu, 12 Jul 2018 04:31:03 GMT) Full text and rfc822 format available.

Message #18 received at 32117-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 32116-done <at> debbugs.gnu.org, 32117-done <at> debbugs.gnu.org
Subject: Re: [bug#32117] [PATCH 1/2] store: Add `binary-file'.
Date: Thu, 12 Jul 2018 06:30:31 +0200
Ludovic Courtès writes:

>> +@deffn {Monadic Procedure} binary-file* @var{name} @var{data} @dots{}
>
> There’s no ‘*’ in the actual procedure name.
>
> Also, could you move this @deffn to “The Store Monad”, right after
> ‘text-file’?

Ah, I based this on the `text-file*' description!  Moved, and rewritten
as

@deffn {Monadic Procedure} binary-file @var{name} @var{data} [@var{references}]
Return as a monadic value the absolute file name in the store of the file
containing @var{data}, a bytevector.  @var{references} is a list of store
items that the resulting binary file refers to; it defaults to the empty list.
@end deffn

> Apart from that it LGTM, thanks!

Pushed to master as  f3a422511f793fb6c6cfeec2bb8735965a03294a

janneke

-- 
Jan Nieuwenhuizen <janneke <at> gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 09 Aug 2018 11:24:04 GMT) Full text and rfc822 format available.

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.