From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4EpYNvnCkmHfVwEAgWs5BA (envelope-from ) for ; Mon, 15 Nov 2021 21:28:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EGADMvnCkmFGegAA1q6Kng (envelope-from ) for ; Mon, 15 Nov 2021 20:28:41 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7B22733B48 for ; Mon, 15 Nov 2021 21:28:41 +0100 (CET) Received: from localhost ([::1]:58484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmiam-0008C3-Ms for larch@yhetil.org; Mon, 15 Nov 2021 15:28:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmiaB-0007fE-8t for guix-patches@gnu.org; Mon, 15 Nov 2021 15:28:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmiaB-000374-0q for guix-patches@gnu.org; Mon, 15 Nov 2021 15:28:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmiaA-0008Vs-TV for guix-patches@gnu.org; Mon, 15 Nov 2021 15:28:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51346] [PATCH v3 2/5] gnu: system: Warn about swap-devices format change Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Nov 2021 20:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51346 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , Tobias Geerinckx-Rice , 51346@debbugs.gnu.org Received: via spool by 51346-submit@debbugs.gnu.org id=B51346.163700804232626 (code B ref 51346); Mon, 15 Nov 2021 20:28:02 +0000 Received: (at 51346) by debbugs.gnu.org; 15 Nov 2021 20:27:22 +0000 Received: from localhost ([127.0.0.1]:56278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmiZV-0008U9-Pe for submit@debbugs.gnu.org; Mon, 15 Nov 2021 15:27:22 -0500 Received: from jpoiret.xyz ([206.189.101.64]:34832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmiZQ-0008TS-HR for 51346@debbugs.gnu.org; Mon, 15 Nov 2021 15:27:16 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 79517184F65; Mon, 15 Nov 2021 20:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1637008036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5KPq/s8cDPllOM96phVS0nOUo3h4Y/GEW13rRcHTK0Y=; b=rOp+EV+CphzU1Af6QPGO0MbSwbv26j9T5IeHnBfa25mk1SRWJIqfgEfdSdD+WvSl0pv6SG Rm+yjXBRJZHQKhyZjNMFeOE2iCnMud4/mxDrMY7aIcD4Gmr+rxK1RZ6hbFaHpOy1rEd35q AEMTjZcD+wCgc/FvkM43BfRDi3U0OA/CsLffTa827x4UZFZA5i2hR3bLI0JS3/mkvLna9C Na6MPRBl6lVcAJa9NeotjnilXOyg90c07bIH3di08M2D76OvTL/3Om8e0bx0zNxMx3bRMf ZKJjZr8yG90ZEMgeu6j6iTeHdvxyLuDzmJZjsQxodmEnvM4/sOESlrXVqftWJA== Date: Mon, 15 Nov 2021 20:26:28 +0000 Message-Id: <20211115202631.6032-3-dev@jpoiret.xyz> In-Reply-To: <20211115202631.6032-1-dev@jpoiret.xyz> References: <87y25p65on.fsf_-_@gnu.org> <20211115202631.6032-1-dev@jpoiret.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637008121; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=5KPq/s8cDPllOM96phVS0nOUo3h4Y/GEW13rRcHTK0Y=; b=j1jTGNsmVeLK6uggMpwXVKxUAhix59/0kI6YCaPCZI1sp8aPDXxFw8um31sZz2Gc1UsO1I mkO+vO8YgwG6oVQGucV4UkZcsGS1k9GsNN6cJxv1uU7bJJ2QJy7KRjkc5HsuEzCvK8PlaF IEUuR/pu83nr2M9toTdNBocbhQ5EtsxeEy/jpWhARhqXK7rfkrc2dasqD9SYYjVO1nGSBo yJDvvT9sXkFVVUPQSoz1ZPdoFKUdhfNnPDA4Hc5qpN3aiZA7ObWFpVvILAppFhjEAmCaBT tJc75JeXhLw3wcbTACFFoot7hvE+yAcbKjz2AJ7lfj1JeAV2H8yz3o78Fgzv0Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637008121; a=rsa-sha256; cv=none; b=QF2oup5tsCmzyNPs+dJEOsQ9BL/3rLfAT1aSPE6gQ+0PvvDBZU9QOpTeGtxM1bk20rn+CJ mDD3FvSaAlbL0kv/YcAfp5l5fUcUr2G2CPO720rFxE58UN7QmRWPj/wt59PZtcv+FIvlIl tqM19AEKzXshed4Cq22nP9iLJAK9LoDsp0VmVEHl6lsl4lamn+F4G1PUT1iJgy2zCOzXC4 CwPNfoyOJe9C6TAAbRb9fJUpbq6MV7mdhAkQje6HglBH/kTcGHrVrXfKa3KDDVyu4HSKSy 3FrIqJrMdyGGcXP8fu2KYUgXml9fHD9gaX6UKJIDtk9lrHsybpUBXbmfqh/3IA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=rOp+EV+C; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.34 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=rOp+EV+C; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7B22733B48 X-Spam-Score: -1.34 X-Migadu-Scanner: scn0.migadu.com X-TUID: YNbrMai7Zrot * gnu/system.scm (warn-swap-devices-change, %warn-swap-devices-change): Add them. * gnu/system.scm (operating-system) [swap-devices]: Use it. --- gnu/system.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gnu/system.scm b/gnu/system.scm index fd556e1e7c..76a904b681 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -235,6 +235,8 @@ (define-record-type* operating-system (file-systems operating-system-file-systems) ; list of fs (swap-devices operating-system-swap-devices ; list of string | (default '()) + (delayed) + (sanitize warn-swap-devices-change)) (users operating-system-users ; list of user accounts (default %base-user-accounts)) @@ -583,6 +585,20 @@ (define (device-mapping-services os) (map device-mapping-service (operating-system-user-mapped-devices os))) +(define-syntax-rule (warn-swap-devices-change value) + (%warn-swap-devices-change value (current-source-location))) + +(define (%warn-swap-devices-change value location) + (map (lambda (x) + (unless (swap-space? x) + (warning + (source-properties->location + location) + (G_ "List elements of the field 'swap-devices' should \ +now use the record, as the old method is deprecated. \ +See \"(guix) operating-system Reference\" for more details.~%"))) + x) value)) + (define (swap-services os) "Return the list of swap services for OS." (map swap-service (operating-system-swap-devices os))) -- 2.33.1