From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] cgit service: add support for file-like objects Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Apr 2018 17:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 31089@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.152312067611256 (code B ref -1); Sat, 07 Apr 2018 17:05:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Apr 2018 17:04:36 +0000 Received: from localhost ([127.0.0.1]:41459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rGW-0002vT-6i for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:04:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rGU-0002vH-Mk for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:04:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4rGO-0000X5-UY for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:04:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43005) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4rGO-0000Wz-Ra for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:04:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4rGN-0002QR-VB for guix-patches@gnu.org; Sat, 07 Apr 2018 13:04:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4rGK-0000Vp-11 for guix-patches@gnu.org; Sat, 07 Apr 2018 13:04:27 -0400 Received: from mail.lassieur.org ([83.152.10.219]:48588) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4rGJ-0000Rt-MO for guix-patches@gnu.org; Sat, 07 Apr 2018 13:04:23 -0400 Received: from rodion (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id dabded54 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for ; Sat, 7 Apr 2018 17:04:17 +0000 (UTC) User-agent: mu4e 1.0; emacs 25.3.1 From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Sat, 07 Apr 2018 19:04:17 +0200 Message-ID: <874lknc5im.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) Hi, These patches aim to add support for file-like objects and a few other things related to the cgit service. Comments are welcome, Clément From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 1/5] services: cgit: Simplify 'uglify-field-name'. References: <874lknc5im.fsf@lassieur.org> In-Reply-To: <874lknc5im.fsf@lassieur.org> Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Apr 2018 17:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152312084511525 (code B ref 31089); Sat, 07 Apr 2018 17:08:01 +0000 Received: (at 31089) by debbugs.gnu.org; 7 Apr 2018 17:07:25 +0000 Received: from localhost ([127.0.0.1]:41466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJE-0002zo-LI for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:25 -0400 Received: from mail.lassieur.org ([83.152.10.219]:50376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJC-0002za-Rk for 31089@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:23 -0400 Received: from localhost.localdomain (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id 385b9ee5 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <31089@debbugs.gnu.org>; Sat, 7 Apr 2018 17:07:21 +0000 (UTC) From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Sat, 7 Apr 2018 19:07:05 +0200 Message-Id: <20180407170709.22160-1-clement@lassieur.org> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/cgit.scm (uglify-field-name): Remove STRING-JOIN and STRING-SPLIT. --- gnu/services/cgit.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm index a868d758a..b263aa491 100644 --- a/gnu/services/cgit.scm +++ b/gnu/services/cgit.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Oleg Pykhalov +;;; Copyright © 2018 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -72,8 +73,7 @@ ;;; (define (uglify-field-name field-name) - (let ((str (symbol->string field-name))) - (string-join (string-split (string-delete #\? str) #\-) "-"))) + (string-delete #\? (symbol->string field-name))) (define (serialize-field field-name val) (format #t "~a=~a\n" (uglify-field-name field-name) val)) -- 2.17.0 From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 2/5] services: cgit: Simplify 'serialize-module-link-path'. Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Apr 2018 17:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152312084511532 (code B ref 31089); Sat, 07 Apr 2018 17:08:02 +0000 Received: (at 31089) by debbugs.gnu.org; 7 Apr 2018 17:07:25 +0000 Received: from localhost ([127.0.0.1]:41468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJF-0002zq-2S for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:25 -0400 Received: from mail.lassieur.org ([83.152.10.219]:50376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJD-0002za-LF for 31089@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:23 -0400 Received: from localhost.localdomain (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id c198cfd9 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <31089@debbugs.gnu.org>; Sat, 7 Apr 2018 17:07:21 +0000 (UTC) From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Sat, 7 Apr 2018 19:07:06 +0200 Message-Id: <20180407170709.22160-2-clement@lassieur.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180407170709.22160-1-clement@lassieur.org> References: <20180407170709.22160-1-clement@lassieur.org> X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/cgit.scm (serialize-module-link-path): Remove STRING-DROP-RIGHT and UGLIFY-FIELD-NAME. --- gnu/services/cgit.scm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm index b263aa491..3c685f1b5 100644 --- a/gnu/services/cgit.scm +++ b/gnu/services/cgit.scm @@ -150,10 +150,7 @@ (if (null? val) "" (match val ((path text) - (format #t "repo.~a.~a=~a\n" - (string-drop-right (uglify-field-name 'module-link-path) - (string-length "-path")) - path text))))) + (format #t "repo.module-link.~a=~a\n" path text))))) (define repository-directory? string?) -- 2.17.0 From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects. Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Apr 2018 17:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152312084811559 (code B ref 31089); Sat, 07 Apr 2018 17:08:02 +0000 Received: (at 31089) by debbugs.gnu.org; 7 Apr 2018 17:07:28 +0000 Received: from localhost ([127.0.0.1]:41472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJH-00030L-C6 for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:27 -0400 Received: from mail.lassieur.org ([83.152.10.219]:50376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJE-0002za-B3 for 31089@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:25 -0400 Received: from localhost.localdomain (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id 3e5412c5 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <31089@debbugs.gnu.org>; Sat, 7 Apr 2018 17:07:21 +0000 (UTC) From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Sat, 7 Apr 2018 19:07:07 +0200 Message-Id: <20180407170709.22160-3-clement@lassieur.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180407170709.22160-1-clement@lassieur.org> References: <20180407170709.22160-1-clement@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * doc/guix.texi (Version Control Services): Update accordingly. * gnu/services/cgit.scm (serialize-field, serialize-string, serialize-boolean, serialize-integer, serialize-repository-cgit-configuration-list, serialize-nginx-server-configuration-list, serialize-repo-field, serialize-repo-boolean, serialize-repo-integer, serialize-module-link-path, serialize-repository-directory, serialize-mimetype-alist): Return strings or string-valued gexps and stop printing. (repository-cgit-configuration)[source-filter, about-filter, commit-filter, logo, owner-filter], (cgit-configuration)[auth-filter, commit-filter, css, email-filter, favicon, include, logo, owner-filter, mimetype-file, readme, source-filter]: Replace STRING with FILE-OBJECT. (file-object?, serialize-file-object, repo-file-object?, serialize-repo-file-object): New procedures. (cgit-activation): Use SERIALIZE-CONFIGURATION's return value with MIXED-TEXT-FILE instead of using its output with PLAIN-FILE. --- doc/guix.texi | 37 +++++++++--------- gnu/services/cgit.scm | 87 ++++++++++++++++++++++++------------------- 2 files changed, 67 insertions(+), 57 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 738fdf65c..35d23e1be 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18552,7 +18552,7 @@ NGINX configuration. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string about-filter +@deftypevr {@code{cgit-configuration} parameter} file-object about-filter Specifies a command which will be invoked to format the content of about pages (both top-level and for each repository). @@ -18568,7 +18568,7 @@ Defaults to @samp{""}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string auth-filter +@deftypevr {@code{cgit-configuration} parameter} file-object auth-filter Specifies a command that will be invoked for authenticating repository access. @@ -18677,7 +18677,7 @@ Defaults to @samp{()}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string commit-filter +@deftypevr {@code{cgit-configuration} parameter} file-object commit-filter Command which will be invoked to format commit messages. Defaults to @samp{""}. @@ -18693,14 +18693,14 @@ Defaults to @samp{"git log"}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string css +@deftypevr {@code{cgit-configuration} parameter} file-object css URL which specifies the css document to include in all cgit pages. Defaults to @samp{"/share/cgit/cgit.css"}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string email-filter +@deftypevr {@code{cgit-configuration} parameter} file-object email-filter Specifies a command which will be invoked to format names and email address of committers, authors, and taggers, as represented in various places throughout the cgit interface. @@ -18824,7 +18824,7 @@ Defaults to @samp{#f}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string favicon +@deftypevr {@code{cgit-configuration} parameter} file-object favicon URL used as link to a shortcut icon for cgit. Defaults to @samp{"/favicon.ico"}. @@ -18856,7 +18856,7 @@ Defaults to @samp{""}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string include +@deftypevr {@code{cgit-configuration} parameter} file-object include Name of a configfile to include before the rest of the current config- file is parsed. @@ -18888,7 +18888,7 @@ Defaults to @samp{#f}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string logo +@deftypevr {@code{cgit-configuration} parameter} file-object logo URL which specifies the source of an image which will be used as a logo on all cgit pages. @@ -18903,7 +18903,7 @@ Defaults to @samp{""}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string owner-filter +@deftypevr {@code{cgit-configuration} parameter} file-object owner-filter Command which will be invoked to format the Owner column of the main page. @@ -18972,7 +18972,7 @@ Defaults to @samp{((gif "image/gif") (html "text/html") (jpg @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string mimetype-file +@deftypevr {@code{cgit-configuration} parameter} file-object mimetype-file Specifies the file to use for automatic mimetype lookup. Defaults to @samp{""}. @@ -19010,7 +19010,7 @@ Defaults to @samp{#f}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string readme +@deftypevr {@code{cgit-configuration} parameter} file-object readme Text which will be used as default value for @code{cgit-repo-readme}. Defaults to @samp{""}. @@ -19128,7 +19128,7 @@ Defaults to @samp{#f}. @end deftypevr -@deftypevr {@code{cgit-configuration} parameter} string source-filter +@deftypevr {@code{cgit-configuration} parameter} file-object source-filter Specifies a command which will be invoked to format plaintext blobs in the tree view. @@ -19190,7 +19190,7 @@ Defaults to @samp{()}. @end deftypevr -@deftypevr {@code{repository-cgit-configuration} parameter} repo-string source-filter +@deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object source-filter Override the default @code{source-filter}. Defaults to @samp{""}. @@ -19204,7 +19204,7 @@ Defaults to @samp{""}. @end deftypevr -@deftypevr {@code{repository-cgit-configuration} parameter} repo-string about-filter +@deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object about-filter Override the default @code{about-filter}. Defaults to @samp{""}. @@ -19226,7 +19226,7 @@ Defaults to @samp{()}. @end deftypevr -@deftypevr {@code{repository-cgit-configuration} parameter} repo-string commit-filter +@deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object commit-filter Override the default @code{commit-filter}. Defaults to @samp{""}. @@ -19266,7 +19266,7 @@ Defaults to @samp{""}. @end deftypevr -@deftypevr {@code{repository-cgit-configuration} parameter} repo-string email-filter +@deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object email-filter Override the default @code{email-filter}. Defaults to @samp{""}. @@ -19336,7 +19336,7 @@ Defaults to @samp{#f}. @end deftypevr -@deftypevr {@code{repository-cgit-configuration} parameter} repo-string logo +@deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object logo URL which specifies the source of an image which will be used as a logo on this repo’s pages. @@ -19351,7 +19351,7 @@ Defaults to @samp{""}. @end deftypevr -@deftypevr {@code{repository-cgit-configuration} parameter} repo-string owner-filter +@deftypevr {@code{repository-cgit-configuration} parameter} repo-file-object owner-filter Override the default @code{owner-filter}. Defaults to @samp{""}. @@ -19436,6 +19436,7 @@ Defaults to @samp{()}. @end deftypevr + @c %end of fragment However, it could be that you just want to get a @code{cgitrc} up and diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm index 3c685f1b5..98e46e0b8 100644 --- a/gnu/services/cgit.scm +++ b/gnu/services/cgit.scm @@ -76,13 +76,12 @@ (string-delete #\? (symbol->string field-name))) (define (serialize-field field-name val) - (format #t "~a=~a\n" (uglify-field-name field-name) val)) + #~(format #f "~a=~a\n" #$(uglify-field-name field-name) #$val)) (define (serialize-string field-name val) - (if (string=? val "") "" (serialize-field field-name val))) - -(define (serialize-boolean field-name val) - (serialize-field field-name (if val 1 0))) + (if (and (string? val) (string=? val "")) + "" + (serialize-field field-name val))) (define (serialize-list field-name val) (if (null? val) "" (serialize-field field-name (string-join val)))) @@ -96,7 +95,10 @@ (exact-integer? val)) (define (serialize-integer field-name val) - (serialize-field field-name val)) + (serialize-field field-name (number->string val))) + +(define (serialize-boolean field-name val) + (serialize-integer field-name (if val 1 0))) (define (serialize-repository-cgit-configuration x) (serialize-configuration x repository-cgit-configuration-fields)) @@ -105,7 +107,13 @@ (list? val)) (define (serialize-repository-cgit-configuration-list field-name val) - (for-each serialize-repository-cgit-configuration val)) + #~(string-append + #$@(map serialize-repository-cgit-configuration val))) + +(define (file-object? val) + (or (file-like? val) (string? val))) +(define (serialize-file-object field-name val) + (serialize-string field-name val)) ;;; @@ -116,7 +124,7 @@ (and (list? val) (and-map nginx-server-configuration? val))) (define (serialize-nginx-server-configuration-list field-name val) - #f) + "") ;;; @@ -124,18 +132,18 @@ ;;; (define (serialize-repo-field field-name val) - (format #t "repo.~a=~a\n" (uglify-field-name field-name) val)) + #~(format #f "repo.~a=~a\n" #$(uglify-field-name field-name) #$val)) (define (serialize-repo-list field-name val) (if (null? val) "" (serialize-repo-field field-name (string-join val)))) (define repo-boolean? boolean?) -(define (serialize-repo-boolean field-name val) - (serialize-repo-field field-name (if val 1 0))) - (define (serialize-repo-integer field-name val) - (serialize-repo-field field-name val)) + (serialize-repo-field field-name (number->string val))) + +(define (serialize-repo-boolean field-name val) + (serialize-repo-integer field-name (if val 1 0))) (define repo-list? list?) @@ -144,23 +152,26 @@ (define (serialize-repo-string field-name val) (if (string=? val "") "" (serialize-repo-field field-name val))) +(define repo-file-object? file-object?) +(define serialize-repo-file-object serialize-repo-string) + (define module-link-path? list?) (define (serialize-module-link-path field-name val) (if (null? val) "" (match val ((path text) - (format #t "repo.module-link.~a=~a\n" path text))))) + (format #f "repo.module-link.~a=~a\n" path text))))) (define repository-directory? string?) (define (serialize-repository-directory _ val) - (if (string=? val "") "" (format #t "scan-path=~a\n" val))) + (if (string=? val "") "" (format #f "scan-path=~a\n" val))) (define mimetype-alist? list?) (define (serialize-mimetype-alist field-name val) - (format #t "# Mimetypes\n~a" + (format #f "# Mimetypes\n~a" (string-join (map (match-lambda ((extension mimetype) @@ -174,13 +185,13 @@ "A mask of snapshot formats for this repo that cgit generates links for, restricted by the global @code{snapshots} setting.") (source-filter - (repo-string "") + (repo-file-object "") "Override the default @code{source-filter}.") (url (repo-string "") "The relative URL used to access the repository.") (about-filter - (repo-string "") + (repo-file-object "") "Override the default @code{about-filter}.") (branch-sort (repo-string "") @@ -190,7 +201,7 @@ ref list, and when set to @samp{name} enables ordering by branch name.") (repo-list '()) "A list of URLs which can be used to clone repo.") (commit-filter - (repo-string "") + (repo-file-object "") "Override the default @code{commit-filter}.") (commit-sort (repo-string "") @@ -209,7 +220,7 @@ is no suitable HEAD.") (repo-string "") "The value to show as repository homepage.") (email-filter - (repo-string "") + (repo-file-object "") "Override the default @code{email-filter}.") (enable-commit-graph? (repo-boolean #f) @@ -243,14 +254,14 @@ repository index.") (repo-boolean #f) "Flag which, when set to @samp{#t}, ignores the repository.") (logo - (repo-string "") + (repo-file-object "") "URL which specifies the source of an image which will be used as a logo on this repo’s pages.") (logo-link (repo-string "") "URL loaded when clicking on the cgit logo image.") (owner-filter - (repo-string "") + (repo-file-object "") "Override the default @code{owner-filter}.") (module-link (repo-string "") @@ -296,7 +307,7 @@ after this option will inherit the current section name.") (nginx-server-configuration-list (list %cgit-configuration-nginx)) "NGINX configuration.") (about-filter - (string "") + (file-object "") "Specifies a command which will be invoked to format the content of about pages (both top-level and for each repository).") (agefile @@ -304,7 +315,7 @@ pages (both top-level and for each repository).") "Specifies a path, relative to each repository path, which can be used to specify the date and time of the youngest commit in the repository.") (auth-filter - (string "") + (file-object "") "Specifies a command that will be invoked for authenticating repository access.") (branch-sort @@ -357,7 +368,7 @@ generates valid clone URLs for the repository.") (list '()) "List of @code{clone-url} templates.") (commit-filter - (string "") + (file-object "") "Command which will be invoked to format commit messages.") (commit-sort (string "git log") @@ -365,10 +376,10 @@ generates valid clone URLs for the repository.") commit log, and when set to @samp{topo} enables strict topological ordering.") (css - (string "/share/cgit/cgit.css") + (file-object "/share/cgit/cgit.css") "URL which specifies the css document to include in all cgit pages.") (email-filter - (string "") + (file-object "") "Specifies a command which will be invoked to format names and email address of committers, authors, and taggers, as represented in various places throughout the cgit interface.") @@ -432,7 +443,7 @@ links for plaintext blobs printed in the tree view.") "Flag which, when set to @samp{#f}, will allow cgit to use Git config to set any repo specific settings.") (favicon - (string "/favicon.ico") + (file-object "/favicon.ico") "URL used as link to a shortcut icon for cgit.") (footer (string "") @@ -448,7 +459,7 @@ verbatim in the HTML HEAD section on all pages.") "The content of the file specified with this option will be included verbatim at the top of all pages.") (include - (string "") + (file-object "") "Name of a configfile to include before the rest of the current config- file is parsed.") (index-header @@ -464,14 +475,14 @@ verbatim below the heading on the repository index page.") "Flag which, if set to @samp{#t}, makes cgit print commit and tag times in the servers timezone.") (logo - (string "/share/cgit/cgit.png") + (file-object "/share/cgit/cgit.png") "URL which specifies the source of an image which will be used as a logo on all cgit pages.") (logo-link (string "") "URL loaded when clicking on the cgit logo image.") (owner-filter - (string "") + (file-object "") "Command which will be invoked to format the Owner column of the main page.") (max-atom-items @@ -508,7 +519,7 @@ on the repository index page.") (svg "image/svg+xml"))) "Mimetype for the specified filename extension.") (mimetype-file - (string "") + (file-object "") "Specifies the file to use for automatic mimetype lookup.") (module-link (string "") @@ -533,7 +544,7 @@ header on all pages.") ;; "A list of subdirectories inside of @code{repository-directory}, ;; relative to it, that should loaded as Git repositories.") (readme - (string "") + (file-object "") "Text which will be used as default value for @code{cgit-repo-readme}.") (remove-suffix? (boolean #f) @@ -591,7 +602,7 @@ many path elements from each repo path to use as a default section name.") "If set to @samp{#t} shows side-by-side diffs instead of unidiffs per default.") (source-filter - (string "") + (file-object "") "Specifies a command which will be invoked to format plaintext blobs in the tree view.") (summary-branches @@ -640,16 +651,14 @@ for cgit to allow access to that repository.") (config-str (if opaque-config? (opaque-cgit-configuration-cgitrc config) - (with-output-to-string - (lambda () - (serialize-configuration config - cgit-configuration-fields)))))) + (serialize-configuration config cgit-configuration-fields)))) #~(begin (use-modules (guix build utils)) (mkdir-p #$(if opaque-config? (opaque-cgit-configuration-cache-root config) (cgit-configuration-cache-root config))) - (copy-file #$(plain-file "cgitrc" config-str) "/etc/cgitrc")))) + (copy-file #$(mixed-text-file "cgitrc" config-str) + "/etc/cgitrc")))) (define (cgit-configuration-nginx-config config) (if (opaque-cgit-configuration? config) -- 2.17.0 From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 4/5] services: cgit: Enforce serialization order. Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Apr 2018 17:08:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152312084811566 (code B ref 31089); Sat, 07 Apr 2018 17:08:03 +0000 Received: (at 31089) by debbugs.gnu.org; 7 Apr 2018 17:07:28 +0000 Received: from localhost ([127.0.0.1]:41474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJH-00030O-UM for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:28 -0400 Received: from mail.lassieur.org ([83.152.10.219]:50376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJF-0002za-Li for 31089@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:26 -0400 Received: from localhost.localdomain (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id c2056c5a (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <31089@debbugs.gnu.org>; Sat, 7 Apr 2018 17:07:21 +0000 (UTC) From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Sat, 7 Apr 2018 19:07:08 +0200 Message-Id: <20180407170709.22160-4-clement@lassieur.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180407170709.22160-1-clement@lassieur.org> References: <20180407170709.22160-1-clement@lassieur.org> X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This distinguishes fields whose order matters, and makes sure further changes won't inadvertently change the order. * gnu/services/cgit.scm (serialize-cgit-configuration): New procedure that serializes fields with a precise order. (cgit-activation): Replace the generic SERIALIZE-CONFIGURATION with SERIALIZE-CGIT-CONFIGURATION. --- gnu/services/cgit.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm index 98e46e0b8..f53306cd3 100644 --- a/gnu/services/cgit.scm +++ b/gnu/services/cgit.scm @@ -631,6 +631,17 @@ for cgit to allow access to that repository.") (list '()) "Extra options will be appended to cgitrc file.")) +(define (serialize-cgit-configuration config) + (define (rest? field) + (not (memq (configuration-field-name field) + '(repositories)))) + #~(string-append + #$(let ((rest (filter rest? cgit-configuration-fields))) + (serialize-configuration config rest)) + #$(serialize-repository-cgit-configuration-list + 'repositories + (cgit-configuration-repositories config)))) + (define-configuration opaque-cgit-configuration (cgit (package cgit) @@ -651,7 +662,7 @@ for cgit to allow access to that repository.") (config-str (if opaque-config? (opaque-cgit-configuration-cgitrc config) - (serialize-configuration config cgit-configuration-fields)))) + (serialize-cgit-configuration config)))) #~(begin (use-modules (guix build utils)) (mkdir-p #$(if opaque-config? -- 2.17.0 From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 5/5] services: cgit: Add support for project-list. Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Apr 2018 17:08:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152312084811572 (code B ref 31089); Sat, 07 Apr 2018 17:08:03 +0000 Received: (at 31089) by debbugs.gnu.org; 7 Apr 2018 17:07:28 +0000 Received: from localhost ([127.0.0.1]:41476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJI-00030V-49 for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:28 -0400 Received: from mail.lassieur.org ([83.152.10.219]:50376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rJG-0002za-E0 for 31089@debbugs.gnu.org; Sat, 07 Apr 2018 13:07:26 -0400 Received: from localhost.localdomain (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id bff41b62 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <31089@debbugs.gnu.org>; Sat, 7 Apr 2018 17:07:21 +0000 (UTC) From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Date: Sat, 7 Apr 2018 19:07:09 +0200 Message-Id: <20180407170709.22160-5-clement@lassieur.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180407170709.22160-1-clement@lassieur.org> References: <20180407170709.22160-1-clement@lassieur.org> X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * doc/guix.texi (Version Control Services): Update accordingly. * gnu/services/cgit.scm (cgit-configuration)[project-list]: New field. (serialize-project-list): New procedure that uses PLAIN-FILE to generate a file from the string list given by the user as input. (serialize-cgit-configuration): Make sure to serialize 'project-list' before 'repostory-directory'. --- doc/guix.texi | 9 +++++++++ gnu/services/cgit.scm | 28 ++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 35d23e1be..add29320e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19010,6 +19010,15 @@ Defaults to @samp{#f}. @end deftypevr +@deftypevr {@code{cgit-configuration} parameter} 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. + +Defaults to @samp{()}. + +@end deftypevr + @deftypevr {@code{cgit-configuration} parameter} file-object readme Text which will be used as default value for @code{cgit-repo-readme}. diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm index f53306cd3..a39c09721 100644 --- a/gnu/services/cgit.scm +++ b/gnu/services/cgit.scm @@ -163,6 +163,12 @@ ((path text) (format #f "repo.module-link.~a=~a\n" path text))))) +(define (serialize-project-list _ val) + (if (null? val) "" + (serialize-field + 'project-list + (plain-file "project-list" (string-join val "\n"))))) + (define repository-directory? string?) (define (serialize-repository-directory _ val) @@ -536,13 +542,11 @@ disabled.") (boolean #f) "Flag which, when set to @samp{#t}, will make cgit omit the standard header on all pages.") - ;; TODO: cgit expects a file name - ;; that should be created from a list of strings provided by the user. - ;; - ;; (project-list - ;; (string "") - ;; "A list of subdirectories inside of @code{repository-directory}, - ;; relative to it, that should loaded as Git repositories.") + (project-list + (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.") (readme (file-object "") "Text which will be used as default value for @code{cgit-repo-readme}.") @@ -634,10 +638,18 @@ for cgit to allow access to that repository.") (define (serialize-cgit-configuration config) (define (rest? field) (not (memq (configuration-field-name field) - '(repositories)))) + '(project-list + repository-directory + repositories)))) #~(string-append #$(let ((rest (filter rest? cgit-configuration-fields))) (serialize-configuration config rest)) + #$(serialize-project-list + 'project-list + (cgit-configuration-project-list config)) + #$(serialize-repository-directory + 'repository-directory + (cgit-configuration-repository-directory config)) #$(serialize-repository-cgit-configuration-list 'repositories (cgit-configuration-repositories config)))) -- 2.17.0 From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects. Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Apr 2018 07:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.15232583821720 (code B ref 31089); Mon, 09 Apr 2018 07:20:02 +0000 Received: (at 31089) by debbugs.gnu.org; 9 Apr 2018 07:19:42 +0000 Received: from localhost ([127.0.0.1]:43092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f5R5Z-0000Rf-Rz for submit@debbugs.gnu.org; Mon, 09 Apr 2018 03:19:42 -0400 Received: from mail.lassieur.org ([83.152.10.219]:34934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f5R5Y-0000RX-He for 31089@debbugs.gnu.org; Mon, 09 Apr 2018 03:19:41 -0400 Received: from newt (46.218.109.88 [46.218.109.88]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id 091a75a2 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for <31089@debbugs.gnu.org>; Mon, 9 Apr 2018 07:19:38 +0000 (UTC) References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-3-clement@lassieur.org> User-agent: mu4e 1.0; emacs 25.3.1 From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <20180407170709.22160-3-clement@lassieur.org> Date: Mon, 09 Apr 2018 09:19:37 +0200 Message-ID: <87lgdw26eu.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Clément Lassieur writes: > * doc/guix.texi (Version Control Services): Update accordingly. > * gnu/services/cgit.scm (serialize-field, serialize-string, serialize-boolean, > serialize-integer, serialize-repository-cgit-configuration-list, > serialize-nginx-server-configuration-list, serialize-repo-field, > serialize-repo-boolean, serialize-repo-integer, serialize-module-link-path, > serialize-repository-directory, serialize-mimetype-alist): Return strings or > string-valued gexps and stop printing. > (repository-cgit-configuration)[source-filter, about-filter, commit-filter, > logo, owner-filter], (cgit-configuration)[auth-filter, commit-filter, css, > email-filter, favicon, include, logo, owner-filter, mimetype-file, readme, > source-filter]: Replace STRING with FILE-OBJECT. > (file-object?, serialize-file-object, repo-file-object?, > serialize-repo-file-object): New procedures. > (cgit-activation): Use SERIALIZE-CONFIGURATION's return value with > MIXED-TEXT-FILE instead of using its output with PLAIN-FILE. > --- > doc/guix.texi | 37 +++++++++--------- > gnu/services/cgit.scm | 87 ++++++++++++++++++++++++------------------- > 2 files changed, 67 insertions(+), 57 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 738fdf65c..35d23e1be 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -18552,7 +18552,7 @@ NGINX configuration. I'll also add: The @code{file-object} type designates either a file-like object (@pxref{G-Expressions, file-like objects}) or a string. > @end deftypevr > > -@deftypevr {@code{cgit-configuration} parameter} string about-filter > +@deftypevr {@code{cgit-configuration} parameter} file-object about-filter > Specifies a command which will be invoked to format the content of about > pages (both top-level and for each repository). From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 1/5] services: cgit: Simplify 'uglify-field-name'. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Apr 2018 20:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152339378110399 (code B ref 31089); Tue, 10 Apr 2018 20:57:02 +0000 Received: (at 31089) by debbugs.gnu.org; 10 Apr 2018 20:56:21 +0000 Received: from localhost ([127.0.0.1]:45461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60JR-0002hf-0V for submit@debbugs.gnu.org; Tue, 10 Apr 2018 16:56:21 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:44482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60JO-0002hV-R4 for 31089@debbugs.gnu.org; Tue, 10 Apr 2018 16:56:19 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 30144126D3; Tue, 10 Apr 2018 22:56:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u1-1QF993hrM; Tue, 10 Apr 2018 22:56:17 +0200 (CEST) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 5713F126CD; Tue, 10 Apr 2018 22:56:17 +0200 (CEST) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <874lknc5im.fsf@lassieur.org> <20180407170709.22160-1-clement@lassieur.org> Date: Tue, 10 Apr 2018 22:56:16 +0200 In-Reply-To: <20180407170709.22160-1-clement@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Sat, 7 Apr 2018 19:07:05 +0200") Message-ID: <87zi2a6arz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello, Cl=C3=A9ment Lassieur skribis: > * gnu/services/cgit.scm (uglify-field-name): Remove STRING-JOIN and > STRING-SPLIT. LGTM! > - (string-join (string-split (string-delete #\? str) #\-) "-"))) Funny. :-) Ludo=E2=80=99. From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 2/5] services: cgit: Simplify 'serialize-module-link-path'. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Apr 2018 20:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152339380110433 (code B ref 31089); Tue, 10 Apr 2018 20:57:02 +0000 Received: (at 31089) by debbugs.gnu.org; 10 Apr 2018 20:56:41 +0000 Received: from localhost ([127.0.0.1]:45464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60Jl-0002iD-7T for submit@debbugs.gnu.org; Tue, 10 Apr 2018 16:56:41 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:44496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60Jj-0002i6-QF for 31089@debbugs.gnu.org; Tue, 10 Apr 2018 16:56:40 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 46B20126D3; Tue, 10 Apr 2018 22:56:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iSjRv-BcLVNp; Tue, 10 Apr 2018 22:56:38 +0200 (CEST) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 689BD126CD; Tue, 10 Apr 2018 22:56:38 +0200 (CEST) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-2-clement@lassieur.org> Date: Tue, 10 Apr 2018 22:56:38 +0200 In-Reply-To: <20180407170709.22160-2-clement@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Sat, 7 Apr 2018 19:07:06 +0200") Message-ID: <87vacy6ard.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Cl=C3=A9ment Lassieur skribis: > * gnu/services/cgit.scm (serialize-module-link-path): Remove STRING-DROP-= RIGHT > and UGLIFY-FIELD-NAME. OK. From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Apr 2018 21:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152339396710695 (code B ref 31089); Tue, 10 Apr 2018 21:00:01 +0000 Received: (at 31089) by debbugs.gnu.org; 10 Apr 2018 20:59:27 +0000 Received: from localhost ([127.0.0.1]:45469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60MR-0002mR-K2 for submit@debbugs.gnu.org; Tue, 10 Apr 2018 16:59:27 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:44520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60MP-0002mG-9D for 31089@debbugs.gnu.org; Tue, 10 Apr 2018 16:59:25 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id AA0F3126E4; Tue, 10 Apr 2018 22:59:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6fMC4L91T8Q5; Tue, 10 Apr 2018 22:59:23 +0200 (CEST) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 9B867126D3; Tue, 10 Apr 2018 22:59:23 +0200 (CEST) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-3-clement@lassieur.org> Date: Tue, 10 Apr 2018 22:59:23 +0200 In-Reply-To: <20180407170709.22160-3-clement@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Sat, 7 Apr 2018 19:07:07 +0200") Message-ID: <87r2nm6ams.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Cl=C3=A9ment Lassieur skribis: > * doc/guix.texi (Version Control Services): Update accordingly. > * gnu/services/cgit.scm (serialize-field, serialize-string, serialize-boo= lean, > serialize-integer, serialize-repository-cgit-configuration-list, > serialize-nginx-server-configuration-list, serialize-repo-field, > serialize-repo-boolean, serialize-repo-integer, serialize-module-link-pat= h, > serialize-repository-directory, serialize-mimetype-alist): Return strings= or > string-valued gexps and stop printing. > (repository-cgit-configuration)[source-filter, about-filter, commit-filte= r, > logo, owner-filter], (cgit-configuration)[auth-filter, commit-filter, css, > email-filter, favicon, include, logo, owner-filter, mimetype-file, readme, > source-filter]: Replace STRING with FILE-OBJECT. > (file-object?, serialize-file-object, repo-file-object?, > serialize-repo-file-object): New procedures. > (cgit-activation): Use SERIALIZE-CONFIGURATION's return value with > MIXED-TEXT-FILE instead of using its output with PLAIN-FILE. Nice! > (config-str > (if opaque-config? > (opaque-cgit-configuration-cgitrc config) > - (with-output-to-string > - (lambda () > - (serialize-configuration config > - cgit-configuration-fields))))= )) > + (serialize-configuration config cgit-configuration-fields)= ))) > #~(begin > (use-modules (guix build utils)) > (mkdir-p #$(if opaque-config? > (opaque-cgit-configuration-cache-root config) > (cgit-configuration-cache-root config))) > - (copy-file #$(plain-file "cgitrc" config-str) "/etc/cgitrc")))) > + (copy-file #$(mixed-text-file "cgitrc" config-str) > + "/etc/cgitrc")))) For clarity, since =E2=80=98config-str=E2=80=99 is no longer a string (righ= t?), I=E2=80=99d rename it to just =E2=80=98config=E2=80=99 or something. Also, could it be that you=E2=80=99re missing =E2=80=98apply=E2=80=99 above= , as in: (apply mixed-text-file "cgitrc" config-str) ? Otherwise LGTM, thanks! Ludo=E2=80=99. From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 4/5] services: cgit: Enforce serialization order. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Apr 2018 21:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152339402710876 (code B ref 31089); Tue, 10 Apr 2018 21:01:01 +0000 Received: (at 31089) by debbugs.gnu.org; 10 Apr 2018 21:00:27 +0000 Received: from localhost ([127.0.0.1]:45473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60NO-0002pM-UU for submit@debbugs.gnu.org; Tue, 10 Apr 2018 17:00:27 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:44532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60NM-0002pD-NZ for 31089@debbugs.gnu.org; Tue, 10 Apr 2018 17:00:25 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 2BEB812B79; Tue, 10 Apr 2018 23:00:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I7nNR_XvFEnT; Tue, 10 Apr 2018 23:00:23 +0200 (CEST) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 1F4F6126D3; Tue, 10 Apr 2018 23:00:23 +0200 (CEST) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-4-clement@lassieur.org> Date: Tue, 10 Apr 2018 23:00:22 +0200 In-Reply-To: <20180407170709.22160-4-clement@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Sat, 7 Apr 2018 19:07:08 +0200") Message-ID: <87muya6al5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Cl=C3=A9ment Lassieur skribis: > This distinguishes fields whose order matters, and makes sure further cha= nges > won't inadvertently change the order. > > * gnu/services/cgit.scm (serialize-cgit-configuration): New procedure that > serializes fields with a precise order. > (cgit-activation): Replace the generic SERIALIZE-CONFIGURATION with > SERIALIZE-CGIT-CONFIGURATION. > --- > gnu/services/cgit.scm | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm > index 98e46e0b8..f53306cd3 100644 > --- a/gnu/services/cgit.scm > +++ b/gnu/services/cgit.scm > @@ -631,6 +631,17 @@ for cgit to allow access to that repository.") > (list '()) > "Extra options will be appended to cgitrc file.")) >=20=20 > +(define (serialize-cgit-configuration config) > + (define (rest? field) > + (not (memq (configuration-field-name field) > + '(repositories)))) > + #~(string-append > + #$(let ((rest (filter rest? cgit-configuration-fields))) > + (serialize-configuration config rest)) > + #$(serialize-repository-cgit-configuration-list > + 'repositories > + (cgit-configuration-repositories config)))) Please add a comment here explaining the story about field ordering. OK with this change! Ludo=E2=80=99. From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 5/5] services: cgit: Add support for project-list. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Apr 2018 21:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.152339406010923 (code B ref 31089); Tue, 10 Apr 2018 21:01:02 +0000 Received: (at 31089) by debbugs.gnu.org; 10 Apr 2018 21:01:00 +0000 Received: from localhost ([127.0.0.1]:45476 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60Nw-0002q7-78 for submit@debbugs.gnu.org; Tue, 10 Apr 2018 17:01:00 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:44540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f60Nv-0002q0-Ei for 31089@debbugs.gnu.org; Tue, 10 Apr 2018 17:00:59 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E4E00131F6; Tue, 10 Apr 2018 23:00:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M397ju74Go2L; Tue, 10 Apr 2018 23:00:58 +0200 (CEST) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id E03DE126D3; Tue, 10 Apr 2018 23:00:57 +0200 (CEST) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-5-clement@lassieur.org> Date: Tue, 10 Apr 2018 23:00:57 +0200 In-Reply-To: <20180407170709.22160-5-clement@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Sat, 7 Apr 2018 19:07:09 +0200") Message-ID: <87in8y6ak6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Cl=C3=A9ment Lassieur skribis: > * doc/guix.texi (Version Control Services): Update accordingly. > * gnu/services/cgit.scm (cgit-configuration)[project-list]: New field. > (serialize-project-list): New procedure that uses PLAIN-FILE to generate a > file from the string list given by the user as input. > (serialize-cgit-configuration): Make sure to serialize 'project-list' bef= ore > 'repostory-directory'. Pretty cool. LGTM, thanks! Ludo'. From unknown Sun Jun 22 22:46:23 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects. Resent-From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 11 Apr 2018 08:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31089 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 31089@debbugs.gnu.org Received: via spool by 31089-submit@debbugs.gnu.org id=B31089.15234357247617 (code B ref 31089); Wed, 11 Apr 2018 08:36:01 +0000 Received: (at 31089) by debbugs.gnu.org; 11 Apr 2018 08:35:24 +0000 Received: from localhost ([127.0.0.1]:45687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6BDv-0001yl-Ni for submit@debbugs.gnu.org; Wed, 11 Apr 2018 04:35:24 -0400 Received: from mail.lassieur.org ([83.152.10.219]:52410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6BDu-0001yd-1U for 31089@debbugs.gnu.org; Wed, 11 Apr 2018 04:35:22 -0400 Received: from newt (46.218.109.88 [46.218.109.88]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id f7dbf4ad (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Wed, 11 Apr 2018 08:35:20 +0000 (UTC) References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-3-clement@lassieur.org> <87r2nm6ams.fsf@gnu.org> User-agent: mu4e 1.0; emacs 25.3.1 From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <87r2nm6ams.fsf@gnu.org> Date: Wed, 11 Apr 2018 10:35:19 +0200 Message-ID: <87woxei1iw.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ludovic Courtès writes: >> (config-str >> (if opaque-config? >> (opaque-cgit-configuration-cgitrc config) >> - (with-output-to-string >> - (lambda () >> - (serialize-configuration config >> - cgit-configuration-fields)))))) >> + (serialize-configuration config cgit-configuration-fields)))) >> #~(begin >> (use-modules (guix build utils)) >> (mkdir-p #$(if opaque-config? >> (opaque-cgit-configuration-cache-root config) >> (cgit-configuration-cache-root config))) >> - (copy-file #$(plain-file "cgitrc" config-str) "/etc/cgitrc")))) >> + (copy-file #$(mixed-text-file "cgitrc" config-str) >> + "/etc/cgitrc")))) > > For clarity, since ‘config-str’ is no longer a string (right?), I’d > rename it to just ‘config’ or something. > > Also, could it be that you’re missing ‘apply’ above, as in: > > (apply mixed-text-file "cgitrc" config-str) > > ? Yes, config-str is still a string (or a string-valued gexp). I use mixed-text-file because it can take gexps as arguments, whereas plain-file can't. > Otherwise LGTM, thanks! Thank you for the review! Clément From unknown Sun Jun 22 22:46:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Subject: bug#31089: closed (Re: [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects.) Message-ID: References: <87woxd8rxp.fsf@lassieur.org> <874lknc5im.fsf@lassieur.org> X-Gnu-PR-Message: they-closed 31089 X-Gnu-PR-Package: guix-patches Reply-To: 31089@debbugs.gnu.org Date: Wed, 11 Apr 2018 19:28:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1523474882-17392-1" This is a multi-part message in MIME format... ------------=_1523474882-17392-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #31089: cgit service: add support for file-like objects which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 31089@debbugs.gnu.org. --=20 31089: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D31089 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1523474882-17392-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 31089-done) by debbugs.gnu.org; 11 Apr 2018 19:27:19 +0000 Received: from localhost ([127.0.0.1]:46507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6LOo-0004VY-QP for submit@debbugs.gnu.org; Wed, 11 Apr 2018 15:27:19 -0400 Received: from mail.lassieur.org ([83.152.10.219]:54388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f6LOm-0004VN-Tx for 31089-done@debbugs.gnu.org; Wed, 11 Apr 2018 15:27:17 -0400 Received: from rodion (88.191.118.83 [88.191.118.83]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id 9977da95 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Wed, 11 Apr 2018 19:27:15 +0000 (UTC) References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-3-clement@lassieur.org> <87r2nm6ams.fsf@gnu.org> <87woxei1iw.fsf@lassieur.org> User-agent: mu4e 1.0; emacs 25.3.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects. In-reply-to: <87woxei1iw.fsf@lassieur.org> Date: Wed, 11 Apr 2018 21:27:14 +0200 Message-ID: <87woxd8rxp.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31089-done Cc: 31089-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Clément Lassieur writes: > Ludovic Courtès writes: > >>> (config-str >>> (if opaque-config? >>> (opaque-cgit-configuration-cgitrc config) >>> - (with-output-to-string >>> - (lambda () >>> - (serialize-configuration config >>> - cgit-configuration-fields)))))) >>> + (serialize-configuration config cgit-configuration-fields)))) >>> #~(begin >>> (use-modules (guix build utils)) >>> (mkdir-p #$(if opaque-config? >>> (opaque-cgit-configuration-cache-root config) >>> (cgit-configuration-cache-root config))) >>> - (copy-file #$(plain-file "cgitrc" config-str) "/etc/cgitrc")))) >>> + (copy-file #$(mixed-text-file "cgitrc" config-str) >>> + "/etc/cgitrc")))) >> >> For clarity, since ‘config-str’ is no longer a string (right?), I’d >> rename it to just ‘config’ or something. >> >> Also, could it be that you’re missing ‘apply’ above, as in: >> >> (apply mixed-text-file "cgitrc" config-str) >> >> ? > > Yes, config-str is still a string (or a string-valued gexp). I use > mixed-text-file because it can take gexps as arguments, whereas > plain-file can't. > >> Otherwise LGTM, thanks! > > Thank you for the review! > > Clément Pushed. ------------=_1523474882-17392-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Apr 2018 17:04:36 +0000 Received: from localhost ([127.0.0.1]:41459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rGW-0002vT-6i for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:04:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4rGU-0002vH-Mk for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:04:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4rGO-0000X5-UY for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:04:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43005) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4rGO-0000Wz-Ra for submit@debbugs.gnu.org; Sat, 07 Apr 2018 13:04:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4rGN-0002QR-VB for guix-patches@gnu.org; Sat, 07 Apr 2018 13:04:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4rGK-0000Vp-11 for guix-patches@gnu.org; Sat, 07 Apr 2018 13:04:27 -0400 Received: from mail.lassieur.org ([83.152.10.219]:48588) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4rGJ-0000Rt-MO for guix-patches@gnu.org; Sat, 07 Apr 2018 13:04:23 -0400 Received: from rodion (192.168.0.254 [192.168.0.254]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id dabded54 (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for ; Sat, 7 Apr 2018 17:04:17 +0000 (UTC) User-agent: mu4e 1.0; emacs 25.3.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: guix-patches@gnu.org Subject: cgit service: add support for file-like objects Date: Sat, 07 Apr 2018 19:04:17 +0200 Message-ID: <874lknc5im.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) Hi, These patches aim to add support for file-like objects and a few other things related to the cgit service. Comments are welcome, Clément ------------=_1523474882-17392-1--