summary refs log tree commit diff
path: root/gnu/bootloader.scm
diff options
context:
space:
mode:
authorJosselin Poiret <dev@jpoiret.xyz>2021-11-17 14:43:48 +0000
committerLudovic Courtès <ludo@gnu.org>2021-11-17 23:05:58 +0100
commit7c4142628a397f7863f346635591dbe92b667b45 (patch)
tree63fae672e4127f5010c4f9f4ecdd03c7c5d9c141 /gnu/bootloader.scm
parent346d2f64889b0c82111e790e999bf6c754027e04 (diff)
downloadguix-7c4142628a397f7863f346635591dbe92b667b45.tar.gz
gnu: system: Improve location of some configuration warnings.
* gnu/bootloader.scm (%warn-target-field-deprecation): Remove it.
* gnu/bootloader.scm (warn-target-field-deprecation): Use
define-with-syntax-properties.
* gnu/system.scm (ensure-setuid-program-list): Ditto.  Also rename the
'location' variable to 'properties'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/bootloader.scm')
-rw-r--r--gnu/bootloader.scm16
1 files changed, 7 insertions, 9 deletions
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index d1c72c0c85..9cf5457873 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -183,8 +183,13 @@ record."
 ;; The <bootloader-configuration> record contains bootloader independant
 ;; configuration used to fill bootloader configuration file.
 
-(define-syntax-rule (warn-target-field-deprecation value)
-  (%warn-target-field-deprecation value (current-source-location)))
+(define-with-syntax-properties (warn-target-field-deprecation
+                                (value properties))
+  (when value
+    (warning (source-properties->location properties)
+             (G_ "the 'target' field is deprecated, please use 'targets' \
+instead~%")))
+  value)
 
 (define-record-type* <bootloader-configuration>
   bootloader-configuration make-bootloader-configuration
@@ -213,13 +218,6 @@ record."
   (serial-speed       bootloader-configuration-serial-speed ;integer | #f
                       (default #f)))
 
-(define (%warn-target-field-deprecation value location)
-  (when value
-    (warning (source-properties->location location)
-             (G_ "the 'target' field is deprecated, please use 'targets' \
-instead~%")))
-  value)
-
 (define-deprecated (bootloader-configuration-target config)
   bootloader-configuration-targets
   (%bootloader-configuration-target config))