[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
11/13: gnu: system: Improve location of some configuration warnings.
From: |
guix-commits |
Subject: |
11/13: gnu: system: Improve location of some configuration warnings. |
Date: |
Wed, 17 Nov 2021 17:07:43 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 7c4142628a397f7863f346635591dbe92b667b45
Author: Josselin Poiret <dev@jpoiret.xyz>
AuthorDate: Wed Nov 17 14:43:48 2021 +0000
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>
---
gnu/bootloader.scm | 16 +++++++---------
gnu/system.scm | 11 ++++++-----
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index d1c72c0..9cf5457 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))
diff --git a/gnu/system.scm b/gnu/system.scm
index 1765368..73e6b58 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1073,16 +1073,17 @@ use 'plain-file' instead~%")
;; TODO: Remove when glibc@2.23 is long gone.
("GUIX_LOCPATH" . "/run/current-system/locale")))
-(define-syntax-rule (ensure-setuid-program-list lst)
- "Ensure LST is a list of <setuid-program> records and warn otherwise."
- (%ensure-setuid-program-list lst (current-source-location)))
+;; Ensure LST is a list of <setuid-program> records and warn otherwise.
+(define-with-syntax-properties (ensure-setuid-program-list (lst properties))
+ (%ensure-setuid-program-list lst properties))
-(define (%ensure-setuid-program-list lst location)
+;; We want to be able to use defines, so define a procedure.
+(define (%ensure-setuid-program-list lst properties)
(define warned? #f)
(define (warn-once)
(unless warned?
- (warning (source-properties->location location)
+ (warning (source-properties->location properties)
(G_ "representing setuid programs with file-like objects is \
deprecated; use 'setuid-program' instead~%"))
(set! warned? #t)))
- branch master updated (6bffa13 -> 94fbcf7), guix-commits, 2021/11/17
- 01/13: services: docker: Add 'environment-variables' configuration field., guix-commits, 2021/11/17
- 02/13: gnu: perl-inline-c: Patch paths to ‘make’., guix-commits, 2021/11/17
- 03/13: gnu: shellcheck: Update to 0.8.0., guix-commits, 2021/11/17
- 05/13: gnu: ristretto: Update to 0.12.0., guix-commits, 2021/11/17
- 06/13: gnu: xfce4-whiskermenu-plugin: Update to 2.6.1., guix-commits, 2021/11/17
- 08/13: gnu: tidy-html: Update to 5.8.0., guix-commits, 2021/11/17
- 04/13: gnu: xfce4-cpugraph-plugin: Update to 1.2.5., guix-commits, 2021/11/17
- 09/13: doc: Improve wording for param spec of `./configure`., guix-commits, 2021/11/17
- 10/13: diagnostics: Add syntax to capture arguments' syntax-properties., guix-commits, 2021/11/17
- 11/13: gnu: system: Improve location of some configuration warnings.,
guix-commits <=
- 07/13: scripts: home: Make ‘guix home import’ write home-configuration.scm., guix-commits, 2021/11/17
- 12/13: gnu: rcs: Install rcsfreeze., guix-commits, 2021/11/17
- 13/13: gnu: Add rcs-blame., guix-commits, 2021/11/17