[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.
- [gnunet-scheme] 17/324: Fix libextractor imports, (continued)
- [gnunet-scheme] 17/324: Fix libextractor imports, gnunet, 2021/09/21
- [gnunet-scheme] 20/324: Define missing constants, gnunet, 2021/09/21
- [gnunet-scheme] 23/324: Correct variable reference, gnunet, 2021/09/21
- [gnunet-scheme] 24/324: Regularise naming convention, gnunet, 2021/09/21
- [gnunet-scheme] 25/324: Extend let^, gnunet, 2021/09/21
- [gnunet-scheme] 30/324: Correct maximum in metaformats.scm and metatypes.scm, gnunet, 2021/09/21
- [gnunet-scheme] 26/324: Port meta-data-serialize/uncached, gnunet, 2021/09/21
- [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 <=
- [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, 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