[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 40/324: scripts: publish-store: allow setting all option
From: |
gnunet |
Subject: |
[gnunet-scheme] 40/324: scripts: publish-store: allow setting all options |
Date: |
Tue, 21 Sep 2021 13:21:20 +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 1b645a1219517de52d6824374abf9d118b5c1545
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Jan 23 19:23:20 2021 +0100
scripts: publish-store: allow setting all options
* gnu/gnunet/scripts/publish-store.scm
(%option-specification): reorder a little, and add
'anonymity', 'noindex', 'priority' and 'replication'
(%help): document new options
(main): pass all options to 'publish-nar'
(gnunet-publish): work around a hang of unknown cause
by imposing a minimal anonymity level of 1.
Also, make the '-s' / '--simulate' option optional
---
gnu/gnunet/scripts/publish-store.scm | 38 ++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
diff --git a/gnu/gnunet/scripts/publish-store.scm
b/gnu/gnunet/scripts/publish-store.scm
index 656db13..06b73c5 100644
--- a/gnu/gnunet/scripts/publish-store.scm
+++ b/gnu/gnunet/scripts/publish-store.scm
@@ -56,13 +56,21 @@
(define %options-specification
'((version (single-char #\v))
(help (single-char #\h))
- (config (single-char #\c))
- (simulate (single-char #\s))
(format (single-char #\f)
(value #t)
(predicate ,(cute member <> '("gnunet-nar"))))
(input (single-char #\i)
- (value #t))))
+ (value #t))
+ (simulate (single-char #\s))
+ ;; GNUnet options
+ (config (single-char #\c))
+ (anonymity (single-char #\a)
+ (value #t))
+ (noindex (single-char #\n))
+ (priority (single-char #\p)
+ (value #t))
+ (replication (single-char #\r)
+ (value #t))))
(define %help
"Usage: publish-store --input=INPUT --config=CONFIG [OPTION]...
@@ -80,7 +88,8 @@ GNUnet options
-c, --config GNUnet configuration for publishing
-a, --anonymity Anonymity level for publishing
-p, --priority Priority level for publishing (360 by default)
- -r, --replication Desired replication level (0 by default)")
+ -r, --replication Desired replication level (0 by default)
+ -n, --noindex Do not store files by name in the local GNUnet")
(define (main arguments)
(let ((options (getopt-long arguments %options-specification)))
@@ -96,7 +105,18 @@ GNUnet options
(let ((result
(publish-nar #:input (option-ref options 'input #f)
#:simulate (option-ref options 'simulate #f)
- #:config (option-ref options 'config #f))))
+ #:config (option-ref options 'config #f)
+ #:anonymity
+ (string->number
+ (option-ref options 'anonymity "1"))
+ #:priority
+ (string->number
+ (option-ref options 'priority "360"))
+ #:replication
+ (string->number
+ (option-ref options 'replication "0"))
+ #:no-index
+ (option-ref options 'noindex #f))))
(format (current-output-port)
"Published at ~a in ~a format~%"
result "gnunet-nix-archive-json/0")))
@@ -133,6 +153,12 @@ GNUnet options
as a string."
(setenv "LC_ALL" "C")
(let* ((*binary* "gnunet-publish")
+ ;; FIXME for some reason
+ ;; setting anonymity to 0
+ ;; causes a hang
+ (anonymity (if (= anonymity 0)
+ 1
+ anonymity))
(cmd `(,*binary*
"--disable-extractor"
"-a" ,(number->string anonymity)
@@ -143,7 +169,7 @@ as a string."
'())
,@(if simulate
'("-s")
- '("-s"))
+ '())
,@(if no-index
'("-n")
'())
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet-scheme] 29/324: Define meta data structures systematically, (continued)
- [gnunet-scheme] 29/324: Define meta data structures systematically, gnunet, 2021/09/21
- [gnunet-scheme] 31/324: fix netstruct, and implement wrap-reader-setter, gnunet, 2021/09/21
- [gnunet-scheme] 28/324: Define library for structures, gnunet, 2021/09/21
- [gnunet-scheme] 34/324: scripts: add incomplete script for publishing a store item, gnunet, 2021/09/21
- [gnunet-scheme] 33/324: include some notes on reverse-engineering GNUdirs, gnunet, 2021/09/21
- [gnunet-scheme] 36/324: scripts: publish-store: eliminate add-name, gnunet, 2021/09/21
- [gnunet-scheme] 32/324: remove some uses of old accessors, gnunet, 2021/09/21
- [gnunet-scheme] 41/324: scripts: publish-store: fix predicate of --format option, gnunet, 2021/09/21
- [gnunet-scheme] 38/324: scripts: publish-store: publish whole trees, gnunet, 2021/09/21
- [gnunet-scheme] 37/324: scripts: publish-store: publish individual files, gnunet, 2021/09/21
- [gnunet-scheme] 40/324: scripts: publish-store: allow setting all options,
gnunet <=
- [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, 2021/09/21