gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]