[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#51346] [PATCH v3 2/5] gnu: system: Warn about swap-devices format c
From: |
Josselin Poiret |
Subject: |
[bug#51346] [PATCH v3 2/5] gnu: system: Warn about swap-devices format change |
Date: |
Mon, 15 Nov 2021 20:26:28 +0000 |
* 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> operating-system
(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 @@ (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 <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)))
--
2.33.1
- [bug#51346] [PATCH 0/1 core-updates-frozen] Rework swap device to add dependencies and flags, Ludovic Courtès, 2021/11/15
- [bug#51346] [PATCH 0/1 core-updates-frozen] Rework swap device to add dependencies and flags, Ludovic Courtès, 2021/11/15
- [bug#51346] [PATCH 0/1 core-updates-frozen] Rework swap device to add dependencies and flags, Ludovic Courtès, 2021/11/15
- [bug#51346] [PATCH 0/1 core-updates-frozen] Rework swap device to add dependencies and flags, Ludovic Courtès, 2021/11/15
- [bug#51346] [PATCH v3 0/5] Rework swap device to add dependencies and flags, Josselin Poiret, 2021/11/15
- [bug#51346] [PATCH v3 1/5] gnu: system: Rework swap space support, add dependencies., Josselin Poiret, 2021/11/15
- [bug#51346] [PATCH v3 2/5] gnu: system: Warn about swap-devices format change,
Josselin Poiret <=
- [bug#51346] [PATCH v3 3/5] gnu: system: Add swap flags., Josselin Poiret, 2021/11/15
- [bug#51346] [PATCH v3 4/5] gnu: system: Filter out boot dependencies from swap-space., Josselin Poiret, 2021/11/15
- [bug#51346] [PATCH v3 5/5] doc: Add new Swap Space section., Josselin Poiret, 2021/11/15
- bug#51346: [PATCH 0/1 core-updates-frozen] Rework swap device to add dependencies and flags, Ludovic Courtès, 2021/11/23