GNU bug report logs - #31277
[PATCH] cgit changes

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Thu, 26 Apr 2018 21:15:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 31277 <at> debbugs.gnu.org
Subject: [PATCH 3/3] services: cgit: Make project-list permit a file-object.
Date: Fri, 18 May 2018 11:23:39 +0100
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 file-object values.
(<cgit-configuration>): Change the predicate for project-list to allow lists
and file-objects.
---
 doc/guix.texi         |  2 +-
 gnu/services/cgit.scm | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 005c0597a..81ad4f48f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19241,7 +19241,7 @@ Defaults to @samp{#f}.
 
 @end deftypevr
 
-@deftypevr {@code{cgit-configuration} parameter} list project-list
+@deftypevr {@code{cgit-configuration} parameter} project-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.
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index 3183535d4..3289d3733 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -116,6 +116,10 @@
 (define (serialize-file-object field-name val)
   (serialize-string field-name val))
 
+(define (project-list? val)
+  (or (list? val)
+      (file-object? val)))
+
 
 ;;;
 ;;; Serialize <nginx-server-configuration>
@@ -168,7 +172,9 @@
   (if (null? val) ""
       (serialize-field
        'project-list
-       (plain-file "project-list" (string-join val "\n")))))
+       (if (file-object? val)
+           val
+           (plain-file "project-list" (string-join val "\n"))))))
 
 (define (serialize-extra-options extra-options)
   (string-join extra-options "\n" 'suffix))
@@ -547,7 +553,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





This bug report was last modified 7 years and 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.