guix-commits
[Top][All Lists]
Advanced

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

02/07: services: Deprecate a few more service procedures.


From: guix-commits
Subject: 02/07: services: Deprecate a few more service procedures.
Date: Fri, 11 Jan 2019 06:14:47 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 84a2de36a10dc2ab80f86e16721cbd228c85279e
Author: Ludovic Courtès <address@hidden>
Date:   Thu Jan 10 23:33:36 2019 +0100

    services: Deprecate a few more service procedures.
    
    These procedures were already either undocumented (and de facto
    deprecated) or documented as deprecated or redundant.
    
    * gnu/services/base.scm (guix-service, guix-publish-service): Mark as
    deprecated.
    * gnu/services/mcron.scm (mcron-service): Likewise.
    * gnu/services/networking.scm (tor-service): Likewise.
    * doc/guix.texi (Scheduled Job Execution): Remove 'mcron-service' and
    adjust example.
    (Networking Services): Remove 'tor-service'.
    * gnu/tests/base.scm (%mcron-os): Use 'mcron-service-type' instead of
    'mcron-service'.
    * gnu/tests/networking.scm (%tor-os): Use 'tor-service-type' instead of
    'tor-service'.
    * tests/guix-system.sh: Likewise.
---
 doc/guix.texi               | 25 +++++--------------------
 gnu/services/base.scm       |  8 ++++++--
 gnu/services/mcron.scm      |  6 ++++--
 gnu/services/networking.scm |  7 ++++---
 gnu/system/install.scm      |  3 ++-
 gnu/tests/base.scm          |  5 +++--
 gnu/tests/networking.scm    |  2 +-
 tests/guix-system.sh        |  6 ++++--
 8 files changed, 29 insertions(+), 33 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index c0cc8d4..ed7723c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11684,9 +11684,11 @@ gexps to introduce job definitions that are passed to 
mcron
 
 (operating-system
   ;; @dots{}
-  (services (cons (mcron-service (list garbage-collector-job
-                                       updatedb-job
-                                       idutils-job))
+  (services (cons (service mcron-service-type
+                           (mcron-configuration
+                            (jobs (list garbage-collector-job
+                                        updatedb-job
+                                        idutils-job))))
                   %base-services)))
 @end lisp
 
@@ -11709,17 +11711,6 @@ also specify the number of tasks to display:
 # herd schedule mcron 10
 @end example
 
address@hidden {Scheme Procedure} mcron-service @var{jobs} [#:mcron @var{mcron}]
-Return an mcron service running @var{mcron} that schedules @var{jobs}, a
-list of gexps denoting mcron job specifications.
-
-This is a shorthand for:
address@hidden
-(service mcron-service-type
-         (mcron-configuration (mcron mcron) (jobs jobs)))
address@hidden example
address@hidden deffn
-
 @defvr {Scheme Variable} mcron-service-type
 This is the type of the @code{mcron} service, whose value is an
 @code{mcron-configuration} object.
@@ -12313,12 +12304,6 @@ Tor} anonymous networking daemon.  The service is 
configured using a
 
 @end defvr
 
address@hidden {Scheme Procedure} tor-service address@hidden [#:tor @var{tor}]
-This procedure is deprecated and will be removed in a future release.  Return
-a service of the @code{tor-service-type} type.  @var{config-file} and
address@hidden have the same meaning as in @code{<tor-configuration>}.
address@hidden deffn
-
 @deftp {Data Type} tor-configuration
 @table @asis
 @item @code{tor} (default: @code{tor})
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 6e99cbf..8395a85 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1688,7 +1688,9 @@ failed to register public key '~a': ~a~%" key 
status)))))))
    (description
     "Run the build daemon of address@hidden, aka. @command{guix-daemon}.")))
 
-(define* (guix-service #:optional (config %default-guix-configuration))
+(define-deprecated (guix-service #:optional
+                                 (config %default-guix-configuration))
+  guix-service-type
   "Return a service that runs the Guix build daemon according to
 @var{config}."
   (service guix-service-type config))
@@ -1789,7 +1791,9 @@ failed to register public key '~a': ~a~%" key 
status)))))))
                  "Add a Shepherd service running @command{guix publish}, a
 command that allows you to share pre-built binaries with others over HTTP.")))
 
