[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 51/324: scripts: publish-store: add option for printing
From: |
gnunet |
Subject: |
[gnunet-scheme] 51/324: scripts: publish-store: add option for printing generated JSON |
Date: |
Tue, 21 Sep 2021 13:21:31 +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 83fe5f271c371fd03c7f373e5ecfdecbdc8e21e1
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Mon Jan 25 16:17:57 2021 +0100
scripts: publish-store: add option for printing generated JSON
* gnu/gnunet/scripts/publish-store.scm
(%options-specification, %help, inner-main): recognise new option
'--display-json'.
(publish-nar): print generated to JSON when '--display-json' is used.
(gnunet-publish): work around undesired rest argument behaviour.
---
gnu/gnunet/scripts/publish-store.scm | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/gnu/gnunet/scripts/publish-store.scm
b/gnu/gnunet/scripts/publish-store.scm
index 2fdf689..a3f2f20 100644
--- a/gnu/gnunet/scripts/publish-store.scm
+++ b/gnu/gnunet/scripts/publish-store.scm
@@ -68,6 +68,8 @@
(input (single-char #\i)
(value #t))
(simulate (single-char #\s))
+ ;; Debugging options
+ (display-json)
;; GNUnet options
(config (single-char #\c)
(value #t))
@@ -91,6 +93,9 @@ Publish a (GNU Guix, or Nix) store item INPUT into GNUnet.
currently gnunet-nix-archive-json/0
-i, --input Store item to publish
+Debugging options
+ --display-json Display generated JSON to stdout
+
GNUnet options
-c, --config GNUnet configuration for publishing
-a, --anonymity Anonymity level for publishing
@@ -116,6 +121,8 @@ GNUnet options
(let ((result
(publish-nar #:input (option-ref options 'input #f)
#:simulate (option-ref options 'simulate #f)
+ #:display-json
+ (option-ref options 'display-json #f)
#:config (option-ref options 'config #f)
#:anonymity
(string->number
@@ -134,14 +141,17 @@ GNUnet options
(else ???))))
(define* (publish-nar #:key input
+ display-json
#:allow-other-keys
#:rest r)
(let* ((sxml (store-item->sxml input))
(publish-object
(lambda (object)
- (apply publish-object object r))))
- (publish-object
- (string->utf8 (apply publish-sxml->json sxml r)))))
+ (apply publish-object object r)))
+ (json (apply publish-sxml->json sxml r)))
+ (when display-json
+ (display (current-output-port) json))
+ (publish-object (string->utf8 json))))
(define gnunet-publish-uri-regexp
(make-regexp "\\b(gnunet://fs/chk/([A-Z0-9]+).([A-Z0-9]+).[0-9]+)\\b"))
@@ -152,6 +162,7 @@ GNUnet options
#:key
;; FIXME this shouldn't matter
input
+ display-json
(config (string-append
(getenv "HOME")
"/.config/gnunet.conf"))
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet-scheme] 40/324: scripts: publish-store: allow setting all options, (continued)
- [gnunet-scheme] 40/324: scripts: publish-store: allow setting all options, gnunet, 2021/09/21
- [gnunet-scheme] 39/324: guix: suggest a package definition, gnunet, 2021/09/21
- [gnunet-scheme] 35/324: scripts: publish-store: compute file tree, gnunet, 2021/09/21
- [gnunet-scheme] 43/324: scripts: publish-store: exit after main function, gnunet, 2021/09/21
- [gnunet-scheme] 48/324: scripts: download-store: download json container, gnunet, 2021/09/21
- [gnunet-scheme] 45/324: scripts: publish-store: fix '--config' option parsing, gnunet, 2021/09/21
- [gnunet-scheme] 46/324: scripts: download-store: parse input arguments, gnunet, 2021/09/21
- [gnunet-scheme] 42/324: scripts: publish-store: export some procedures, gnunet, 2021/09/21
- [gnunet-scheme] 44/324: doc: document publish-store.scm, gnunet, 2021/09/21
- [gnunet-scheme] 53/324: doc: add a section on Guix in the roadmap, gnunet, 2021/09/21
- [gnunet-scheme] 51/324: scripts: publish-store: add option for printing generated JSON,
gnunet <=
- [gnunet-scheme] 52/324: scripts: download-store: add downloading procedure, gnunet, 2021/09/21
- [gnunet-scheme] 47/324: scripts: publish-store: don't index temporary files, gnunet, 2021/09/21
- [gnunet-scheme] 50/324: scripts: download-store: (partially) validate entries, gnunet, 2021/09/21
- [gnunet-scheme] 49/324: scripts: publish-store: correct file name creation, gnunet, 2021/09/21
- [gnunet-scheme] 57/324: mq: define priority and preference values, gnunet, 2021/09/21
- [gnunet-scheme] 59/324: Fix value creation in integer->value, gnunet, 2021/09/21
- [gnunet-scheme] 54/324: Add missing dependency ‘guix-stuff.scm’, gnunet, 2021/09/21
- [gnunet-scheme] 62/324: Change e-mail address, gnunet, 2021/09/21
- [gnunet-scheme] 58/324: scripts: publish-store: use SRFI-39 parameters for configuration, gnunet, 2021/09/21
- [gnunet-scheme] 61/324: Write code for message handlers, gnunet, 2021/09/21