From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sBDWDjgVlWH/CQEAgWs5BA (envelope-from ) for ; Wed, 17 Nov 2021 15:44:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kLFeCjgVlWHzKwAAB5/wlQ (envelope-from ) for ; Wed, 17 Nov 2021 14:44:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 04FA1178B3 for ; Wed, 17 Nov 2021 15:44:08 +0100 (CET) Received: from localhost ([::1]:50264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnMAR-0007R7-4y for larch@yhetil.org; Wed, 17 Nov 2021 09:44:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnMAM-0007PH-Dm for guix-patches@gnu.org; Wed, 17 Nov 2021 09:44:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49039) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnMAM-0000GI-5p for guix-patches@gnu.org; Wed, 17 Nov 2021 09:44:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mnMAM-0005W5-3N for guix-patches@gnu.org; Wed, 17 Nov 2021 09:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51922] [PATCH 2/2] gnu: system: Improve location of some configuration warnings. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 17 Nov 2021 14:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51922 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51922@debbugs.gnu.org Cc: Josselin Poiret Received: via spool by 51922-submit@debbugs.gnu.org id=B51922.163716023821180 (code B ref 51922); Wed, 17 Nov 2021 14:44:02 +0000 Received: (at 51922) by debbugs.gnu.org; 17 Nov 2021 14:43:58 +0000 Received: from localhost ([127.0.0.1]:60584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnMAH-0005VY-KV for submit@debbugs.gnu.org; Wed, 17 Nov 2021 09:43:57 -0500 Received: from jpoiret.xyz ([206.189.101.64]:38828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnMAF-0005VQ-UK for 51922@debbugs.gnu.org; Wed, 17 Nov 2021 09:43:56 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 7E23D184F65; Wed, 17 Nov 2021 14:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1637160235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XBVh3AsH6ej7MlLxtycFDwm5DsyqXpGTgAaB+D2Gwvk=; b=jsbpuIZHC0xqHRrSaozN9DXRNGe/LfbWXRRlxA43yp/7FKToAm8CTxI2Bie8BuvvPqSkve CIORpK2uj5eozFIUJJWs4oaHtgWVneRCWU+0NmDMEOgwZ5fNVNx/eQh5TlAaXBkdhLRUkQ t5vpxT//rMj5rW2/nbOStepyEakTmJkIQzdG/eLY7rjCadbzkpXkTzTtnB2jJdA4FT5mwh 9Zq1UDYHSt2W5HNDfJSa5ztZ4GQ2rlulqrozieru22ZcnXRFrTuBn00Rymw0yVqQeTElZP 4r9AU4bu386s/K7HocUkZLd2nERio+c/F5D1y9Npgh0oje9z4fGoyN/NBpz78w== Date: Wed, 17 Nov 2021 14:43:48 +0000 Message-Id: <20211117144348.17090-2-dev@jpoiret.xyz> In-Reply-To: <20211117144348.17090-1-dev@jpoiret.xyz> References: <20211117144028.16722-1-dev@jpoiret.xyz> <20211117144348.17090-1-dev@jpoiret.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637160248; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=XBVh3AsH6ej7MlLxtycFDwm5DsyqXpGTgAaB+D2Gwvk=; b=qdlBTLyPqLhOA8/v7ynfxzcUKBI3nTSETKJdkKZ89l/21YOhfGP4J/Uw3/dt3r10+IYryT Y71ufUuQcTYZPcjXrtT3s3JqdcUifQ0mgH3Qxs+my8xUqum3xCq9uXiG8JL1gY9cxG/Y0f VHB+fniB/izD/jyLZNIkiRk0XuaiXWIRdgm6z1M1n65kxnyVNajPXlxRNFhzSDx3faxEnz nO7Je4fHySU+MJbZsBbK8O2sTF5xiD//5nx0jhIMVbmhgDssppFQPJk22bMWazoCLuvAJS 8iQ+gm+tArfAgGlrRy3ZbXivFVAXduiFXZwEPbxMPhykKRPnaP2q+cpMRaR6aw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637160248; a=rsa-sha256; cv=none; b=Z/fRFlGXFYpE/RFKpsmHlXpmHzG1IUY+xio9F80pov7dE3R/IxjEO6yZ+ZqtsYrcCJueda 1J33zJvJ3OcdK9CT4OaOa3pXC3Qkb7nCwhuyWupO0LBrUMURtIX7y0wnBdrP5egnAFjp0/ c7ZGX+K0/5WKqm6jkcFYNmuf8P7gU/RXZ6gJ5r0nR8OYC+9LrcXnAnVzOXViViGD0Q/Pey VH2TpRnLTws+WoyZoADyvwkMZ1r6RQuJEiwcld+KKvrx2hzgGajnUbtHrYfCed6W7D5zOs z7WjNz461nawcklFagUh8msY0XucnMuLPXx+Jcgvj9f5NXJPRrIILzdqP9R3BA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=jsbpuIZH; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.65 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=jsbpuIZH; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 04FA1178B3 X-Spam-Score: 0.65 X-Migadu-Scanner: scn1.migadu.com X-TUID: e9NOSLbvMd9C * 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'. --- 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 d1c72c0c85..9cf5457873 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -183,8 +183,13 @@ (define-record-type* ;; The 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 make-bootloader-configuration @@ -213,13 +218,6 @@ (define-record-type* (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 03fb55db15..9de0f79b44 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1107,16 +1107,17 @@ (define (operating-system-environment-variables os) ;; 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 records and warn otherwise." - (%ensure-setuid-program-list lst (current-source-location))) +;; Ensure LST is a list of 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))) -- 2.33.1