diff options
| author | Clément Lassieur <clement@lassieur.org> | 2018-03-20 21:05:09 +0100 |
|---|---|---|
| committer | Clément Lassieur <clement@lassieur.org> | 2018-04-11 21:23:59 +0200 |
| commit | 80b76b93506cadc967164cb07093f86bafb5aa77 (patch) | |
| tree | 983dd7c4487bbde37b84c5d8383aaf1cc416f231 /gnu/services/cgit.scm | |
| parent | ad05e96e14ff61c5739a9f8fc79aba8ed6545d16 (diff) | |
services: cgit: Enforce serialization 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.
Diffstat (limited to 'gnu/services/cgit.scm')
| -rw-r--r-- | gnu/services/cgit.scm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm index 98e46e0b88d..73d459ccf58 100644 --- a/gnu/services/cgit.scm +++ b/gnu/services/cgit.scm | |||
| @@ -631,6 +631,19 @@ for cgit to allow access to that repository.") | |||
| 631 | (list '()) | 631 | (list '()) |
| 632 | "Extra options will be appended to cgitrc file.")) | 632 | "Extra options will be appended to cgitrc file.")) |
| 633 | 633 | ||
| 634 | ;; This distinguishes fields whose order matters, and makes sure further | ||
| 635 | ;; changes won't inadvertently change the order. | ||
| 636 | (define (serialize-cgit-configuration config) | ||
| 637 | (define (rest? field) | ||
| 638 | (not (memq (configuration-field-name field) | ||
| 639 | '(repositories)))) | ||
| 640 | #~(string-append | ||
| 641 | #$(let ((rest (filter rest? cgit-configuration-fields))) | ||
| 642 | (serialize-configuration config rest)) | ||
| 643 | #$(serialize-repository-cgit-configuration-list | ||
| 644 | 'repositories | ||
| 645 | (cgit-configuration-repositories config)))) | ||
| 646 | |||
| 634 | (define-configuration opaque-cgit-configuration | 647 | (define-configuration opaque-cgit-configuration |
| 635 | (cgit | 648 | (cgit |
| 636 | (package cgit) | 649 | (package cgit) |
| @@ -651,7 +664,7 @@ for cgit to allow access to that repository.") | |||
| 651 | (config-str | 664 | (config-str |
| 652 | (if opaque-config? | 665 | (if opaque-config? |
| 653 | (opaque-cgit-configuration-cgitrc config) | 666 | (opaque-cgit-configuration-cgitrc config) |
| 654 | (serialize-configuration config cgit-configuration-fields)))) | 667 | (serialize-cgit-configuration config)))) |
| 655 | #~(begin | 668 | #~(begin |
| 656 | (use-modules (guix build utils)) | 669 | (use-modules (guix build utils)) |
| 657 | (mkdir-p #$(if opaque-config? | 670 | (mkdir-p #$(if opaque-config? |
