services: cgit: Make project-list permit a file-object.
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.
This commit is contained in:
parent
c3343d62f6
commit
6ee3f3dec7
@ -19241,7 +19241,7 @@ Defaults to @samp{#f}.
|
|||||||
|
|
||||||
@end deftypevr
|
@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
|
A list of subdirectories inside of @code{repository-directory}, relative
|
||||||
to it, that should loaded as Git repositories. An empty list means that
|
to it, that should loaded as Git repositories. An empty list means that
|
||||||
all subdirectories will be loaded.
|
all subdirectories will be loaded.
|
||||||
|
@ -116,6 +116,10 @@
|
|||||||
(define (serialize-file-object field-name val)
|
(define (serialize-file-object field-name val)
|
||||||
(serialize-string field-name val))
|
(serialize-string field-name val))
|
||||||
|
|
||||||
|
(define (project-list? val)
|
||||||
|
(or (list? val)
|
||||||
|
(file-object? val)))
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; Serialize <nginx-server-configuration>
|
;;; Serialize <nginx-server-configuration>
|
||||||
@ -168,7 +172,9 @@
|
|||||||
(if (null? val) ""
|
(if (null? val) ""
|
||||||
(serialize-field
|
(serialize-field
|
||||||
'project-list
|
'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)
|
(define (serialize-extra-options extra-options)
|
||||||
(string-join extra-options "\n" 'suffix))
|
(string-join extra-options "\n" 'suffix))
|
||||||
@ -547,7 +553,7 @@ disabled.")
|
|||||||
"Flag which, when set to @samp{#t}, will make cgit omit the standard
|
"Flag which, when set to @samp{#t}, will make cgit omit the standard
|
||||||
header on all pages.")
|
header on all pages.")
|
||||||
(project-list
|
(project-list
|
||||||
(list '())
|
(project-list '())
|
||||||
"A list of subdirectories inside of @code{repository-directory}, relative
|
"A list of subdirectories inside of @code{repository-directory}, relative
|
||||||
to it, that should loaded as Git repositories. An empty list means that all
|
to it, that should loaded as Git repositories. An empty list means that all
|
||||||
subdirectories will be loaded.")
|
subdirectories will be loaded.")
|
||||||
|
Loading…
Reference in New Issue
Block a user