[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
226/377: bootloader: Report location of the deprecated 'target' field.
From: |
guix-commits |
Subject: |
226/377: bootloader: Report location of the deprecated 'target' field. |
Date: |
Thu, 2 Sep 2021 17:55:39 -0400 (EDT) |
raghavgururajan pushed a commit to branch wip-gnome
in repository guix.
commit baf4272df2350a40bfa198f5cdb42e707e32ad71
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Aug 30 14:22:35 2021 +0200
bootloader: Report location of the deprecated 'target' field.
This is a followup to 2ca982ff41270288913ad6b7d5d9e1cad87b06d9.
* gnu/bootloader.scm (warn-target-field-deprecation): New macro.
(<bootloader-configuration>)[target]: Add 'sanitize' property.
(%warn-target-field-deprecation): New procedure.
(bootloader-configuration-target): Define using 'define-deprecated'.
(bootloader-configuration-targets): Use
'%bootloader-configuration-target' rather than the deprecated one.
---
gnu/bootloader.scm | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 98807a4..d1c72c0 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2017 David Craven <david@craven.ch>
;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
@@ -25,7 +25,10 @@
#:use-module (guix gexp)
#:use-module (guix profiles)
#:use-module (guix records)
- #:use-module (guix ui)
+ #:use-module (guix deprecation)
+ #:use-module ((guix ui) #:select (warn-about-load-error))
+ #:use-module (guix diagnostics)
+ #:use-module (guix i18n)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
#:export (menu-entry
@@ -180,6 +183,9 @@ 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-record-type* <bootloader-configuration>
bootloader-configuration make-bootloader-configuration
bootloader-configuration?
@@ -187,7 +193,7 @@ record."
(targets %bootloader-configuration-targets ;list of strings
(default #f))
(target %bootloader-configuration-target ;deprecated
- (default #f))
+ (default #f) (sanitize warn-target-field-deprecation))
(menu-entries bootloader-configuration-menu-entries ;list of
<menu-entry>
(default '()))
(default-entry bootloader-configuration-default-entry ;integer
@@ -207,16 +213,21 @@ record."
(serial-speed bootloader-configuration-serial-speed ;integer | #f
(default #f)))
-;;; Deprecated.
-(define (bootloader-configuration-target config)
- (warning (G_ "the 'target' field is deprecated, please use 'targets' \
-instead~%"))
+(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))
(define (bootloader-configuration-targets config)
(or (%bootloader-configuration-targets config)
;; TODO: Remove after the deprecated 'target' field is removed.
- (list (bootloader-configuration-target config))
+ (list (%bootloader-configuration-target config))
;; XXX: At least the GRUB installer (see (gnu bootloader grub)) has this
;; peculiar behavior of installing fonts and GRUB modules when DEVICE is
#f,
;; hence the default value of '(#f) rather than '().
- 205/377: gnu: python-pytest-forked: Update to 1.3.0 and run test suite., (continued)
- 205/377: gnu: python-pytest-forked: Update to 1.3.0 and run test suite., guix-commits, 2021/09/02
- 204/377: gnu: python-py-next: Update to 1.10.0., guix-commits, 2021/09/02
- 211/377: gnu: ansible: Update to 4.4.0., guix-commits, 2021/09/02
- 209/377: gnu: Add python-pytest-xdist-next., guix-commits, 2021/09/02
- 207/377: gnu: python-pytest-mock: Update to 3.6.1 and run test suite., guix-commits, 2021/09/02
- 214/377: services: base: Honor file-system-create-mount-point? at all times., guix-commits, 2021/09/02
- 235/377: gnu: Add python-pybbi., guix-commits, 2021/09/02
- 228/377: build: Build (gnu packages rocm)., guix-commits, 2021/09/02
- 220/377: gnu: mu: Update to 1.6.5., guix-commits, 2021/09/02
- 217/377: gnu: rofi: Update to 1.7.0., guix-commits, 2021/09/02
- 226/377: bootloader: Report location of the deprecated 'target' field.,
guix-commits <=
- 222/377: gnu: guile-websocket: Update to 0.1-d17878f6., guix-commits, 2021/09/02
- 213/377: gnu: python-pytest-django: Update to 4.4.0., guix-commits, 2021/09/02
- 224/377: gnu: extra-cmake-modules: Avoid dependency on qtbase when on armhf., guix-commits, 2021/09/02
- 225/377: build: Build (gnu system setuid)., guix-commits, 2021/09/02
- 236/377: gnu: Add python-svgutils., guix-commits, 2021/09/02
- 245/377: gnu: python-scikit-learn: Update to 0.24.2., guix-commits, 2021/09/02
- 244/377: gnu: python-anndata: Fetch sources from git., guix-commits, 2021/09/02
- 243/377: gnu: python-scanpy: Update to 1.8.1., guix-commits, 2021/09/02
- 264/377: gnu: glibmm: Enable documentation., guix-commits, 2021/09/02
- 269/377: gnu: gtk-doc: Update to 1.32., guix-commits, 2021/09/02