guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#61587] [PATCH v3 5/8] services: connman: Deprecate 'iwd?' field.


From: Bruno Victal
Subject: [bug#61587] [PATCH v3 5/8] services: connman: Deprecate 'iwd?' field.
Date: Tue, 7 Mar 2023 12:44:02 +0000

* gnu/services/networking.scm (<connman-configuration>)
[iwd?]: Use helper to warn deprecated field.
(connman-shepherd-service): Make iwd? a local variable independent from
the deprecated field.
* doc/guix.texi (Networking Setup): Remove mention of iwd? field.
---
 doc/guix.texi               |  2 --
 gnu/services/networking.scm | 50 +++++++++++++++++++++----------------
 2 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ece0c0354d..b098e45a50 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19926,8 +19926,6 @@ Networking Setup
 @item @code{disable-vpn?} (default: @code{#f})
 When true, disable connman's vpn plugin.
 
-@item @code{iwd?} (default: @code{#f})
-When true, ConnMan uses iwd to connect to wireless networks.
 @end table
 @end deftp
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 6a09f6e728..0ed467f9d8 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -1294,7 +1294,8 @@ (define-record-type* <connman-configuration>
   (disable-vpn? connman-configuration-disable-vpn?
                 (default #f))
   (iwd?         connman-configuration-iwd?
-                (default #f)))
+                (default #f)
+                (sanitize warn-iwd?-field-deprecation)))
 
 (define (connman-activation config)
   (let ((disable-vpn? (connman-configuration-disable-vpn? config)))
@@ -1308,27 +1309,32 @@ (define (connman-activation config)
 (define (connman-shepherd-service config)
   (match-record config <connman-configuration> (connman shepherd-requirement
                                                 disable-vpn? iwd?)
-    (list (shepherd-service
-           (documentation "Run Connman")
-           (provision '(networking))
-           (requirement `(user-processes dbus-system loopback
-                          ,@shepherd-requirement
-                          ,@(if iwd? '(iwd) '())))
-           (start #~(make-forkexec-constructor
-                     (list (string-append #$connman
-                                          "/sbin/connmand")
-                           "--nodaemon"
-                           "--nodnsproxy"
-                           #$@(if disable-vpn? '("--noplugin=vpn") '())
-                           #$@(if iwd? '("--wifi=iwd_agent") '()))
-
-                     ;; As connman(8) notes, when passing '-n', connman
-                     ;; "directs log output to the controlling terminal in
-                     ;; addition to syslog."  Redirect stdout and stderr
-                     ;; to avoid spamming the console (XXX: for some reason
-                     ;; redirecting to /dev/null doesn't work.)
-                     #:log-file "/var/log/connman.log"))
-           (stop #~(make-kill-destructor))))))
+    (let ((iwd? (or iwd?  ; TODO: deprecated field, remove later.
+                    (and shepherd-requirement
+                         (memq 'iwd shepherd-requirement)))))
+      (list (shepherd-service
+             (documentation "Run Connman")
+             (provision '(networking))
+             (requirement `(user-processes dbus-system loopback
+                                           ,@shepherd-requirement
+                                           ;; TODO: iwd? is deprecated and 
should be passed
+                                           ;; with shepherd-requirement, 
remove later.
+                                           ,@(if iwd? '(iwd) '())))
+             (start #~(make-forkexec-constructor
+                       (list (string-append #$connman
+                                            "/sbin/connmand")
+                             "--nodaemon"
+                             "--nodnsproxy"
+                             #$@(if disable-vpn? '("--noplugin=vpn") '())
+                             #$@(if iwd? '("--wifi=iwd_agent") '()))
+
+                       ;; As connman(8) notes, when passing '-n', connman
+                       ;; "directs log output to the controlling terminal in
+                       ;; addition to syslog."  Redirect stdout and stderr
+                       ;; to avoid spamming the console (XXX: for some reason
+                       ;; redirecting to /dev/null doesn't work.)
+                       #:log-file "/var/log/connman.log"))
+             (stop #~(make-kill-destructor)))))))
 
 (define %connman-log-rotation
   (list (log-rotation
-- 
2.39.1






reply via email to

[Prev in Thread] Current Thread [Next in Thread]