GNU bug report logs - #66609
[PATCH 0/1] services: admin: Export rottlog-configuration accessors.

Previous Next

Package: guix-patches;

Reported by: Simon Tournier <zimon.toutoune <at> gmail.com>

Date: Wed, 18 Oct 2023 15:10:02 UTC

Severity: normal

Tags: patch

Done: Simon Tournier <zimon.toutoune <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Simon Tournier <zimon.toutoune <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#66609: closed ([PATCH 0/1] services: admin: Export
 rottlog-configuration accessors.)
Date: Tue, 24 Oct 2023 18:15:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 24 Oct 2023 18:56:13 +0200
with message-id <87edhkhscy.fsf <at> gmail.com>
and subject line Re: [bug#66609] [PATCH 1/1] services: admin: Export rottlog-configuration accessors.
has caused the debbugs.gnu.org bug report #66609,
regarding [PATCH 0/1] services: admin: Export rottlog-configuration accessors.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
66609: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66609
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Simon Tournier <zimon.toutoune <at> gmail.com>
Subject: [PATCH 0/1] services: admin: Export rottlog-configuration accessors.
Date: Wed, 18 Oct 2023 17:08:59 +0200
Hi,

In some cases, people have a template configuration, and then another
configuration with some specific ’log-rotation’ files.  Then, they want to
custom-merge these configurations.  Therefore, they need to access field
values of <rottlog-configuration>.

For one trivial example: replace ’log-rotation’ of syslog defined with
%rotated-files by some others – do not ask why. :-)

--8<---------------cut here---------------start------------->8---
(use-modules (gnu services base)
             (gnu services admin)
             (srfi srfi-1))

(define config-template (rottlog-configuration))

(define some-logs
  (list (log-rotation
         (files '("/var/log/foo"
                  "/var/log/bar"
                  "/var/log/baz"))
         (frequency 'weekly)
         (options `("rotate 16"
                    "sharedscripts"
                    ,@%default-log-rotation-options)))
        (log-rotation
         (files '("/var/log/some-evil.log"))
         (options `("rotate 4"
                    ,@%default-log-rotation-options)))))

(define other-config (rottlog-configuration
                      (rotations some-logs)))

(define my-config
  (rottlog-configuration
   (inherit config-template)
   (rotations (filter
               (lambda (log)
                 (not (lset= eq? (log-rotation-files log) %rotated-files)))
               (append-map rottlog-configuration-rotations
                           (list other-config
                                 config-template))))))
--8<---------------cut here---------------end--------------->8---

Without this patch, it needs to rely on ’@@’ which is not nice.

--8<---------------cut here---------------start------------->8---
(define rottlog-configuration-rotations
  (@@ (gnu services admin) rottlog-rotations))
--8<---------------cut here---------------end--------------->8---

Therefore, let export them!  To stay consistent with the schema for naming,
the accessors are renamed rottlog-configuration-

Cheers,
simon



Simon Tournier (1):
  services: admin: Export rottlog-configuration accessors.

 gnu/services/admin.scm | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)


base-commit: 202c97c4ce2e948266b8b6ee4d80631adbfba92b
-- 
2.38.1



[Message part 3 (message/rfc822, inline)]
From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Bruno Victal <mirai <at> makinata.eu>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 66609-done <at> debbugs.gnu.org
Subject: Re: [bug#66609] [PATCH 1/1] services: admin: Export
 rottlog-configuration accessors.
Date: Tue, 24 Oct 2023 18:56:13 +0200
Hi,

On Wed, 18 Oct 2023 at 16:44, Bruno Victal <mirai <at> makinata.eu> wrote:

> The changes don't look original enough to warrant this IMO, other
> than that it LGTM.

Thanks Bruno and Ludo.  Pushed as 7e4324575c.  Closing.

Cheers,
simon


This bug report was last modified 1 year and 208 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.