[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
14/19: system: Warn about swap-devices format change
From: |
guix-commits |
Subject: |
14/19: system: Warn about swap-devices format change |
Date: |
Tue, 23 Nov 2021 04:26:36 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit f574dbd163f8b2d417c6d7ee08559626ae52b7c5
Author: Josselin Poiret <dev@jpoiret.xyz>
AuthorDate: Mon Nov 15 20:26:28 2021 +0000
system: Warn about swap-devices format change
* gnu/system.scm (warn-swap-devices-change,
%warn-swap-devices-change): Add them.
* gnu/system.scm (operating-system) [swap-devices]: Use it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
gnu/system.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/gnu/system.scm b/gnu/system.scm
index 3281c0e..2e5a5ff 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -235,6 +235,8 @@
(file-systems operating-system-file-systems) ; list of fs
(swap-devices operating-system-swap-devices ; list of string |
<swap-space>
(default '())
+ (delayed)
+ (sanitize warn-swap-devices-change))
(users operating-system-users ; list of user accounts
(default %base-user-accounts))
@@ -583,6 +585,20 @@ mapped-device '~a' may not be mounted by the
bootloader.~%")
(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 <swap-space> 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)))
- branch master updated (4788639 -> daf7b5e), guix-commits, 2021/11/23
- 03/19: gnu: Add stcgal., guix-commits, 2021/11/23
- 05/19: gnu: Add python-dbus-next., guix-commits, 2021/11/23
- 01/19: maint: "make dist" builds tarballs in 'ustar' format., guix-commits, 2021/11/23
- 02/19: gnu: Add python-tinydb., guix-commits, 2021/11/23
- 04/19: gnu: python-xcffib: Upgrade to 0.11.1., guix-commits, 2021/11/23
- 14/19: system: Warn about swap-devices format change,
guix-commits <=
- 18/19: guix graph: Show '-M' in '--help' output., guix-commits, 2021/11/23
- 09/19: gnu: piper: Update to 0.6., guix-commits, 2021/11/23
- 15/19: system: Add swap flags., guix-commits, 2021/11/23
- 12/19: doc: Fix the example of "Using virt-viewer with Spice"., guix-commits, 2021/11/23
- 11/19: docker: Enable arm64 docker image building for 'guix pack'., guix-commits, 2021/11/23
- 16/19: system: Filter out boot dependencies from swap-space., guix-commits, 2021/11/23
- 13/19: system: Rework swap space support, add dependencies., guix-commits, 2021/11/23
- 19/19: Update NEWS., guix-commits, 2021/11/23
- 06/19: gnu: Add python-iwlib., guix-commits, 2021/11/23
- 07/19: gnu: Add qtile., guix-commits, 2021/11/23