GNU bug report logs - #61693
[PATCH] services: Remove etc-service procedure.

Previous Next

Package: guix-patches;

Reported by: Bruno Victal <mirai <at> makinata.eu>

Date: Wed, 22 Feb 2023 00:11:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61693 in the body.
You can then email your comments to 61693 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#61693; Package guix-patches. (Wed, 22 Feb 2023 00:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruno Victal <mirai <at> makinata.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 22 Feb 2023 00:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Victal <mirai <at> makinata.eu>
To: guix-patches <at> gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH] services: Remove etc-service procedure.
Date: Wed, 22 Feb 2023 00:09:45 +0000
* gnu/services.scm (etc-service): Delete procedure.
* gnu/system.scm (operating-system-etc-service): Replace etc-service
with etc-service-type.
---

Note: This procedure is not documented in the manual so we skip the deprecation phase.

 gnu/services.scm |  8 +-----
 gnu/system.scm   | 68 ++++++++++++++++++++++++------------------------
 2 files changed, 35 insertions(+), 41 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index 2abef557d4..fd073b60dd 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -121,8 +121,7 @@ (define-module (gnu services)
             linux-loadable-module-service-type
 
             %boot-service
-            %activation-service
-            etc-service)
+            %activation-service)
   #:re-export (;; Note: Re-export 'delete' to allow for proper syntax matching
                ;; in 'modify-services' forms.  See
                ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26805#16>.
@@ -804,11 +803,6 @@ (define etc-service-type
                 (extend append)
                 (description "Populate the @file{/etc} directory.")))
 
