From patchwork Mon Feb 27 14:59:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 47444 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 2980716C03; Mon, 27 Feb 2023 15:00:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,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 C19B416BF5 for ; Mon, 27 Feb 2023 15:00:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWez0-0008IJ-IO; Mon, 27 Feb 2023 10:00:06 -0500 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 1pWeyx-0008HY-MK for guix-patches@gnu.org; Mon, 27 Feb 2023 10:00:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWeyw-0003GW-Cp; Mon, 27 Feb 2023 10:00:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWeyw-00064J-4S; Mon, 27 Feb 2023 10:00:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61842] [PATCH] file-systems: Remove deprecated 'title' field helper procedures. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Mon, 27 Feb 2023 15:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61842 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61842@debbugs.gnu.org Cc: Bruno Victal , ludo@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167750999723284 (code B ref -1); Mon, 27 Feb 2023 15:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Feb 2023 14:59:57 +0000 Received: from localhost ([127.0.0.1]:48563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWeyq-00063U-Tf for submit@debbugs.gnu.org; Mon, 27 Feb 2023 09:59:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:35530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWeyo-00063L-5d for submit@debbugs.gnu.org; Mon, 27 Feb 2023 09:59:55 -0500 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 1pWeyn-0008D9-JY for guix-patches@gnu.org; Mon, 27 Feb 2023 09:59:53 -0500 Received: from smtpm6.myservices.hosting ([185.26.105.207]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWeyl-0003Dl-RD for guix-patches@gnu.org; Mon, 27 Feb 2023 09:59:53 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm6.myservices.hosting (Postfix) with ESMTP id 3B97520CBE for ; Mon, 27 Feb 2023 15:59:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id EC2A280097; Mon, 27 Feb 2023 15:59:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id AShG3xpSDsOH; Mon, 27 Feb 2023 15:59:47 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 738A780079; Mon, 27 Feb 2023 15:59:47 +0100 (CET) From: Bruno Victal Date: Mon, 27 Feb 2023 14:59:39 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Received-SPF: pass client-ip=185.26.105.207; envelope-from=mirai@makinata.eu; helo=smtpm6.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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/system/file-systems.scm (): 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 +(define-record-type* file-system make-file-system file-system? (device file-system-device) ; string | | @@ -200,72 +199,6 @@ (define-record-type (format port "#" (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.