From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBoN5-0007b6-MG for guix-patches@gnu.org; Thu, 26 Apr 2018 17:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBoN1-000777-5b for guix-patches@gnu.org; Thu, 26 Apr 2018 17:24:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:32857) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBoN1-000773-1q for guix-patches@gnu.org; Thu, 26 Apr 2018 17:24:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fBoN0-0001Vj-Sb for guix-patches@gnu.org; Thu, 26 Apr 2018 17:24:02 -0400 Subject: [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit a string. Resent-Message-ID: From: Christopher Baines Date: Thu, 26 Apr 2018 22:23:09 +0100 Message-Id: <20180426212309.10809-3-mail@cbaines.net> In-Reply-To: <20180426212309.10809-1-mail@cbaines.net> References: <20180426212309.10809-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31277@debbugs.gnu.org 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. (): 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))) + ;;; ;;; Serialize @@ -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