From patchwork Wed Oct 18 15:10:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 54975 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 161B827BBEA; Wed, 18 Oct 2023 16:10:44 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2A83B27BBE2 for ; Wed, 18 Oct 2023 16:10:43 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt8By-000552-5G; Wed, 18 Oct 2023 11:10:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt8Bw-00054U-Pt for guix-patches@gnu.org; Wed, 18 Oct 2023 11:10:36 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt8Bw-0007SY-Hy for guix-patches@gnu.org; Wed, 18 Oct 2023 11:10:36 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qt8CM-0003h2-I4 for guix-patches@gnu.org; Wed, 18 Oct 2023 11:11:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66609] [PATCH 1/1] services: admin: Export rottlog-configuration accessors. Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 18 Oct 2023 15:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66609 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66609@debbugs.gnu.org Cc: Simon Tournier Received: via spool by 66609-submit@debbugs.gnu.org id=B66609.169764185314176 (code B ref 66609); Wed, 18 Oct 2023 15:11:02 +0000 Received: (at 66609) by debbugs.gnu.org; 18 Oct 2023 15:10:53 +0000 Received: from localhost ([127.0.0.1]:34445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qt8CD-0003ga-3h for submit@debbugs.gnu.org; Wed, 18 Oct 2023 11:10:53 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:39315) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qt8CA-0003gK-ML for 66609@debbugs.gnu.org; Wed, 18 Oct 2023 11:10:52 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3175e1bb38cso639040f8f.1 for <66609@debbugs.gnu.org>; Wed, 18 Oct 2023 08:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697641819; x=1698246619; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sP7OoyOBP/GnSXlxZ6XBnr9Uc8Mj9yzK3/j+z9HJInY=; b=TbiYuKjjtRDcnMebjDAfidGoBKU5HncHX6fWOcwMWANaBkqhZk7sVW1KHdcvxTijUi noIguqnQ+D4423i8VnOpNloWQTWaxu1A2+xMMc7YvoBpCwj8wT6ycOgCNpqKDN7VWPQu ZJVM5b98OhDCf58WIL1BKYhKUlExiUFiimjJ29rMj0qTgiBOESvMo3MZgF4GozGomhNv O+IKbA+43PvXBJqndXu+IXnFA1AepzNkKF2r1wA80D9TKrL0fI4L5zMdbdo8Xl+BLe76 MNEVj+I2ceGij6hZGnCtEUNeINS6XTgWeTfWaEkC4vrSUyvjJCdcUKpUcvqADRMMXr6J n4qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697641819; x=1698246619; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sP7OoyOBP/GnSXlxZ6XBnr9Uc8Mj9yzK3/j+z9HJInY=; b=ldDfIycVNIeKUn4MQvBcHkytVgOGuv3Uz541NtOqb8xiU6obWo0rlZRhi+9vg4W494 KHRVIK/E913iCmBF9LmIQuh4gsSrKbcKY6PUbeEHLFVB3gdLaaVPuGqD5dUoutSIrJE7 2iav59Fy0igkj+da1A0QASm5LKcOPDnZotiZts9wCS34IqVrfIUD0/uCBDgi6sS31D5b Khnfc4H+G7U++TemUTdGIp5+aDHX0xzDA5U9FdFICI5HdyY099BLN8F7kQIbC5tSjheP FtlyltUvKlP4GQoUOs7oNBzrMYFFnccVq8AnYuKaaeFhNC9DTZ9ItlpSNBq0Z10HSHcR kH/g== X-Gm-Message-State: AOJu0YwtTubNbglO09Ujb2N6dK4PiG0nIgPFqAFziK2D0q/Poi8q1XXh XK/7c73QjYFl9yTgFmYTJcz03FShFbg= X-Google-Smtp-Source: AGHT+IHcNwA2i9E8TAXbJoyTSHLzBrj8uTlH5wKpNp6m6NIIbNZpz+VQMmdgQm53Nh/5La7U9OiOpw== X-Received: by 2002:adf:a112:0:b0:32d:a860:324e with SMTP id o18-20020adfa112000000b0032da860324emr4203221wro.3.1697641818497; Wed, 18 Oct 2023 08:10:18 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id j14-20020adfea4e000000b0032d81837433sm2368314wrn.30.2023.10.18.08.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:10:17 -0700 (PDT) From: Simon Tournier Date: Wed, 18 Oct 2023 17:10:09 +0200 Message-Id: <68b1665bd37417da822cd5ca1156f03225aa0e2c.1697641168.git.zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/admin.scm (): Rename accessors rottlog-rottlog to rottlog-configuration-rottlog, rottlog-rc-file to rottlog-configuration-rc-file, rottlog-rotations to rottlog-configuration-rotations, rottlog-jobs to rottlog-configuration-jobs. (rottlog-etc, rottlog-jobs-or-default, rottlog-service-type): Adjust accordingly. --- gnu/services/admin.scm | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 5cf74c6e4d..ce27f7f7d3 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2016-2023 Ludovic Courtès ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2023 Giacomo Leidi +;;; Copyright © 2023 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -52,6 +53,10 @@ (define-module (gnu services admin) rottlog-configuration rottlog-configuration? + rottlog-configuration-rottlog + rottlog-configuration-rc-file + rottlog-configuration-rotations + rottlog-configuration-jobs rottlog-service rottlog-service-type @@ -193,25 +198,25 @@ (define (default-jobs rottlog) (define-record-type* rottlog-configuration make-rottlog-configuration rottlog-configuration? - (rottlog rottlog-rottlog ;file-like + (rottlog rottlog-configuration-rottlog ;file-like (default rottlog)) - (rc-file rottlog-rc-file ;file-like + (rc-file rottlog-configuration-rc-file ;file-like (default (file-append rottlog "/etc/rc"))) - (rotations rottlog-rotations ;list of + (rotations rottlog-configuration-rotations ;list of (default %default-rotations)) - (jobs rottlog-jobs ;list of + (jobs rottlog-configuration-jobs ;list of (default #f))) (define (rottlog-etc config) `(("rottlog" ,(file-union "rottlog" - (cons `("rc" ,(rottlog-rc-file config)) + (cons `("rc" ,(rottlog-configuration-rc-file config)) (log-rotations->/etc-entries - (rottlog-rotations config))))))) + (rottlog-configuration-rotations config))))))) (define (rottlog-jobs-or-default config) - (or (rottlog-jobs config) - (default-jobs (rottlog-rottlog config)))) + (or (rottlog-configuration-jobs config) + (default-jobs (rottlog-configuration-rottlog config)))) (define rottlog-service-type (service-type @@ -226,12 +231,12 @@ (define rottlog-service-type ;; Add Rottlog to the global profile so users can access ;; the documentation. (service-extension profile-service-type - (compose list rottlog-rottlog)))) + (compose list rottlog-configuration-rottlog)))) (compose concatenate) (extend (lambda (config rotations) (rottlog-configuration (inherit config) - (rotations (append (rottlog-rotations config) + (rotations (append (rottlog-configuration-rotations config) rotations))))) (default-value (rottlog-configuration))))