-(define (etc-service files)
-  "Return a new service of ETC-SERVICE-TYPE that populates /etc with FILES.
-FILES must be a list of name/file-like object pairs."
-  (service etc-service-type files))
-
 (define (setuid-program->activation-gexp programs)
   "Return an activation gexp for setuid-program from PROGRAMS."
   (let ((programs (map (lambda (program)
diff --git a/gnu/system.scm b/gnu/system.scm
index df60fda53b..779fe26049 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1093,40 +1093,40 @@ (define* (operating-system-etc-service os)
   # as those in ~/.guix-profile and /run/current-system/profile.
   source /run/current-system/profile/etc/profile.d/bash_completion.sh
 fi\n")))
-    (etc-service
-     `(("os-release" ,#~#$(os-release))
-       ("services" ,(file-append net-base "/etc/services"))
-       ("protocols" ,(file-append net-base "/etc/protocols"))
-       ("rpc" ,(file-append net-base "/etc/rpc"))
-       ("login.defs" ,#~#$login.defs)
-       ("issue" ,#~#$issue)
-       ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
-       ("profile" ,#~#$profile)
-       ("bashrc" ,#~#$bashrc)
-       ;; Write the operating-system-host-name to /etc/hostname to prevent
-       ;; NetworkManager from changing the system's hostname when connecting
-       ;; to certain networks.  Some discussion at
-       ;; https://lists.gnu.org/archive/html/help-guix/2017-09/msg00037.html
-       ("hostname" ,(plain-file "hostname" (operating-system-host-name os)))
-       ;; Some programs (e.g., GLib) look at /etc/timezone to find the
-       ;; name of the current timezone.  For details, see
-       ;; https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00166.html
-       ;; Some programs expect a terminating newline.
-       ("timezone" ,(plain-file "timezone"
-                                (string-append
-                                 (string-trim-both
-                                  (operating-system-timezone os))
-                                 "\n")))
-       ("localtime" ,(file-append tzdata "/share/zoneinfo/"
-                                  (operating-system-timezone os)))
-       ,@(if sudoers
-             `(("sudoers" ,(validated-sudoers-file sudoers)))
-             '())
-       ,@(if hurd
-             `(("login" ,(file-append hurd "/etc/login"))
-               ("motd"  ,(file-append hurd "/etc/motd"))
-               ("ttys"  ,(file-append hurd "/etc/ttys")))
-             '())))))
+    (service etc-service-type
+             `(("os-release" ,#~#$(os-release))
+               ("services" ,(file-append net-base "/etc/services"))
+               ("protocols" ,(file-append net-base "/etc/protocols"))
+               ("rpc" ,(file-append net-base "/etc/rpc"))
+               ("login.defs" ,#~#$login.defs)
+               ("issue" ,#~#$issue)
+               ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
+               ("profile" ,#~#$profile)
+               ("bashrc" ,#~#$bashrc)
+               ;; Write the operating-system-host-name to /etc/hostname to prevent
+               ;; NetworkManager from changing the system's hostname when connecting
+               ;; to certain networks.  Some discussion at
+               ;; https://lists.gnu.org/archive/html/help-guix/2017-09/msg00037.html
+               ("hostname" ,(plain-file "hostname" (operating-system-host-name os)))
+               ;; Some programs (e.g., GLib) look at /etc/timezone to find the
+               ;; name of the current timezone.  For details, see
+               ;; https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00166.html
+               ;; Some programs expect a terminating newline.
+               ("timezone" ,(plain-file "timezone"
+                                        (string-append
+                                         (string-trim-both
+                                          (operating-system-timezone os))
+                                         "\n")))
+               ("localtime" ,(file-append tzdata "/share/zoneinfo/"
+                                          (operating-system-timezone os)))
+               ,@(if sudoers
+                     `(("sudoers" ,(validated-sudoers-file sudoers)))
+                     '())
+               ,@(if hurd
+                     `(("login" ,(file-append hurd "/etc/login"))
+                       ("motd"  ,(file-append hurd "/etc/motd"))
+                       ("ttys"  ,(file-append hurd "/etc/ttys")))
+                     '())))))
 
 (define %root-account
   ;; Default root account.
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61693; Package guix-patches. (Thu, 23 Feb 2023 16:12:01 GMT) Full text and rfc822 format available.

Message #8 received at 61693 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Victal <mirai <at> makinata.eu>
To: 61693 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH v2] services: etc-service: Deprecate etc-service procedure.
Date: Thu, 23 Feb 2023 16:10:54 +0000
* gnu/services.scm (etc-service): Deprecate procedure.
* gnu/system.scm (operating-system-etc-service): Replace etc-service
with etc-service-type.
---
 gnu/services.scm |  6 +++--
 gnu/system.scm   | 68 ++++++++++++++++++++++++------------------------
 2 files changed, 38 insertions(+), 36 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index 2abef557d4..d6c7ad0553 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -39,6 +39,7 @@ (define-module (gnu services)
   #:use-module (guix modules)
   #:use-module (guix packages)
   #:use-module (guix utils)
+  #:use-module (guix deprecation)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages hurd)
@@ -122,7 +123,7 @@ (define-module (gnu services)
 
             %boot-service
             %activation-service
-            etc-service)
+            etc-service)  ; deprecated
   #:re-export (;; Note: Re-export 'delete' to allow for proper syntax matching
                ;; in 'modify-services' forms.  See
                ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26805#16>.
@@ -804,7 +805,8 @@ (define etc-service-type
                 (extend append)
                 (description "Populate the @file{/etc} directory.")))
 
-(define (etc-service files)
+(define-deprecated (etc-service files)
+  etc-service-type
   "Return a new service of ETC-SERVICE-TYPE that populates /etc with FILES.
 FILES must be a list of name/file-like object pairs."
   (service etc-service-type files))
diff --git a/gnu/system.scm b/gnu/system.scm
index 53f3c62bb0..ca661c4d86 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1092,40 +1092,40 @@ (define* (operating-system-etc-service os)
   # as those in ~/.guix-profile and /run/current-system/profile.
   source /run/current-system/profile/etc/profile.d/bash_completion.sh
 fi\n")))
-    (etc-service
-     `(("os-release" ,#~#$(os-release))
-       ("services" ,(file-append net-base "/etc/services"))
-       ("protocols" ,(file-append net-base "/etc/protocols"))
-       ("rpc" ,(file-append net-base "/etc/rpc"))
-       ("login.defs" ,#~#$login.defs)
-       ("issue" ,#~#$issue)
-       ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
-       ("profile" ,#~#$profile)
-       ("bashrc" ,#~#$bashrc)
-       ;; Write the operating-system-host-name to /etc/hostname to prevent
-       ;; NetworkManager from changing the system's hostname when connecting
-       ;; to certain networks.  Some discussion at
-       ;; https://lists.gnu.org/archive/html/help-guix/2017-09/msg00037.html
-       ("hostname" ,(plain-file "hostname" (operating-system-host-name os)))
-       ;; Some programs (e.g., GLib) look at /etc/timezone to find the
-       ;; name of the current timezone.  For details, see
-       ;; https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00166.html
-       ;; Some programs expect a terminating newline.
-       ("timezone" ,(plain-file "timezone"
-                                (string-append
-                                 (string-trim-both
-                                  (operating-system-timezone os))
-                                 "\n")))
-       ("localtime" ,(file-append tzdata "/share/zoneinfo/"
-                                  (operating-system-timezone os)))
-       ,@(if sudoers
-             `(("sudoers" ,(validated-sudoers-file sudoers)))
-             '())
-       ,@(if hurd
-             `(("login" ,(file-append hurd "/etc/login"))
-               ("motd"  ,(file-append hurd "/etc/motd"))
-               ("ttys"  ,(file-append hurd "/etc/ttys")))
-             '())))))
+    (service etc-service-type
+             `(("os-release" ,#~#$(os-release))
+               ("services" ,(file-append net-base "/etc/services"))
+               ("protocols" ,(file-append net-base "/etc/protocols"))
+               ("rpc" ,(file-append net-base "/etc/rpc"))
+               ("login.defs" ,#~#$login.defs)
+               ("issue" ,#~#$issue)
+               ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
+               ("profile" ,#~#$profile)
+               ("bashrc" ,#~#$bashrc)
+               ;; Write the operating-system-host-name to /etc/hostname to prevent
+               ;; NetworkManager from changing the system's hostname when connecting
+               ;; to certain networks.  Some discussion at
+               ;; https://lists.gnu.org/archive/html/help-guix/2017-09/msg00037.html
+               ("hostname" ,(plain-file "hostname" (operating-system-host-name os)))
+               ;; Some programs (e.g., GLib) look at /etc/timezone to find the
+               ;; name of the current timezone.  For details, see
+               ;; https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00166.html
+               ;; Some programs expect a terminating newline.
+               ("timezone" ,(plain-file "timezone"
+                                        (string-append
+                                         (string-trim-both
+                                          (operating-system-timezone os))
+                                         "\n")))
+               ("localtime" ,(file-append tzdata "/share/zoneinfo/"
+                                          (operating-system-timezone os)))
+               ,@(if sudoers
+                     `(("sudoers" ,(validated-sudoers-file sudoers)))
+                     '())
+               ,@(if hurd
+                     `(("login" ,(file-append hurd "/etc/login"))
+                       ("motd"  ,(file-append hurd "/etc/motd"))
+                       ("ttys"  ,(file-append hurd "/etc/ttys")))
+                     '())))))
 
 (define %root-account
   ;; Default root account.
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61693; Package guix-patches. (Mon, 13 Mar 2023 17:37:01 GMT) Full text and rfc822 format available.

Message #11 received at 61693 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Victal <mirai <at> makinata.eu>
To: 61693 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH v3] services: etc-service: Deprecate etc-service procedure.
Date: Mon, 13 Mar 2023 17:36:14 +0000
* gnu/services.scm (etc-service): Deprecate procedure.
* gnu/system.scm (operating-system-etc-service): Replace etc-service
with etc-service-type.
---

Changes from v2 to v3:
  * Resolved merge conflict.

 gnu/services.scm | 6 ++++--
 gnu/system.scm   | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index 2abef557d4..d6c7ad0553 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -39,6 +39,7 @@ (define-module (gnu services)
   #:use-module (guix modules)
   #:use-module (guix packages)
   #:use-module (guix utils)
+  #:use-module (guix deprecation)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages hurd)
@@ -122,7 +123,7 @@ (define-module (gnu services)
 
             %boot-service
             %activation-service
-            etc-service)
+            etc-service)  ; deprecated
   #:re-export (;; Note: Re-export 'delete' to allow for proper syntax matching
                ;; in 'modify-services' forms.  See
                ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26805#16>.
@@ -804,7 +805,8 @@ (define etc-service-type
                 (extend append)
                 (description "Populate the @file{/etc} directory.")))
 
-(define (etc-service files)
+(define-deprecated (etc-service files)
+  etc-service-type
   "Return a new service of ETC-SERVICE-TYPE that populates /etc with FILES.
 FILES must be a list of name/file-like object pairs."
   (service etc-service-type files))
diff --git a/gnu/system.scm b/gnu/system.scm
index 887e537b48..48cc68f449 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1090,7 +1090,7 @@ (define* (operating-system-etc-service os)
   # as those in ~/.guix-profile and /run/current-system/profile.
   source /run/current-system/profile/etc/profile.d/bash_completion.sh
 fi\n")))
-    (etc-service
+    (service etc-service-type
      `(("os-release" ,os-release)
        ("services" ,(file-append net-base "/etc/services"))
        ("protocols" ,(file-append net-base "/etc/protocols"))
-- 
2.39.1





Information forwarded to guix-patches <at> gnu.org:
bug#61693; Package guix-patches. (Tue, 14 Mar 2023 14:44:02 GMT) Full text and rfc822 format available.

Message #14 received at 61693 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Bruno Victal <mirai <at> makinata.eu>
Cc: 61693 <at> debbugs.gnu.org
Subject: Re: bug#61693: [PATCH] services: Remove etc-service procedure.
Date: Tue, 14 Mar 2023 15:42:56 +0100
Hi,

Bruno Victal <mirai <at> makinata.eu> skribis:

> * gnu/services.scm (etc-service): Deprecate procedure.
> * gnu/system.scm (operating-system-etc-service): Replace etc-service
> with etc-service-type.

[...]

> -       ("issue" ,#~#$issue)
> -       ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
> -       ("profile" ,#~#$profile)

I realize this should be updated now that I’ve applied your #~#$
simplifications.  Could you rebase it?

Apologies for the delay *and* for the extra work!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#61693; Package guix-patches. (Tue, 14 Mar 2023 15:47:01 GMT) Full text and rfc822 format available.

Message #17 received at 61693 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Victal <mirai <at> makinata.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 61693 <at> debbugs.gnu.org
Subject: Re: bug#61693: [PATCH] services: Remove etc-service procedure.
Date: Tue, 14 Mar 2023 15:46:15 +0000
Hi Ludo’,

On 2023-03-14 14:42, Ludovic Courtès wrote:
> Hi,
> 
> Bruno Victal <mirai <at> makinata.eu> skribis:
> 
>> * gnu/services.scm (etc-service): Deprecate procedure.
>> * gnu/system.scm (operating-system-etc-service): Replace etc-service
>> with etc-service-type.
> 
> [...]
> 
>> -       ("issue" ,#~#$issue)
>> -       ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
>> -       ("profile" ,#~#$profile)
> 
> I realize this should be updated now that I’ve applied your #~#$
> simplifications.  Could you rebase it?

Already rebased with v3 [1].

[1]: https://issues.guix.gnu.org/61693#2

Cheers,
Bruno




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 16 Mar 2023 10:53:01 GMT) Full text and rfc822 format available.

Notification sent to Bruno Victal <mirai <at> makinata.eu>:
bug acknowledged by developer. (Thu, 16 Mar 2023 10:53:02 GMT) Full text and rfc822 format available.

Message #22 received at 61693-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Bruno Victal <mirai <at> makinata.eu>
Cc: 61693-done <at> debbugs.gnu.org
Subject: Re: bug#61693: [PATCH] services: Remove etc-service procedure.
Date: Thu, 16 Mar 2023 11:52:31 +0100
Hi,

Bruno Victal <mirai <at> makinata.eu> skribis:

> * gnu/services.scm (etc-service): Deprecate procedure.
> * gnu/system.scm (operating-system-etc-service): Replace etc-service
> with etc-service-type.
> ---
>
> Changes from v2 to v3:
>   * Resolved merge conflict.

Applied, thanks!  And apologies again for the merge conflict.

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Apr 2023 11:24:11 GMT) Full text and rfc822 format available.

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

Previous Next


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