-(define* (guix-publish-service #:key (guix guix) (port 80) (host "localhost"))
+(define-deprecated (guix-publish-service #:key (guix guix)
+                                         (port 80) (host "localhost"))
+  guix-publish-service-type
   "Return a service that runs @command{guix publish} listening on @var{host}
 and @var{port} (@pxref{Invoking guix publish}).
 
diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm
index 120b663..e4b652b 100644
--- a/gnu/services/mcron.scm
+++ b/gnu/services/mcron.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <address@hidden>
+;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +21,7 @@
   #:use-module (gnu services base)
   #:use-module (gnu services shepherd)
   #:autoload   (gnu packages guile) (mcron)
+  #:use-module (guix deprecation)
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module (srfi srfi-1)
@@ -142,7 +143,8 @@ files."
                                          jobs)))))
                 (default-value (mcron-configuration)))) ;empty job list
 
-(define* (mcron-service jobs #:optional (mcron mcron))
+(define-deprecated (mcron-service jobs #:optional (mcron mcron))
+  mcron-service-type
   "Return an mcron service running @var{mcron} that schedules @var{jobs}, a
 list of gexps denoting mcron job specifications.
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 2f49bf2..cab129e 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -755,9 +755,10 @@ HiddenServicePort ~a ~a~%"
                  "Run the @uref{https://torproject.org, Tor} anonymous
 networking daemon.")))
 
-(define* (tor-service #:optional
-                      (config-file (plain-file "empty" ""))
-                      #:key (tor tor))
+(define-deprecated (tor-service #:optional
+                                (config-file (plain-file "empty" ""))
+                                #:key (tor tor))
+  tor-service-type
   "Return a service to run the @uref{https://torproject.org, Tor} anonymous
 networking daemon.
 
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index c345ba0..19a6f6a 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -253,7 +253,8 @@ You have been warned.  Thanks for being so brave.\x1b[0m
           ;; The build daemon.  Register the official server keys as trusted.
           ;; This allows the installation process to use substitutes by
           ;; default.
-          (guix-service (guix-configuration (authorize-key? #t)))
+          (service guix-service-type
+                   (guix-configuration (authorize-key? #t)))
 
           ;; Start udev so that useful device nodes are available.
           ;; Use device-mapper rules for cryptsetup & co; enable the CRDA for
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 8d4e218..2b20aac 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <address@hidden>
+;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2018 Clément Lassieur <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -627,7 +627,8 @@ non-ASCII names from /tmp.")
         (job3 #~(job next-second-from             ;to test $PATH
                      "touch witness-touch")))
     (simple-operating-system
-     (mcron-service (list job1 job2 job3)))))
+     (service mcron-service-type
+              (mcron-configuration (jobs (list job1 job2 job3)))))))
 
 (define (run-mcron-test name)
   (define os
diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm
index 9f12a4a..a97b29b 100644
--- a/gnu/tests/networking.scm
+++ b/gnu/tests/networking.scm
@@ -351,7 +351,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
 
 (define %tor-os
   (simple-operating-system
-   (tor-service)))
+   (service tor-service-type)))
 
 (define %tor-os/unix-socks-socket
   (simple-operating-system
diff --git a/tests/guix-system.sh b/tests/guix-system.sh
index 23d2da4..adb623d 100644
--- a/tests/guix-system.sh
+++ b/tests/guix-system.sh
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <address@hidden>
+# Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès 
<address@hidden>
 # Copyright © 2017 Tobias Geerinckx-Rice <address@hidden>
 # Copyright © 2018 Chris Marusich <address@hidden>
 #
@@ -258,7 +258,9 @@ cat > "$tmpdir/config.scm"<<EOF
 
 (operating-system
   $OS_BASE
-  (services (cons (tor-service (local-file "my-torrc"))
+  (services (cons (service tor-service-type
+                           (tor-configuration
+                             (config-file (local-file "my-torrc"))))
                   %base-services)))
 EOF
 



reply via email to

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