all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bruno Victal <mirai@makinata.eu>
To: 61842@debbugs.gnu.org
Cc: Bruno Victal <mirai@makinata.eu>, ludo@gnu.org
Subject: [bug#61842] [PATCH] file-systems: Remove deprecated 'title' field helper procedures.
Date: Mon, 27 Feb 2023 14:59:39 +0000	[thread overview]
Message-ID: <d4880ff400a00b3b645b9eb34295e8b6c02e04b7.1677509902.git.mirai@makinata.eu> (raw)

* gnu/system/file-systems.scm (<file-system>): Change constructor name to 'file-system'.
(report-deprecation, device-expression, process-file-system-declaration, file-system): Remove macros.
(file-system-title): Remove procedure.
---
 gnu/system/file-systems.scm | 69 +------------------------------------
 1 file changed, 1 insertion(+), 68 deletions(-)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index f2eb2e0837..b236011100 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -42,7 +42,6 @@ (define-module (gnu system file-systems)
             file-system?
             file-system-device
             file-system-device->string
-            file-system-title                     ;deprecated
             file-system-mount-point
             file-system-type
             file-system-needed-for-boot?
@@ -158,7 +157,7 @@ (define-syntax validate-file-system-flags
        #'%validate-file-system-flags))))
 
 ;; File system declaration.
-(define-record-type* <file-system> %file-system
+(define-record-type* <file-system> file-system
   make-file-system
   file-system?
   (device           file-system-device) ; string | <uuid> | <file-system-label>
@@ -200,72 +199,6 @@ (define-record-type <file-system-label>
                             (format port "#<file-system-label ~s>"
                                     (file-system-label->string obj))))
 
-(define-syntax report-deprecation
-  (lambda (s)
-    "Report the use of the now-deprecated 'title' field."
-    (syntax-case s ()
-      ((_ field)
-       (let* ((source (syntax-source #'field))
-              (file   (and source (assq-ref source 'filename)))
-              (line   (and source
-                           (and=> (assq-ref source 'line) 1+)))
-              (column (and source (assq-ref source 'column))))
-         (format (current-error-port)
-                 "~a:~a:~a: warning: 'title' field is deprecated~%"
-                 file line column)
-         #t)))))
-
-;; Helper for 'process-file-system-declaration'.
-(define-syntax device-expression
-  (syntax-rules (quote label uuid device)
-    ((_ (quote label) dev)
-     (file-system-label dev))
-    ((_ (quote uuid) dev)
-     (if (uuid? dev) dev (uuid dev)))
-    ((_ (quote device) dev)
-     dev)
-    ((_ title dev)
-     (case title
-       ((label) (file-system-label dev))
-       ((uuid)  (uuid dev))
-       (else    dev)))))
-
-;; Helper to interpret the now-deprecated 'title' field.  Detect forms like
-;; (title 'label), remove them, and adjust the 'device' field accordingly.
-;; TODO: Remove this once 'title' has been deprecated long enough.
-(define-syntax process-file-system-declaration
-  (syntax-rules (device title)
-    ((_ () (rest ...) #f #f)                 ;no 'title' and no 'device' field
-     (%file-system rest ...))
-    ((_ () (rest ...) dev #f)                     ;no 'title' field
-     (%file-system rest ... (device dev)))
-    ((_ () (rest ...) dev titl)                   ;got a 'title' field
-     (%file-system rest ...
-                   (device (device-expression titl dev))))
-    ((_ ((title titl) rest ...) (previous ...) dev _)
-     (begin
-       (report-deprecation (title titl))
-       (process-file-system-declaration (rest ...)
-                                        (previous ...)
-                                        dev titl)))
-    ((_ ((device dev) rest ...) (previous ...) _ titl)
-     (process-file-system-declaration (rest ...)
-                                      (previous ...)
-                                      dev titl))
-    ((_ (field rest ...) (previous ...) dev titl)
-     (process-file-system-declaration (rest ...)
-                                      (previous ... field)
-                                      dev titl))))
-
-(define-syntax-rule (file-system fields ...)
-  (process-file-system-declaration (fields ...) () #f #f))
-
-(define (file-system-title fs)                    ;deprecated
-  (match (file-system-device fs)
-    ((? file-system-label?) 'label)
-    ((? uuid?)              'uuid)
-    ((? string?)            'device)))
-
 ;; Note: This module is used both on the build side and on the host side.
 ;; Arrange not to pull (guix store) and (guix config) because the latter
 ;; differs from user to user.
-- 
2.39.1





             reply	other threads:[~2023-02-27 15:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 14:59 Bruno Victal [this message]
2023-03-05 22:05 ` bug#61842: [PATCH] file-systems: Remove deprecated 'title' field helper procedures Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4880ff400a00b3b645b9eb34295e8b6c02e04b7.1677509902.git.mirai@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=61842@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.