[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 65/324: download-store: prepare supporting the nar outpu
From: |
gnunet |
Subject: |
[gnunet-scheme] 65/324: download-store: prepare supporting the nar output format |
Date: |
Tue, 21 Sep 2021 13:21:45 +0200 |
This is an automated email from the git hooks/post-receive script.
maxime-devos pushed a commit to branch master
in repository gnunet-scheme.
commit c159391c0ad275349421b1fe4f02694552e5486a
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Jan 30 18:28:32 2021 +0100
download-store: prepare supporting the nar output format
* gnu/gnunet/scripts/download-store.scm
(%options-specification, %help): new '--nar' option.
(main, inner-main): move 'call-with-options' call to inner-main
and allow nar as output format.
(download:gnunet-nar/0-to-nar): new stub procedure.
(download-nar, download:gnunet-nar/0-to-fs): rename
former to latter and add a docstring.
---
gnu/gnunet/scripts/download-store.scm | 49 ++++++++++++++++++++++-------------
1 file changed, 31 insertions(+), 18 deletions(-)
diff --git a/gnu/gnunet/scripts/download-store.scm
b/gnu/gnunet/scripts/download-store.scm
index 4f14242..d3c9e15 100644
--- a/gnu/gnunet/scripts/download-store.scm
+++ b/gnu/gnunet/scripts/download-store.scm
@@ -61,6 +61,7 @@
(predicate ,gnunet-fs-uri?))
(output (single-char #\o)
(value #t))
+ (nar (value #t))
;; GNUnet options
(config (single-char #\c)
(value #t))
@@ -117,6 +118,7 @@ Download resumption is currently unsupported.
'any' by default.
-i, --input URI to download
-o, --output Directory to save store items in.
+ --nar Location to write the nar to.
GNUnet options
-c, --config GNUnet configuration for publishing
@@ -125,25 +127,29 @@ GNUnet options
local peer.")
(define (main arguments)
- (inner-main arguments)
+ (let ((options (getopt-long arguments %options-specification)))
+ (call-with-options options (cute inner-main options)))
(exit 0))
- (define (inner-main arguments)
- (let ((options (getopt-long arguments %options-specification)))
- (cond ((option-ref options 'version #f)
- (display %version-string)
- (newline))
- ((option-ref options 'help #f)
- (display %help)
- (newline))
- ((member (option-ref options 'format "gnunet-nix-archive-json/0")
- '("gnunet-nix-archive-json/0" "any"))
- (call-with-options options
- (lambda ()
- (download-nar
- (option-ref options 'input #f)
- (option-ref options 'output #f)))))
- (else ???))))
+ (define (inner-main options)
+ (cond ((option-ref options 'version #f)
+ (display %version-string)
+ (newline))
+ ((option-ref options 'help #f)
+ (display %help)
+ (newline))
+ ((member (option-ref options 'format "gnunet-nix-archive-json/0")
+ '("gnunet-nix-archive-json/0" "any"))
+ ;; TODO should multiple outputs be allowed?
+ (when (option-ref options 'output #f)
+ (download:gnunet-nar/0-to-fs
+ (option-ref options 'input #f)
+ (option-ref options 'output #f)))
+ (when (option-ref options 'nar #f)
+ (download:gnunet-nar/0-to-nar
+ (option-ref options 'input #f)
+ (option-ref options 'nar #f))))
+ (else ???)))
(define (gnunet-download uri output-filename)
"Download URI to the file OUTPUT, which is
@@ -178,7 +184,9 @@ instead of writing to a file."
(gnunet-download uri filename)
(get-bytevector-all out))))
- (define (download-nar uri output)
+ (define (download:gnunet-nar/0-to-fs uri output)
+ "Download the normalised archive in @var{gnunet-nix-archive-json/0}
+format from @var{uri} to the directory @var{output}."
(let* ((container/bv (gnunet-download/bytevector uri))
(container/json (utf8->string container/bv))
(container/scm (json-string->scm container/json)))
@@ -189,6 +197,11 @@ instead of writing to a file."
(verify-entries sorted)
(download-entries! sorted output))))
+ (define (download:gnunet-nar/0-to-nar uri output)
+ "Download the normalised archive in @var{gnunet-nix-archive-json/0}
+format from @var{uri} to the file @var{output}."
+ (throw 'todo 'implement-me 'please))
+
(define (download-entries! entries output)
(define (prefix name)
(string-append output "/" name))
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet-scheme] 73/324: concurrency: implement an ‘update stream’, (continued)
- [gnunet-scheme] 73/324: concurrency: implement an ‘update stream’, gnunet, 2021/09/21
- [gnunet-scheme] 81/324: nse: define network structures., gnunet, 2021/09/21
- [gnunet-scheme] 74/324: build: add autotools scripts, gnunet, 2021/09/21
- [gnunet-scheme] 78/324: scripts: download-store: remove debugging, gnunet, 2021/09/21
- [gnunet-scheme] 60/324: Allow using integer->value on maximal value, gnunet, 2021/09/21
- [gnunet-scheme] 68/324: scripts: download-store: allow downloads in nar format, gnunet, 2021/09/21
- [gnunet-scheme] 67/324: scripts: Don't flatten the FS tree and use SXML instead of JSON, gnunet, 2021/09/21
- [gnunet-scheme] 66/324: Document how to use GNUnet FS without networking., gnunet, 2021/09/21
- [gnunet-scheme] 70/324: doc: Progress update in README.org, gnunet, 2021/09/21
- [gnunet-scheme] 72/324: mq: fix make-envelope/dll constructor., gnunet, 2021/09/21
- [gnunet-scheme] 65/324: download-store: prepare supporting the nar output format,
gnunet <=
- [gnunet-scheme] 64/324: scripts: download-store: use SRFI-39 parameters for configuration, gnunet, 2021/09/21
- [gnunet-scheme] 75/324: build: correct propagated-inputs fields, gnunet, 2021/09/21
- [gnunet-scheme] 79/324: vc: add most build artifacts to .gitignore, gnunet, 2021/09/21
- [gnunet-scheme] 80/324: Define various common network structures, gnunet, 2021/09/21
- [gnunet-scheme] 86/324: doc: Update the roadmap on Guix + GNUnet., gnunet, 2021/09/21
- [gnunet-scheme] 84/324: utils: correct definition of unsigned integers, gnunet, 2021/09/21
- [gnunet-scheme] 76/324: scripts: download-store: make dependency on guix optional, gnunet, 2021/09/21
- [gnunet-scheme] 83/324: Document the current state of message queues., gnunet, 2021/09/21
- [gnunet-scheme] 85/324: mq: Do not include callbacks in envelopes., gnunet, 2021/09/21
- [gnunet-scheme] 91/324: Define slice-copy! and slice-zero!., gnunet, 2021/09/21