unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Clément Lassieur" <clement@lassieur.org>
Cc: 31089@debbugs.gnu.org
Subject: [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects.
Date: Tue, 10 Apr 2018 22:59:23 +0200	[thread overview]
Message-ID: <87r2nm6ams.fsf@gnu.org> (raw)
In-Reply-To: <20180407170709.22160-3-clement@lassieur.org> ("Clément Lassieur"'s message of "Sat, 7 Apr 2018 19:07:07 +0200")

Clément Lassieur <clement@lassieur.org> skribis:

> * 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.

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 ‘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)

?

Otherwise LGTM, thanks!

Ludo’.

  parent reply	other threads:[~2018-04-10 21:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 17:04 [bug#31089] cgit service: add support for file-like objects Clément Lassieur
2018-04-07 17:07 ` [bug#31089] [PATCH 1/5] services: cgit: Simplify 'uglify-field-name' Clément Lassieur
2018-04-07 17:07   ` [bug#31089] [PATCH 2/5] services: cgit: Simplify 'serialize-module-link-path' Clément Lassieur
2018-04-10 20:56     ` Ludovic Courtès
2018-04-07 17:07   ` [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects Clément Lassieur
2018-04-09  7:19     ` Clément Lassieur
2018-04-10 20:59     ` Ludovic Courtès [this message]
2018-04-11  8:35       ` Clément Lassieur
2018-04-11 19:27         ` bug#31089: " Clément Lassieur
2018-04-07 17:07   ` [bug#31089] [PATCH 4/5] services: cgit: Enforce serialization order Clément Lassieur
2018-04-10 21:00     ` Ludovic Courtès
2018-04-07 17:07   ` [bug#31089] [PATCH 5/5] services: cgit: Add support for project-list Clément Lassieur
2018-04-10 21:00     ` Ludovic Courtès
2018-04-10 20:56   ` [bug#31089] [PATCH 1/5] services: cgit: Simplify 'uglify-field-name' Ludovic Courtès

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=87r2nm6ams.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=31089@debbugs.gnu.org \
    --cc=clement@lassieur.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).