Subject: bug#71586: closed (Re: [bug#71586] [PATCH v3] services: web: Improve nginx formatting for extra-content)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 27 Jun 2024 10:35:02 +0000

Your bug report

#71586: [PATCH] services: web: Improve nginx formatting for extra-content

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 [email-masked].

-- 
71586: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71586
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#71586] [PATCH v3] services: web: Improve nginx formatting for extra-content
From: Christopher Baines <[email-masked]>
To: Richard Sent <[email-masked]>
Cc: [email-masked]
Date: Thu, 27 Jun 2024 11:33:56 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Richard Sent <[email-masked]> writes:

> When extra-content is a list, add 4 space indentation and a newline to every
> line. If it's a string, continue inserting it directly. This makes the list
> serialization behavior more consistent with other services.
>
> * gnu/services/web (default-nginx-config): Support lists.
> * doc/guix.texi (Web Services) [nginx-configuration]: Document it.
>
> Change-Id: Iec8614ba3cfc37292a566197e8d39b352b04846a
> ---
>  doc/guix.texi        | 13 +++++++++++--
>  gnu/services/web.scm |  9 ++++++++-
>  2 files changed, 19 insertions(+), 3 deletions(-)

Thanks for the patch, I forgot to close the issue yesterday but I pushed
this to master as da3e71f472c2335f56c3d07758715a514fdb3a9d.

Chris

Subject: [PATCH] services: web: Improve nginx formatting for extra-content
From: Richard Sent <[email-masked]>
To: [email-masked]
Cc: Richard Sent <[email-masked]>
Date: Sat, 15 Jun 2024 23:57:12 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/services/web (default-nginx-config): When extra-content is a list, add 4
space indentation and a newline to every line. If it's a string, continue
inserting it directly. This makes the list serialization behavior more
consistent with other services.

Change-Id: Iec8614ba3cfc37292a566197e8d39b352b04846a
---
 gnu/services/web.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 406117c457..094b1e4b45 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -771,7 +771,12 @@ (define (default-nginx-config config)
            "\n"
            (map emit-nginx-upstream-config upstream-blocks)
            (map emit-nginx-server-config server-blocks)
-           extra-content
+           (match extra-content
+             ((? string? extra-content) extra-content)
+             ((? list? extra-content)
+              (map (lambda (line)
+                     (simple-format #f "    ~A\n" line))
+                   extra-content)))
            "\n}\n"))))
 
 (define %nginx-accounts

base-commit: 612e4dd98f7d1d015e405af9d029bede3fe3c280
-- 
2.45.1