gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 34/324: scripts: add incomplete script for publishing a


From: gnunet
Subject: [gnunet-scheme] 34/324: scripts: add incomplete script for publishing a store item
Date: Tue, 21 Sep 2021 13:21:14 +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 f3110ca4f6c0e96a67cc2c55575f2b6f1cdda4c1
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Jan 23 10:20:59 2021 +0100

    scripts: add incomplete script for publishing a store item
    
    * gnu/gnunet/scripts/publish-store.scm
      (main): parse arguments
      (publish-nar): don't do anything yet
---
 gnu/gnunet/scripts/publish-store.scm | 73 ++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/gnu/gnunet/scripts/publish-store.scm 
b/gnu/gnunet/scripts/publish-store.scm
new file mode 100644
index 0000000..b187804
--- /dev/null
+++ b/gnu/gnunet/scripts/publish-store.scm
@@ -0,0 +1,73 @@
+;;   This file is part of scheme-GNUnet, a partial Scheme port of GNUnet.
+;;   Copyright (C) 2021 Maxime Devos <maximedevos@telenet.be>
+;;
+;;   GNUnet is free software: you can redistribute it and/or modify it
+;;   under the terms of the GNU Affero General Public License as published
+;;   by the Free Software Foundation, either version 3 of the License,
+;;   or (at your option) any later version.
+;;
+;;   GNUnet is distributed in the hope that it will be useful, but
+;;   WITHOUT ANY WARRANTY; without even the implied warranty of
+;;   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;   Affero General Public License for more details.
+;;
+;;   You should have received a copy of the GNU Affero General Public License
+;;   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;
+;;   SPDX-License-Identifier: AGPL-3.0-or-later
+
+;; Brief: publish an item of the store (GNU Guix) to GNUnet
+(library (gnu gnunet scripts publish-store)
+  (export main)
+  (import (rnrs base)
+         (rnrs io simple)
+         (ice-9 getopt-long)
+         (only (ice-9 optargs)
+               define*))
+  (begin
+    (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))))
+
+    (define %help
+      "Usage: publish-store --input=INPUT --config=CONFIG [OPTION]...
+Publish a (GNU Guix, or Nix) store item INPUT into GNUnet.
+
+  -v, --version    Print version information
+  -h, --help       Print this message
+  -s, --simulate   Do not actually publish INPUT, only print the
+                   computed URI
+  -f, --format     Format for representing a store item, gnunet-nar
+                   by default
+  -i, --input      Store item to publish
+
+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)")
+
+    (define (main arguments)
+      (let ((options (getopt-long arguments %options-specification)))
+       (cond ((option-ref options 'version #f)
+              (display (current-output-port)
+                       "scheme-gnunet publish-store v0.0")
+              (newline (current-output-port)))
+             ((option-ref options '--help #f)
+              (display (current-output-port) %help)
+              (newline (current-output-port)))
+             ((equal? (option-ref options '--format "gnunet-nar") "gnunet-nar")
+              (publish-nar #:input (option-ref options '--input #f)
+                           #:simulate (option-ref options '--simulate #f)
+                           #:config (option-ref options '--config #f)))
+             (else ???))))
+
+    (define* (publish-nar #:key input simulate config)
+      ???)))

-- 
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]