diff options
| author | Clément Lassieur <clement@lassieur.org> | 2018-03-20 21:15:05 +0100 |
|---|---|---|
| committer | Clément Lassieur <clement@lassieur.org> | 2018-04-11 21:23:59 +0200 |
| commit | e5fe544eaac4d478a09a9e22ffa460602f770910 (patch) | |
| tree | d319f1d15e21f30bb2c017cc64012ca0070d8c5e /gnu/services/cgit.scm | |
| parent | 80b76b93506cadc967164cb07093f86bafb5aa77 (diff) | |
services: cgit: Add support for project-list.
* 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'.
Diffstat (limited to 'gnu/services/cgit.scm')
| -rw-r--r-- | gnu/services/cgit.scm | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm index 73d459ccf58..8ef12cd5a0e 100644 --- a/gnu/services/cgit.scm +++ b/gnu/services/cgit.scm | |||
| @@ -163,6 +163,12 @@ | |||
| 163 | ((path text) | 163 | ((path text) |
| 164 | (format #f "repo.module-link.~a=~a\n" path text))))) | 164 | (format #f "repo.module-link.~a=~a\n" path text))))) |
| 165 | 165 | ||
| 166 | (define (serialize-project-list _ val) | ||
| 167 | (if (null? val) "" | ||
| 168 | (serialize-field | ||
| 169 | 'project-list | ||
| 170 | (plain-file "project-list" (string-join val "\n"))))) | ||
| 171 | |||
| 166 | (define repository-directory? string?) | 172 | (define repository-directory? string?) |
| 167 | 173 | ||
| 168 | (define (serialize-repository-directory _ val) | 174 | (define (serialize-repository-directory _ val) |
| @@ -536,13 +542,11 @@ disabled.") | |||
| 536 | (boolean #f) | 542 | (boolean #f) |
| 537 | "Flag which, when set to @samp{#t}, will make cgit omit the standard | 543 | "Flag which, when set to @samp{#t}, will make cgit omit the standard |
| 538 | header on all pages.") | 544 | header on all pages.") |
| 539 | ;; TODO: cgit expects a file name | 545 | (project-list |
| 540 | ;; that should be created from a list of strings provided by the user. | 546 | (list '()) |
| 541 | ;; | 547 | "A list of subdirectories inside of @code{repository-directory}, relative |
| 542 | ;; (project-list | 548 | to it, that should loaded as Git repositories. An empty list means that all |
| 543 | ;; (string "") | 549 | subdirectories will be loaded.") |
| 544 | ;; "A list of subdirectories inside of @code{repository-directory}, | ||
| 545 | ;; relative to it, that should loaded as Git repositories.") | ||
| 546 | (readme | 550 | (readme |
| 547 | (file-object "") | 551 | (file-object "") |
| 548 | "Text which will be used as default value for @code{cgit-repo-readme}.") | 552 | "Text which will be used as default value for @code{cgit-repo-readme}.") |
| @@ -636,10 +640,18 @@ for cgit to allow access to that repository.") | |||
| 636 | (define (serialize-cgit-configuration config) | 640 | (define (serialize-cgit-configuration config) |
| 637 | (define (rest? field) | 641 | (define (rest? field) |
| 638 | (not (memq (configuration-field-name field) | 642 | (not (memq (configuration-field-name field) |
| 639 | '(repositories)))) | 643 | '(project-list |
| 644 | repository-directory | ||
| 645 | repositories)))) | ||
| 640 | #~(string-append | 646 | #~(string-append |
| 641 | #$(let ((rest (filter rest? cgit-configuration-fields))) | 647 | #$(let ((rest (filter rest? cgit-configuration-fields))) |
| 642 | (serialize-configuration config rest)) | 648 | (serialize-configuration config rest)) |
| 649 | #$(serialize-project-list | ||
| 650 | 'project-list | ||
| 651 | (cgit-configuration-project-list config)) | ||
| 652 | #$(serialize-repository-directory | ||
| 653 | 'repository-directory | ||
| 654 | (cgit-configuration-repository-directory config)) | ||
| 643 | #$(serialize-repository-cgit-configuration-list | 655 | #$(serialize-repository-cgit-configuration-list |
| 644 | 'repositories | 656 | 'repositories |
| 645 | (cgit-configuration-repositories config)))) | 657 | (cgit-configuration-repositories config)))) |
