From: Christopher Baines <mail@cbaines.net>
To: 31277@debbugs.gnu.org
Subject: [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit a string.
Date: Thu, 26 Apr 2018 22:23:09 +0100 [thread overview]
Message-ID: <20180426212309.10809-3-mail@cbaines.net> (raw)
In-Reply-To: <20180426212309.10809-1-mail@cbaines.net>
Instead of having the service manage the list, it's useful to be able to point
this at an existing file, for example, when using cgit together with gitolite.
* gnu/services/cgit.scm (project-list?): New procedure.
(serialize-project-list): Handle string values.
(<cgit-configuration>): Change the predicate for project-list to allow lists
and strings.
---
gnu/services/cgit.scm | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index bacd6ca16..240d4d8d9 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -115,6 +115,10 @@
(define (serialize-file-object field-name val)
(serialize-string field-name val))
+(define (project-list? val)
+ (or (list? val)
+ (string? val)))
+
\f
;;;
;;; Serialize <nginx-server-configuration>
@@ -167,7 +171,9 @@
(if (null? val) ""
(serialize-field
'project-list
- (plain-file "project-list" (string-join val "\n")))))
+ (if (string? val)
+ val
+ (plain-file "project-list" (string-join val "\n"))))))
(define repository-directory? string?)
@@ -543,7 +549,7 @@ disabled.")
"Flag which, when set to @samp{#t}, will make cgit omit the standard
header on all pages.")
(project-list
- (list '())
+ (project-list '())
"A list of subdirectories inside of @code{repository-directory}, relative
to it, that should loaded as Git repositories. An empty list means that all
subdirectories will be loaded.")
--
2.17.0
next prev parent reply other threads:[~2018-04-26 21:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-26 21:13 [bug#31277] [PATCH] cgit changes Christopher Baines
2018-04-26 21:23 ` [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts Christopher Baines
2018-04-26 21:23 ` [bug#31277] [PATCH 2/3] services: cgit: Improve handling of extra-options Christopher Baines
2018-04-28 11:19 ` Clément Lassieur
2018-05-18 10:56 ` Christopher Baines
2018-04-26 21:23 ` Christopher Baines [this message]
2018-04-28 10:57 ` [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit a string Clément Lassieur
2018-05-18 10:57 ` Christopher Baines
2018-04-28 11:30 ` [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts Clément Lassieur
2018-05-18 10:55 ` Christopher Baines
2018-05-18 15:49 ` Clément Lassieur
2018-05-18 18:13 ` bug#31277: " Christopher Baines
2018-04-28 11:39 ` [bug#31277] [PATCH] cgit changes Clément Lassieur
2018-05-18 10:23 ` [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts Christopher Baines
2018-05-18 10:23 ` [bug#31277] [PATCH 2/3] services: cgit: Improve handling of extra-options Christopher Baines
2018-05-18 10:23 ` [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit a file-object Christopher Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180426212309.10809-3-mail@cbaines.net \
--to=mail@cbaines.net \
--cc=31277@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).