From unknown Tue Jun 17 17:56:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#68935 <68935@debbugs.gnu.org> To: bug#68935 <68935@debbugs.gnu.org> Subject: Status: [PATCH 0/3] Add 'put' option to guix import. Reply-To: bug#68935 <68935@debbugs.gnu.org> Date: Wed, 18 Jun 2025 00:56:10 +0000 retitle 68935 [PATCH 0/3] Add 'put' option to guix import. reassign 68935 guix-patches submitter 68935 Herman Rimm severity 68935 normal tag 68935 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 05 09:51:51 2024 Received: (at submit) by debbugs.gnu.org; 5 Feb 2024 14:51:51 +0000 Received: from localhost ([127.0.0.1]:50864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0K7-00047G-Fm for submit@debbugs.gnu.org; Mon, 05 Feb 2024 09:51:51 -0500 Received: from lists.gnu.org ([2001:470:142::17]:53788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0K2-00046y-JF for submit@debbugs.gnu.org; Mon, 05 Feb 2024 09:51:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rX0Jk-00026z-2m for guix-patches@gnu.org; Mon, 05 Feb 2024 09:51:28 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117] helo=email.rimm.ee) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1rX0Jh-0004VO-W7 for guix-patches@gnu.org; Mon, 05 Feb 2024 09:51:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707144678; 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; bh=ebsGNEzIBLzorxnIlklvh3gft8NVVe/Iya7B6jTm2xA=; b=nPI1ZE8q08TTqzMzOEtH9ClSGLNdz6WZdubS2rhmehnRZBDcrpG3I4d2bg4ZkCk4LE0S7U ul76EoSuYuEE82Mrh9XSynr6lPATTrSUhBEpWu6lSBC6JVUuzm+h2G/Mdwp69Ws1FJkszV pObmXOM9vT8q4FhLbdh+/ASOrObnIm0ok0TZTyFw5IyN17JDhqcTs+dJX5pO96Af1cs5vn hEF6QtsiypmHH/7sZDSVop7nfZNQkP70qL1J/wnWwIpX3u7lzkVZXwXMhAGWfF8oXsj8/s 5CRsZxVD11X+2WjyFUZy752RWheGzPIeR9lJdnmvjcA6IOSRXhZV9PHCvyKT4Q== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 4453ab1a (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 5 Feb 2024 14:51:18 +0000 (UTC) From: Herman Rimm To: guix-patches@gnu.org Subject: [PATCH 0/3] Add 'put' option to guix import. Date: Mon, 5 Feb 2024 15:51:07 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=81.205.150.117; envelope-from=herman@rimm.ee; helo=email.rimm.ee X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_PBL=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) Hi all, The first patch makes (svn-fetch) invoke svn from a native package instead of one from the current PATH, if any. The third patch adds the 'put' option to 'guix import', so new package definitions get inserted among existing definitions into e.g. gnu/packages/crates-io.scm. Cheers, Herman Herman Rimm (3): svn-fetch: Require svn-command argument. guix: import: Wrap package expressions with define-public. guix: import: Put packages into modules in alphabetical order. doc/guix.texi | 14 +++++- guix/build/svn.scm | 5 +-- guix/scripts/import.scm | 96 ++++++++++++++++++++++++++++++----------- guix/svn-download.scm | 35 +++++++++++---- 4 files changed, 111 insertions(+), 39 deletions(-) base-commit: a3df20db8c3b9c819db7ca29bf014e2544e389d4 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 05 10:08:16 2024 Received: (at 68935) by debbugs.gnu.org; 5 Feb 2024 15:08:16 +0000 Received: from localhost ([127.0.0.1]:52043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0Zz-0004oq-Hz for submit@debbugs.gnu.org; Mon, 05 Feb 2024 10:08:16 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:43641 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0Zt-0004oD-3U for 68935@debbugs.gnu.org; Mon, 05 Feb 2024 10:08:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707145666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hoIJdq+TfLtIjUjAHKlPhVdCPKO5fep6YvHnsrA2ZBM=; b=FVVMG6EK3aKTUrvC5U9tb1qQxjJsDe/k0TezZVHi+9ap103j3xO80/eAZYdbDFPbuivst1 9vIM3+EGjHbYN+/8ziBldU01SN8pbgyRanpvjU7l4sZkr1q1BykL9Q4o2RnxwWtQ5l8JCV dFuHDT+CY0MM1sYq0LWSY/oQi2E4oE4CWew7Q/barR8Kzhh3WZjygj7Fs9itp8BnnChbXY lHj2nThcubK8vwKs5aqKLiySP48Jt8zIKTurZGaVwT3l2fYYBkZLLUfTpwX1WVqxrvKKT6 tLDQtR8rDxoHrzr6thNgl+jt8bGxFGV4emXStQ1ImtVIpFmaEhjOybhJXOg5vw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 361dc3bd (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 5 Feb 2024 15:07:46 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH 1/3] svn-fetch: Require svn-command argument. Date: Mon, 5 Feb 2024 16:07:12 +0100 Message-ID: <3a3748ee3fd345ff26bd63979bf8cee2c32d87ab.1707144191.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/build/svn.scm (svn-fetch): Require svn-command argument. * guix/svn-download.scm: Pass svn-command to each (svn-fetch). Change-Id: Ibc7d3a79e45374588f71ca4d4ac2685c60ff3c00 --- guix/build/svn.scm | 5 ++--- guix/svn-download.scm | 35 ++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 12 deletions(-) Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 TVD_RCVD_IP Message was received from an IP address 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] 0.0 T_SPF_TEMPERROR SPF: test of record failed (temperror) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 68935 Cc: Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/build/svn.scm (svn-fetch): Require svn-command argument. * guix/svn-download.scm: Pass svn-command to each (svn-fetch). Change-Id: Ibc7d3a79e45374588f71ca4d4ac2685c60ff3c00 --- guix/build/svn.scm | 5 ++--- guix/svn-download.scm | 35 ++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 12 deletions(-) Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/build/svn.scm (svn-fetch): Require svn-command argument. * guix/svn-download.scm: Pass svn-command to each (svn-fetch). Change-Id: Ibc7d3a79e45374588f71ca4d4ac2685c60ff3c00 --- guix/build/svn.scm | 5 ++--- guix/svn-download.scm | 35 ++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/guix/build/svn.scm b/guix/build/svn.scm index 875d3c50ca..e8f168abc6 100644 --- a/guix/build/svn.scm +++ b/guix/build/svn.scm @@ -31,9 +31,8 @@ (define-module (guix build svn) ;;; ;;; Code: -(define* (svn-fetch url revision directory - #:key (svn-command "svn") - (recursive? #t) +(define* (svn-fetch url revision directory svn-command + #:key (recursive? #t) (user-name #f) (password #f)) "Fetch REVISION from URL into DIRECTORY. REVISION must be an integer, and a diff --git a/guix/svn-download.scm b/guix/svn-download.scm index c6688908de..c4eeed3563 100644 --- a/guix/svn-download.scm +++ b/guix/svn-download.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2014-2016, 2019, 2021-2023 Ludovic Courtès ;;; Copyright © 2014 Sree Harsha Totakura ;;; Copyright © 2017, 2019, 2021 Ricardo Wurmus +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -105,7 +106,7 @@ (define* (svn-fetch ref hash-algo hash (or (svn-fetch (getenv "svn url") (string->number (getenv "svn revision")) #$output - #:svn-command #+(file-append svn "/bin/svn") + #+(file-append svn "/bin/svn") #:recursive? (match (getenv "svn recursive?") ("yes" #t) (_ #f)) @@ -195,7 +196,7 @@ (define* (svn-multi-fetch ref hash-algo hash (if (string-suffix? "/" location) (string-append #$output "/" location) (string-append #$output "/" (dirname location))) - #:svn-command #+(file-append svn "/bin/svn") + #+(file-append svn "/bin/svn") #:recursive? (match (getenv "svn recursive?") ("yes" #t) (_ #f)) @@ -245,25 +246,34 @@ (define* (svn-multi-fetch ref hash-algo hash (define* (download-svn-to-store store ref #:optional (name (basename (svn-reference-url ref))) - #:key (log (current-error-port))) + #:key (log (current-error-port)) + (svn (subversion-package))) "Download from REF, a object to STORE. Write progress reports to LOG." (call-with-temporary-directory (lambda (temp) (let ((result (parameterize ((current-output-port log)) - (build:svn-fetch (svn-reference-url ref) + (with-imported-modules + (source-module-closure '((guix build svn) + (guix build utils))) + #~(begin + (use-modules (guix build svn) + (guix build utils)) + (svn-fetch (svn-reference-url ref) (svn-reference-revision ref) (string-append temp "/svn") + #+(file-append svn "/bin/svn") #:user-name (svn-reference-user-name ref) - #:password (svn-reference-password ref))))) + #:password (svn-reference-password ref))))))) (and result (add-to-store store name #t "sha256" (string-append temp "/svn"))))))) (define* (download-multi-svn-to-store store ref #:optional (name (basename (svn-multi-reference-url ref))) - #:key (log (current-error-port))) + #:key (log (current-error-port)) + (svn (subversion-package))) "Download from REF, a object to STORE. Write progress reports to LOG." (call-with-temporary-directory @@ -272,16 +282,23 @@ (define* (download-multi-svn-to-store store ref (let ((dir (string-append temp "/" (dirname location)))) (mkdir-p dir)) (parameterize ((current-output-port log)) - (build:svn-fetch (string-append (svn-multi-reference-url ref) - "/" location) + (with-imported-modules + (source-module-closure '((guix build svn) + (guix build utils))) + #~(begin + (use-modules (guix build svn) + (guix build utils)) + (svn-fetch (string-append (svn-multi-reference-url ref) + "/" location) (svn-multi-reference-revision ref) (if (string-suffix? "/" location) (string-append temp "/" location) (string-append temp "/" (dirname location))) + #+(file-append svn "/bin/svn") #:recursive? (svn-multi-reference-recursive? ref) #:user-name (svn-multi-reference-user-name ref) - #:password (svn-multi-reference-password ref)))) + #:password (svn-multi-reference-password ref)))))) (svn-multi-reference-locations ref)) (add-to-store store name #t "sha256" temp))))) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 05 10:08:19 2024 Received: (at 68935) by debbugs.gnu.org; 5 Feb 2024 15:08:19 +0000 Received: from localhost ([127.0.0.1]:52045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0a2-0004pA-Ix for submit@debbugs.gnu.org; Mon, 05 Feb 2024 10:08:18 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:43641 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0Zy-0004oD-Pq for 68935@debbugs.gnu.org; Mon, 05 Feb 2024 10:08:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707145673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/IPLwMx8HZP07Kwigd95/LUuPce0HMolgFR6mKhVN7w=; b=rc+HqMYWe8lBXNtF0yrXHkxg887bK7WbSmujKr0jJTcLjoVwO9uRbXtjnXbmXJHlKBxhHT u6TqqjF3TSOWFVe9mifTHkzWCJ/KdB75/mXOa8IVd4mljebt6HTBBnJHxfMFwDXwHU0voP xnM0qEWNM34h2Ee8TYrPETqcshhLyom7PQA2KegqEngTP5EAcxkB9QTouW4RYWueHLtJo1 8U9UnZnTg2HpYGji3F1QFUybGadRdc0v7daN0Ed5HhRVamfPAXvlTdj3JRpiPak62zX3NT Tu+O0laXcnwjvTfqFLw7JcsFkfeMoxShzuEWT22zINuODvbStCC069otTdDu0A== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 38f6fb90 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 5 Feb 2024 15:07:53 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH 2/3] guix: import: Wrap package expressions with define-public. Date: Mon, 5 Feb 2024 16:07:13 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Wrap package expressions. Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 --- guix/scripts/import.scm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Wrap package expressions. Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 --- guix/scripts/import.scm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/scripts/import.scm (guix-import): Wrap package expressions. Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 --- guix/scripts/import.scm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index d2a1cee56e..80b1bec7fc 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2022 Philip McGrath +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +24,7 @@ ;;; along with GNU Guix. If not, see . (define-module (guix scripts import) + #:use-module (guix import utils) #:use-module (guix ui) #:use-module (guix scripts) #:use-module (guix read-print) @@ -88,17 +90,23 @@ (define-command (guix-import . args) (leave-on-EPIPE (pretty-print-with-comments (current-output-port) expr))))) (match (apply (resolve-importer importer) args) - ((and expr (or ('package _ ...) - ('let _ ...) + ((and expr ('package _ ...)) + (print (package->definition expr))) + ((and expr (or ('let _ ...) ('define-public _ ...))) (print expr)) ((? list? expressions) (for-each (lambda (expr) - (print expr) - ;; Two newlines: one after the closing paren, and - ;; one to leave a blank line. - (newline) (newline)) - expressions)) + (match expr + ((and expr ('package _ ...)) + (print (package->definition expr))) + ((and expr (or ('let _ ...) + ('define-public _ ...))) + (print expr))) + ;; Two newlines: one after the closing paren, and + ;; one to leave a blank line. + (newline) (newline)) + expressions)) (x (leave (G_ "'~a' import failed~%") importer)))) (let ((hint (string-closest importer importers #:threshold 3))) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 05 10:08:19 2024 Received: (at 68935) by debbugs.gnu.org; 5 Feb 2024 15:08:19 +0000 Received: from localhost ([127.0.0.1]:52047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0a3-0004pI-2C for submit@debbugs.gnu.org; Mon, 05 Feb 2024 10:08:19 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:43109 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0Zy-0004od-Pp for 68935@debbugs.gnu.org; Mon, 05 Feb 2024 10:08:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707145677; 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=D3zUN2GJzMX0yBFtuIidLr6HXh+Sv2QSl0hP9C5ux0Y=; b=rEwOJijsGDNxnmmbtCVFpW5O/dlHWSxKPwZmKdHfZ6dtAjEOzpbZAGRssejpTyHU+TjTze aZhFYZSblZXPKI6rhDEF3ulsafqJrmJwXawTM//9jjn3lnAuUjKctq5aEHeHAb0+fv/0XL HvMWDK0juD2koiEZ0HihA1GTdku89kpJovsiDyxy6YrWrhJix8GUV8zPuXDubfiHcD3wRk qiJgHLwM/D+zj9Ypq+mF5qARr2L7vG6iEjs0ZnjcbjMnNefdRuGrdloeh5GTU3fXsroISt kps5BQfQdPRq8nUu6it5HxNcQOhx2IHUxZFT8k+ZYVcRIYD3zGhybJufVNxfZQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 91e67915 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 5 Feb 2024 15:07:57 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH 3/3] guix: import: Put packages into modules in alphabetical order. Date: Mon, 5 Feb 2024 16:07:14 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Add 'put' option. (try-import): Add variable. * doc/guix.texi (Invoking guix import): Describe 'put' option. Change-Id: Ied4fc95899c31fb2523a01139780fc9744aa63cb --- doc/guix.texi | 14 +++++- guix/scripts/import.scm | 100 +++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 33 deletion [...] Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Add 'put' option. (try-import): Add variable. * doc/guix.texi (Invoking guix import): Describe 'put' option. Change-Id: Ied4fc95899c31fb2523a01139780fc9744aa63cb --- doc/guix.texi | 14 +++++- guix/scripts/import.scm | 100 +++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 33 deletion [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/scripts/import.scm (guix-import): Add 'put' option. (try-import): Add variable. * doc/guix.texi (Invoking guix import): Describe 'put' option. Change-Id: Ied4fc95899c31fb2523a01139780fc9744aa63cb --- doc/guix.texi | 14 +++++- guix/scripts/import.scm | 100 +++++++++++++++++++++++++++------------- 2 files changed, 81 insertions(+), 33 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index b76df868f8..5ab4c0d2a8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -124,6 +124,7 @@ Copyright @copyright{} 2023 Saku Laesvuori@* Copyright @copyright{} 2023 Graham James Addis@* Copyright @copyright{} 2023 Tomas Volf@* +Copyright @copyright{} 2024 Herman Rimm@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -14178,12 +14179,21 @@ Invoking guix import The general syntax is: @example -guix import @var{importer} @var{options}@dots{} +guix import @var{option} @var{importer} @var{options}@dots{} @end example @var{importer} specifies the source from which to import package metadata, and @var{options} specifies a package identifier and other -options specific to @var{importer}. +options specific to @var{importer}. @command{guix import} itself has the +following options: + +@table @code +@item --put=@var{file} +@itemx -p @var{file} +Insert the package definition(s) that the @var{importer} generated into the +specified @var{file}, either in alphabetical order among existing package +definitions, or at the end of the file otherwise. +@end table Some of the importers rely on the ability to run the @command{gpgv} command. For these, GnuPG must be installed and in @code{$PATH}; run @code{guix install diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 80b1bec7fc..0d83483c4e 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -24,6 +24,7 @@ ;;; along with GNU Guix. If not, see . (define-module (guix scripts import) + #:use-module (guix build utils) #:use-module (guix import utils) #:use-module (guix ui) #:use-module (guix scripts) @@ -67,10 +68,37 @@ (define (show-help) (display (G_ " -h, --help display this help and exit")) (display (G_ " + -p, --put put the import in a package module")) + (display (G_ " -V, --version display version information and exit")) (newline) (show-bug-report-information)) +(define (try-import importer args finish) + (if (member importer importers) + (match (apply (resolve-importer importer) args) + ((and expr ('package _ ...)) + (finish (package->definition expr))) + ((and expr (or ('let _ ...) + ('define-public _ ...))) + (finish expr)) + ((? list? expressions) + (for-each (lambda (expr) + (match expr + ((and expr ('package _ ...)) + (finish (package->definition expr))) + ((and expr (or ('let _ ...) + ('define-public _ ...))) + (finish expr)))) + expressions)) + (x + (leave (G_ "'~a' import failed~%") importer))) + (let ((hint (string-closest importer importers #:threshold 3))) + (report-error (G_ "~a: invalid importer~%") importer) + (when hint + (display-hint (G_ "Did you mean @code{~a}?~%") hint)) + (exit 1)))) + (define-command (guix-import . args) (category packaging) (synopsis "import a package definition from an external repository") @@ -79,38 +107,48 @@ (define-command (guix-import . args) (() (format (current-error-port) (G_ "guix import: missing importer name~%"))) - ((or ("-h") ("--help")) + ((or ("-h" _ ...) ("--help" _ ...)) (leave-on-EPIPE (show-help)) (exit 0)) - ((or ("-V") ("--version")) + ((or ("-V" _ ...) ("--version" _ ...)) (show-version-and-exit "guix import")) + ((or ("-p" module importer args ...) + ("--put" module importer args ...)) + (let ((put (lambda (expr) + (let ((line + (call-with-input-file module + (lambda (port) + (do ((se (read-syntax port) + (read-syntax port))) + ((match (syntax->datum se) + (('define-public symbol _ ...) + (string> (symbol->string symbol) + (symbol->string (cadr expr)))) + ((? eof-object?) #t) + (_ #f)) + (if (eof-object? se) + #f + (car (string-split + (object->string* + (syntax->datum se) 0) + #\newline))))))))) + (if line + (substitute* module + (((string-append "\\" line)) + (string-append + (object->string* expr 0) + "\n\n" line))) + (let ((port (open-file module "a"))) + (pretty-print-with-comments port expr) + (newline port) + (close-port port))))))) + (try-import importer args put))) ((importer args ...) - (if (member importer importers) - (let ((print (lambda (expr) - (leave-on-EPIPE - (pretty-print-with-comments (current-output-port) expr))))) - (match (apply (resolve-importer importer) args) - ((and expr ('package _ ...)) - (print (package->definition expr))) - ((and expr (or ('let _ ...) - ('define-public _ ...))) - (print expr)) - ((? list? expressions) - (for-each (lambda (expr) - (match expr - ((and expr ('package _ ...)) - (print (package->definition expr))) - ((and expr (or ('let _ ...) - ('define-public _ ...))) - (print expr))) - ;; Two newlines: one after the closing paren, and - ;; one to leave a blank line. - (newline) (newline)) - expressions)) - (x - (leave (G_ "'~a' import failed~%") importer)))) - (let ((hint (string-closest importer importers #:threshold 3))) - (report-error (G_ "~a: invalid importer~%") importer) - (when hint - (display-hint (G_ "Did you mean @code{~a}?~%") hint)) - (exit 1)))))) + (let ((print (lambda (expr) + (leave-on-EPIPE + (pretty-print-with-comments + (current-output-port) expr) + ;; Two newlines: one after the closing paren, + ;; and one to leave a blank line. + (newline) (newline))))) + (try-import importer args print))))) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 07 16:34:31 2024 Received: (at 68935) by debbugs.gnu.org; 7 Feb 2024 21:34:31 +0000 Received: from localhost ([127.0.0.1]:58061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXpYs-0002Ik-MU for submit@debbugs.gnu.org; Wed, 07 Feb 2024 16:34:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXpYr-0002IY-1E for 68935@debbugs.gnu.org; Wed, 07 Feb 2024 16:34:29 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXpYT-0003ye-Ju; Wed, 07 Feb 2024 16:34:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=tDskGhrJ1Y7Jdp/3nEXj+Z1AKnwTcUoyimmG+jOC6BY=; b=OkZ6lxctdgv/vuWc6UFc UXHpYAfLXlGcAAIQTV7kfE2zYIiebfTmTvM/zZJV6zx7l9QmmJOM7rgpZqwzIcFB6P4pav9bbErof 2vYxb9RtItWGig9lNkF1f5tB8SiBkKHSwUQ7yxU/BdCiN8POeBzSZKYtC6LMPRyxVtXDlZ459ogrY dvpWcUKOms2GkijHblypVQ31RZpHv/M7AxW0dPfz2izJtFfpAhQrd/vAiIUCPwbJHR07fd5PaNzty EfR5FDL5JkHyav1iBQeCCo6LHuk5B7UmXw8mZ3Yx5BGsFN000k1oodIrsfs4sRulIVhp59cnnXf7Q XzdquNIwDe4veQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Herman Rimm Subject: Re: [bug#68935] [PATCH 1/3] svn-fetch: Require svn-command argument. In-Reply-To: <3a3748ee3fd345ff26bd63979bf8cee2c32d87ab.1707144191.git.herman@rimm.ee> (Herman Rimm's message of "Mon, 5 Feb 2024 16:07:12 +0100") References: <3a3748ee3fd345ff26bd63979bf8cee2c32d87ab.1707144191.git.herman@rimm.ee> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 19 =?utf-8?Q?Pluvi=C3=B4se?= an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de la Pulmonaire X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 07 Feb 2024 22:34:01 +0100 Message-ID: <87fry43qnq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68935 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 68935@debbugs.gnu.org, Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Herman, Herman Rimm skribis: > * guix/build/svn.scm (svn-fetch): Require svn-command argument. > * guix/svn-download.scm: Pass svn-command to each (svn-fetch). > > Change-Id: Ibc7d3a79e45374588f71ca4d4ac2685c60ff3c00 Usually we write all the entities (procedures, variables, etc.) modified in the commit log to help review. > -(define* (svn-fetch url revision directory > - #:key (svn-command "svn") > - (recursive? #t) > +(define* (svn-fetch url revision directory svn-command > + #:key (recursive? #t) > (user-name #f) > (password #f)) What=E2=80=99s the rationale for this change? It=E2=80=99s a relatively common pattern in Guix build-side code to assume = that commands can be found in $PATH while still providing a way to specify the command=E2=80=99s absolute file name. > (define* (download-svn-to-store store ref > #:optional (name (basename (svn-referenc= e-url ref))) > - #:key (log (current-error-port))) > + #:key (log (current-error-port)) > + (svn (subversion-package))) > "Download from REF, a object to STORE. Write progress > reports to LOG." > (call-with-temporary-directory > (lambda (temp) > (let ((result > (parameterize ((current-output-port log)) > - (build:svn-fetch (svn-reference-url ref) > + (with-imported-modules > + (source-module-closure '((guix build svn) > + (guix build utils))) > + #~(begin > + (use-modules (guix build svn) > + (guix build utils)) > + (svn-fetch (svn-reference-url ref) > (svn-reference-revision ref) > (string-append temp "/svn") > + #+(file-append svn "/bin/svn") > #:user-name (svn-reference-user-name ref) > - #:password (svn-reference-password ref)))= )) > + #:password (svn-reference-password ref)))= )))) > (and result > (add-to-store store name #t "sha256" > (string-append temp "/svn"))))))) This doesn=E2=80=99t have the desired effect: =E2=80=98download-svn-to-stor= e=E2=80=99 will now always return a gexp instead of returning either #f or a store file name. This procedure and =E2=80=98download-multi-svn-to-store=E2=80=99 (used by t= he texlive importer) really expect =E2=80=9Csvn=E2=80=9D to be in $PATH. It cannot re= ally be avoided AFAICS. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 07 16:39:22 2024 Received: (at 68935) by debbugs.gnu.org; 7 Feb 2024 21:39:22 +0000 Received: from localhost ([127.0.0.1]:58070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXpdZ-0002Pm-Ng for submit@debbugs.gnu.org; Wed, 07 Feb 2024 16:39:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXpdX-0002PY-G4 for 68935@debbugs.gnu.org; Wed, 07 Feb 2024 16:39:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXpdC-0004iZ-CK; Wed, 07 Feb 2024 16:38:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=WyZ/Kq6A1fKx2JLduXZU0yT6kcC4gdaaGrNpmItNkt0=; b=a+97lPfu8FRgywkV2kq1 w2hPzlbnVjXZc12f5+lvE9DnhR/ZxmdckrCjTj+qTFmZsd/UbcJ38xvafztnarBvzI0zOGDcBHWow V6lQCj3gBRCl7kCprWxX6R0NlC6PPFzkXrFy1j0AxOuOGx8zKodtqwAC7Uxavr5UxLZdt0ERfpr3N mTqgrpcO92vaGXBBqfPrfS2g1rG3N1geg5Lwk0Lw4bVfRcsAsMRGlZQ16vuxaAWSseutM3FGqTG4K ywtLyTFU9y5cJSrIBsriaJIfLVpEXxCGZdMc9ilw7yMt/fHzoVYZXPdFbRh0cR4jXi7EQ4Sdaq7sH +2aDXsPLPonmig==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Herman Rimm Subject: Re: [bug#68935] [PATCH 2/3] guix: import: Wrap package expressions with define-public. In-Reply-To: (Herman Rimm's message of "Mon, 5 Feb 2024 16:07:13 +0100") References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 19 =?utf-8?Q?Pluvi=C3=B4se?= an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de la Pulmonaire X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 07 Feb 2024 22:38:52 +0100 Message-ID: <87bk8s3qfn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68935 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 68935@debbugs.gnu.org, Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Herman Rimm skribis: > * guix/scripts/import.scm (guix-import): Wrap package expressions. > > Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 Probably a good idea! > (match (apply (resolve-importer importer) args) > - ((and expr (or ('package _ ...) > - ('let _ ...) > + ((and expr ('package _ ...)) > + (print (package->definition expr))) > + ((and expr (or ('let _ ...) > ('define-public _ ...))) > (print expr)) The (let =E2=80=A6) case should be treated like the (package =E2=80=A6) cas= e. It corresponds to things like: (let ((commit "abcde")) (package =E2=80=A6)) > + (match expr > + ((and expr ('package _ ...)) > + (print (package->definition expr))) > + ((and expr (or ('let _ ...) > + ('define-public _ ...))) > + (print expr))) Same here. Also, please indent =E2=80=98match=E2=80=99 the same way as elsewhere in th= e code: (match lst ((x y z) =E2=80=A6)) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 07 16:57:44 2024 Received: (at 68935) by debbugs.gnu.org; 7 Feb 2024 21:57:44 +0000 Received: from localhost ([127.0.0.1]:58089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXpvL-0002vu-CY for submit@debbugs.gnu.org; Wed, 07 Feb 2024 16:57:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rXpvJ-0002ve-4d for 68935@debbugs.gnu.org; Wed, 07 Feb 2024 16:57:42 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rXpuw-0007jb-Oj; Wed, 07 Feb 2024 16:57:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=0rK3aN9asCsaUq+Cn675IoolNO2vaB0oi9Y081BVDho=; b=aB/W95QrJGDW2EzXGZkq uvtp+defpwKLpZXzOJMvcVSTuVr2BYP7JuSLMmn1vEqT+REnkFF7M9u0xwyFNhjWSE58Jt0B8X7+i j6PPkI/cLwuHxjY3u6y8Oc5qpkH7Qkth23nnhgRpBAuaQdXfaH9nspa9wCogr2eD/IILNRob0dpsL DVH2v1qzV+NJD7WDOpbIumAkJ9VKMNuWNAvVU/VnC16h4+OhWJ/ebma2U4JCxEPkUpvdVB2Z7HUks S9WxRmAqUqjpFftOxsGBkkcu14P3vqhxQx9VDdjsH3e9GiwXDGr/3jUgJKiyEWDBlqTo0lLx7GSHQ MtV5cXxQg9Zkxw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Herman Rimm Subject: Re: [bug#68935] [PATCH 3/3] guix: import: Put packages into modules in alphabetical order. In-Reply-To: (Herman Rimm's message of "Mon, 5 Feb 2024 16:07:14 +0100") References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 19 =?utf-8?Q?Pluvi=C3=B4se?= an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de la Pulmonaire X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 07 Feb 2024 22:57:12 +0100 Message-ID: <874jek3pl3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68935 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 68935@debbugs.gnu.org, Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Herman Rimm skribis: > * guix/scripts/import.scm (guix-import): Add 'put' option. > (try-import): Add variable. > * doc/guix.texi (Invoking guix import): Describe 'put' option. > > Change-Id: Ied4fc95899c31fb2523a01139780fc9744aa63cb Nice! This can certainly simplify people=E2=80=99s work! > @example > -guix import @var{importer} @var{options}@dots{} > +guix import @var{option} @var{importer} @var{options}@dots{} Uh? It looks weird at first. :-) For clarity, we should change it to something like: guix import [@var{global-options}@dots{}] @var{importer} @var{package} [@= var{options}@dots{}] =E2=80=A6 though I admit this doesn=E2=80=99t look great either. > +@item --put=3D@var{file} > +@itemx -p @var{file} > +Insert the package definition(s) that the @var{importer} generated into = the How about calling it =E2=80=98--insert=E2=80=99? It seems more natural. > +(define (try-import importer args finish) Please add a docstring for top-level procedures like this one: https://guix.gnu.org/manual/devel/en/html_node/Formatting-Code.html > + (if (member importer importers) > + (match (apply (resolve-importer importer) args) Indentation of the second line is off. > + ((and expr ('package _ ...)) > + (finish (package->definition expr))) > + ((and expr (or ('let _ ...) > + ('define-public _ ...))) > + (finish expr)) Again (let =E2=80=A6) should be treated like (package =E2=80=A6). > + ((? list? expressions) > + (for-each (lambda (expr) > + (match expr > + ((and expr ('package _ ...)) > + (finish (package->definition expr))) > + ((and expr (or ('let _ ...) > + ('define-public _ ...))) > + (finish expr)))) Likewise. Also indentation of =E2=80=98match=E2=80=99 and that of the subs= equent clauses is off. > - ((or ("-h") ("--help")) > + ((or ("-h" _ ...) ("--help" _ ...)) > (leave-on-EPIPE (show-help)) > (exit 0)) > - ((or ("-V") ("--version")) > + ((or ("-V" _ ...) ("--version" _ ...)) > (show-version-and-exit "guix import")) This change seems to be unrelated, right? > + ((or ("-p" module importer args ...) > + ("--put" module importer args ...)) > + (let ((put (lambda (expr) > + (let ((line > + (call-with-input-file module > + (lambda (port) > + (do ((se (read-syntax port) > + (read-syntax port))) > + ((match (syntax->datum se) > + (('define-public symbol _ ...) > + (string> (symbol->string symbol) > + (symbol->string (cadr expr)))) > + ((? eof-object?) #t) > + (_ #f)) > + (if (eof-object? se) > + #f > + (car (string-split > + (object->string* > + (syntax->datum se) 0) > + #\newline))))))))) > + (if line > + (substitute* module > + (((string-append "\\" line)) > + (string-append > + (object->string* expr 0) > + "\n\n" line))) > + (let ((port (open-file module "a"))) > + (pretty-print-with-comments port expr) > + (newline port) > + (close-port port))))))) This whole thing should be in a separate procedure, probably in (guix utils), close to =E2=80=98edit-expression=E2=80=99, and we could call it =E2=80=98insert-expression=E2=80=99 and it would take the location where th= e caller wants to insert an expression. Then, separately, we need a procedure to determine that location based on the alphabetical order to top-level =E2=80=98define-public=E2=80=99 occu= rrences. Does that make sense? We should try and add tests for these in =E2=80=98tests/utils.scm=E2=80=99. Also please check out the coding style regarding use of =E2=80=98car=E2=80= =99 etc.: https://guix.gnu.org/manual/devel/en/html_node/Data-Types-and-Pattern-Mat= ching.html Could you send an updated series? Please let us know if anything=E2=80=99s unclear or if you need guidance. Thank you! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 09 14:26:41 2024 Received: (at 68935) by debbugs.gnu.org; 9 Feb 2024 19:26:41 +0000 Received: from localhost ([127.0.0.1]:60217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWG-0001Yk-O4 for submit@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:41 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:51759 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWF-0001YI-2P for 68935@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707506772; 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; bh=+YRzR+vmH2DgPo4iAVuqWT0asuqrsZL/5RzjwEqjBiw=; b=hUOac+3z2arq5DPuI9HRVHKNZkejl8QVtAoAElIfkUaoV89N5cx7Yrb+BdF7TXWWrvDknu 4DGkfncSW3/gQwdW/xZFLS7cWv+1t6FV/1kDceAT86piYY8i9TxV+pafw9jy3DFS8ps7NB xgy4HpFyVdA44FT4GsvCrR9xN5PHYA5R/5ixpwrsulPmxxq9CYH/INPMv3wcrgfC7iKvgP U8XYOK5CLRYVmqAf4muqzFkLdTiP5YHEhn4bZ4LAc2uPKiPcIyWrnHn3o9wAuDwpDEIy9X BV4uqGri7LT0t2FziKRcfOM53068LuRHW9Pi7GJgNBeKxJFirSsMcv9yu5CWOQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id ea4793cb (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 9 Feb 2024 19:26:12 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v2 1/6] doc: Note SVN dependency of texlive importer. Date: Fri, 9 Feb 2024 20:25:13 +0100 Message-ID: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * doc/guix.texi (Invoking guix import): Note dependency and remove duplicated words. Change-Id: I94320db8c8ab3569aa461876522d5560e37a19ea --- doc/guix.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * doc/guix.texi (Invoking guix import): Note dependency and remove duplicated words. Change-Id: I94320db8c8ab3569aa461876522d5560e37a19ea --- doc/guix.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * doc/guix.texi (Invoking guix import): Note dependency and remove duplicated words. Change-Id: I94320db8c8ab3569aa461876522d5560e37a19ea --- doc/guix.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index b76df868f8..2908085c36 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14334,7 +14334,7 @@ Invoking guix import Information is extracted from the @file{DESCRIPTION} file of the package. -The command command below imports metadata for the Cairo R package: +The command below imports metadata for the Cairo R package: @example guix import cran Cairo @@ -14394,10 +14394,10 @@ Invoking guix import database, a plain text file that is included in the @code{texlive-scripts} package. The source code is downloaded from possibly multiple locations in the SVN repository of the Tex Live -project. +project. Note that therefore SVN must be installed and in @code{$PATH}; +run @code{guix install subversion} if needed. -The command command below imports metadata for the @code{fontspec} -TeX package: +The command below imports metadata for the @code{fontspec} TeX package: @example guix import texlive fontspec base-commit: 513755d64debb44096f21e323a5b89a7a597d2ca -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 09 14:26:44 2024 Received: (at 68935) by debbugs.gnu.org; 9 Feb 2024 19:26:44 +0000 Received: from localhost ([127.0.0.1]:60226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWK-0001ZC-AD for submit@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:44 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:51759 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWG-0001YI-1s for 68935@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707506772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n7/eXQHPwdA8yU/5u6PHavnbXN5Xb8pyTdzEnAI/A3A=; b=e3WOTY9oROQwt+dFt/3ulU4IZwnYnKzOmLhn7TVkElzI7KHKDTiZXZQaECVHWH2clfxNF3 fZQw1SyZxT/cQDOBPUft1u1PHNoZDLG23GyDOKcaQx6A6WrxGDJhYdAPSVAPSObdq3xORd iQ+Q8p5jwJhAFrjxABmtt5s7D69NR0CIvFcOctp/v+ofYYitoAF8bXZbFJ3kkyaR5slOsb jRggcyTRDXll7SVIm0I4yb1gkk0qlTJK8xI1zQodyKZ/mj2AB68mZt6y49L3QuQa92zcUm 98A302YJi/ZEAxK/diOapRz0+/MAvPGLBBX2i01IZvCQjJaai/VW4MxqVTT3Zw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id ca0198e2 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 9 Feb 2024 19:26:12 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v2 2/6] import: Wrap package expressions with define-public. Date: Fri, 9 Feb 2024 20:25:14 +0100 Message-ID: <037f2a3e463ed6ed6767356ec1c95a33cf08b658.1707505804.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Wrap package expressions. Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 --- guix/scripts/import.scm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Wrap package expressions. Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 --- guix/scripts/import.scm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/scripts/import.scm (guix-import): Wrap package expressions. Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 --- guix/scripts/import.scm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index d2a1cee56e..77fcfe3990 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2022 Philip McGrath +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +24,7 @@ ;;; along with GNU Guix. If not, see . (define-module (guix scripts import) + #:use-module (guix import utils) #:use-module (guix ui) #:use-module (guix scripts) #:use-module (guix read-print) @@ -89,12 +91,18 @@ (define-command (guix-import . args) (pretty-print-with-comments (current-output-port) expr))))) (match (apply (resolve-importer importer) args) ((and expr (or ('package _ ...) - ('let _ ...) - ('define-public _ ...))) + ('let _ ...))) + (print (package->definition expr))) + ((and expr ('define-public _ ...)) (print expr)) ((? list? expressions) (for-each (lambda (expr) - (print expr) + (match expr + ((and expr (or ('package _ ...) + ('let _ ...))) + (print (package->definition expr))) + ((and expr ('define-public _ ...)) + (print expr))) ;; Two newlines: one after the closing paren, and ;; one to leave a blank line. (newline) (newline)) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 09 14:26:47 2024 Received: (at 68935) by debbugs.gnu.org; 9 Feb 2024 19:26:47 +0000 Received: from localhost ([127.0.0.1]:60232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWM-0001Zl-Pt for submit@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:47 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:51759 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWH-0001YI-Fs for 68935@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707506773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bo58dJWIAT1XdgL+H8EMd72drBrY1EfYAOnRR/lhCuU=; b=pinwblhG0M0VHFJFL2PWPK88ZiZ8pxd5FE+SNgQUHj8L5WuIcQ4/isv57x11bCVAYZxK1s cGWJ66MoOIuSwDQQxhuJoIURoDeAmxKLSqCZOtGCWIATGY6MGBeIrhQJDUsROfSoMAjbQS dc3r0SmQ5fWhm16yYEefP2lpNZIZAz59XdL+JVN+vMMMInhZWAsFwKo66rHym6/eSwmPY/ FmebuPiTNtomIdshVnnalvzGuIlBfsIiOk0q76ZRyHXS1XZj5EmOt6sjhHNKffFpdq+cYx 916fTy3412vpgLoEBQapzm7N4U/zwj+64Odk4doHftK5dx/lvyhSak8/U3mTUA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 1eb830c3 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 9 Feb 2024 19:26:13 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v2 3/6] utils: Add insert-expression procedure. Date: Fri, 9 Feb 2024 20:25:15 +0100 Message-ID: <69ff85b93e8a7f9095412429c213a2e10e9b0e6d.1707505804.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/utils.scm (define-module): Use (guix read-print) and export (insert-expression). (insert-expression): Add procedure. * tests/utils.scm ("insert-expression"): Add test. Change-Id: I971a43a78aa6ecaaef33c1a7a0db4b287eb85036 --- guix/utils.scm | 11 +++++++++++ tests/utils.scm | 14 ++++++++++++++ 2 files changed, 25 insertions(+) Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/utils.scm (define-module): Use (guix read-print) and export (insert-expression). (insert-expression): Add procedure. * tests/utils.scm ("insert-expression"): Add test. Change-Id: I971a43a78aa6ecaaef33c1a7a0db4b287eb85036 --- guix/utils.scm | 11 +++++++++++ tests/utils.scm | 14 ++++++++++++++ 2 files changed, 25 insertions(+) Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/utils.scm (define-module): Use (guix read-print) and export (insert-expression). (insert-expression): Add procedure. * tests/utils.scm ("insert-expression"): Add test. Change-Id: I971a43a78aa6ecaaef33c1a7a0db4b287eb85036 --- guix/utils.scm | 11 +++++++++++ tests/utils.scm | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm index e4e9d922e7..8f0bc2399e 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2023 Janneke Nieuwenhuizen ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2023 Foundation Devices, Inc. +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,6 +39,7 @@ (define-module (guix utils) #:use-module (guix config) + #:use-module (guix read-print) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) @@ -145,6 +147,7 @@ (define-module (guix utils) go-to-location edit-expression delete-expression + insert-expression filtered-port decompressed-port @@ -502,6 +505,14 @@ (define (delete-expression source-properties) "Delete the expression specified by SOURCE-PROPERTIES." (edit-expression source-properties (const "") #:include-trailing-newline? #t)) +(define (insert-expression source-properties expr) + "Insert EXPR before the top-level expression specified by +SOURCE-PROPERTIES." + (let* ((expr (object->string* expr 0)) + (insert (lambda (str) + (string-append expr "\n\n" str)))) + (edit-expression source-properties insert))) + ;;; ;;; Keyword arguments. diff --git a/tests/utils.scm b/tests/utils.scm index 5664165c85..cd54112846 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2023 Foundation Devices, Inc. +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -274,6 +275,19 @@ (define (test-compression/decompression method run?) string-reverse) (call-with-input-file temp-file get-string-all))) +(test-equal "insert-expression" + "(define-public package-1\n 'package)\n +(define-public package-2\n 'package)\n" + (begin + (call-with-output-file temp-file + (lambda (port) + (display "(define-public package-2\n 'package)\n" port))) + (insert-expression `((filename . ,temp-file) + (line . 0) + (column . 0)) + `(define-public package-1 'package)) + (call-with-input-file temp-file get-string-all))) + (test-equal "string-distance" '(0 1 1 5 5) (list -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 09 14:26:47 2024 Received: (at 68935) by debbugs.gnu.org; 9 Feb 2024 19:26:47 +0000 Received: from localhost ([127.0.0.1]:60234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWN-0001Zp-Ee for submit@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:47 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:52227 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWK-0001Ya-8O for 68935@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707506774; 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=iglSg6lJSvpt1mvW6yDKA1v6LBrFqLDh2JD8IjI932s=; b=MRNR7yIGmS53WTOZ9vhbX4SwkOYaON7jlqqfRJz8gbeGb3QdQkvIhb4/viH3aoyL9uwUXb qd/WgKIRGo5h4L5687gQZSbAb9GlvsZ3FXbvrLxSubuYGbVb20vR2Q3WFO+gHwVydvsvHp wxfF6TsWycGiu/otX9xJi+V2icq+C8aQflH6eFkFXmw2R/xuhRBVu9bsoux+xcTdj8Mpko vpBrcV2EyOVoA2Th+lav1Bpu6XEzd6qlLwEgJOTpDs217sALrFokXHBPxHsNH5G64IEtAH xBCvxdJ8hs66KvBqZ92N2DOsUX4ugKPmiKpvO+weP4oX/ZF6gvIPLq901YFpTA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id a31a6ace (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 9 Feb 2024 19:26:14 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v2 4/6] utils: Add find-expression procedure. Date: Fri, 9 Feb 2024 20:25:16 +0100 Message-ID: <028a3d700965947fa0547eb17d4894b8302eb67c.1707505804.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/utils.scm (find-expression): Add and export procedure. * tests/utils.scm ("find-expression"): Add test. Change-Id: Ie209df39c1f006b20aa6436fb1aef4c84b1694ee --- guix/utils.scm | 24 ++++++++++++++++++++++++ tests/utils.scm | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/utils.scm (find-expression): Add and export procedure. * tests/utils.scm ("find-expression"): Add test. Change-Id: Ie209df39c1f006b20aa6436fb1aef4c84b1694ee --- guix/utils.scm | 24 ++++++++++++++++++++++++ tests/utils.scm | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/utils.scm (find-expression): Add and export procedure. * tests/utils.scm ("find-expression"): Add test. Change-Id: Ie209df39c1f006b20aa6436fb1aef4c84b1694ee --- guix/utils.scm | 24 ++++++++++++++++++++++++ tests/utils.scm | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm index 8f0bc2399e..315feeb232 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -148,6 +148,7 @@ (define-module (guix utils) edit-expression delete-expression insert-expression + find-expression filtered-port decompressed-port @@ -513,6 +514,29 @@ (define (insert-expression source-properties expr) (string-append expr "\n\n" str)))) (edit-expression source-properties insert))) +(define (find-expression file expr proc) + "Search in FILE for a top-level expression which alphabetically +succeeds EXPR. Call PROC with the location if found, or with #f +otherwise." + (let* ((name (match expr + (('define-public symbol _ ...) + (symbol->string symbol)))) + (source-properties + (call-with-input-file + file + (lambda (port) + (do ((syntax (read-syntax port) + (read-syntax port))) + ((match (syntax->datum syntax) + (('define-public symbol _ ...) + (string> (symbol->string symbol) + name)) + ((? eof-object?) #t) + (_ #f)) + (if (eof-object? syntax) + #f (syntax-source syntax)))))))) + (proc source-properties))) + ;;; ;;; Keyword arguments. diff --git a/tests/utils.scm b/tests/utils.scm index cd54112846..feaed4b561 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -288,6 +288,22 @@ (define-public package-2\n 'package)\n" `(define-public package-1 'package)) (call-with-input-file temp-file get-string-all))) +(test-equal "find-expression" + (list `((filename . ,temp-file) (line . 0) (column . 0)) + `((filename . ,temp-file) (line . 5) (column . 0)) + #f) + (begin + (call-with-output-file temp-file + (lambda (port) + (display "(define-public package-1\n 'foo)\n\n" port) + (display "(define foo 'bar)\n\n" port) + (display "(define-public package-2\n 'baz)\n" port))) + (map (lambda (expr) + (find-expression temp-file expr identity)) + (list `(define-public package 'foo) + `(define-public package-1 'bar) + `(define-public package-2 'baz))))) + (test-equal "string-distance" '(0 1 1 5 5) (list -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 09 14:26:48 2024 Received: (at 68935) by debbugs.gnu.org; 9 Feb 2024 19:26:48 +0000 Received: from localhost ([127.0.0.1]:60236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWN-0001a0-RJ for submit@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:48 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:51759 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWK-0001YI-Bs for 68935@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707506774; 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=qxhQEJqZIKomoOppxc2+l6rUODdzvnDtMhWKcvtj1CA=; b=Uhr+SwCwYPEuZWSKDFVsSA8G8ivh/7omDOrh9GGNKsbBgZSyIg1CwQaPNyhW2ae/05oLoV 5+c6hq4LNeeHWaITCL0uApLZnYza/9qmQClRqrtvJLNGqf3WGUPEFwoGY/kCkwLZ/cB4LO MTFcGT0cjFdUDKzUzatq9dFUjWzAJtFiaTZoYNBukdmPHIAbbny+2YQNhFx/qyrcRrkUvt x1axrtJ0qnzUuhDY7455nujlngHRDI+4jiNNszZOApuJnFvv2kFIdLj0S/aU7hTKsZtz6m Zo+HwIMsR6ee+L6k9G34DiOFdp+qUH+p9FopWOrfRLeWxXYxHnqo2qkLJlR2uQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id e19af69d (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 9 Feb 2024 19:26:14 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v2 5/6] import: Insert packages into modules alphabetically. Date: Fri, 9 Feb 2024 20:25:17 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Add 'insert' option. (define-import): Add procedure. * doc/guix.texi (Invoking guix import): Describe 'insert' option. Change-Id: Id021095355283ade79acde120890eb2ce9173cf7 --- doc/guix.texi | 14 ++++++-- guix/scripts/import.scm | 80 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 31 deleti [...] Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Add 'insert' option. (define-import): Add procedure. * doc/guix.texi (Invoking guix import): Describe 'insert' option. Change-Id: Id021095355283ade79acde120890eb2ce9173cf7 --- doc/guix.texi | 14 ++++++-- guix/scripts/import.scm | 80 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 31 deleti [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/scripts/import.scm (guix-import): Add 'insert' option. (define-import): Add procedure. * doc/guix.texi (Invoking guix import): Describe 'insert' option. Change-Id: Id021095355283ade79acde120890eb2ce9173cf7 --- doc/guix.texi | 14 ++++++-- guix/scripts/import.scm | 80 ++++++++++++++++++++++++++--------------- 2 files changed, 63 insertions(+), 31 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 2908085c36..c73db5cbbf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -124,6 +124,7 @@ Copyright @copyright{} 2023 Saku Laesvuori@* Copyright @copyright{} 2023 Graham James Addis@* Copyright @copyright{} 2023 Tomas Volf@* +Copyright @copyright{} 2024 Herman Rimm@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -14178,12 +14179,21 @@ Invoking guix import The general syntax is: @example -guix import @var{importer} @var{options}@dots{} +guix import [@var{global-options}@dots{}] @var{importer} @var{package} [@var{options}@dots{}] @end example @var{importer} specifies the source from which to import package metadata, and @var{options} specifies a package identifier and other -options specific to @var{importer}. +options specific to @var{importer}. @command{guix import} itself has the +following @var{global-options}: + +@table @code +@item --insert=@var{file} +@itemx -i @var{file} +Insert the package definition(s) that the @var{importer} generated into the +specified @var{file}, either in alphabetical order among existing package +definitions, or at the end of the file otherwise. +@end table Some of the importers rely on the ability to run the @command{gpgv} command. For these, GnuPG must be installed and in @code{$PATH}; run @code{guix install diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 77fcfe3990..850887e720 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -67,10 +67,39 @@ (define (show-help) (display (G_ " -h, --help display this help and exit")) (display (G_ " + -i, --insert insert into package module alphabetically")) + (display (G_ " -V, --version display version information and exit")) (newline) (show-bug-report-information)) +(define (define-import importer args proc) + "Wrap package expressions from IMPORTER with 'define-public and invoke +PROC callback." + (if (member importer importers) + (match (apply (resolve-importer importer) args) + ((and expr (or ('package _ ...) + ('let _ ...))) + (proc (package->definition expr))) + ((and expr ('define-public _ ...)) + (proc expr)) + ((? list? expressions) + (for-each (lambda (expr) + (match expr + ((and expr (or ('package _ ...) + ('let _ ...))) + (proc (package->definition expr))) + ((and expr ('define-public _ ...)) + (proc expr)))) + expressions)) + (x + (leave (G_ "'~a' import failed~%") importer))) + (let ((hint (string-closest importer importers #:threshold 3))) + (report-error (G_ "~a: invalid importer~%") importer) + (when hint + (display-hint (G_ "Did you mean @code{~a}?~%") hint)) + (exit 1)))) + (define-command (guix-import . args) (category packaging) (synopsis "import a package definition from an external repository") @@ -84,33 +113,26 @@ (define-command (guix-import . args) (exit 0)) ((or ("-V") ("--version")) (show-version-and-exit "guix import")) + ((or ("-i" module importer args ...) + ("--insert" module importer args ...)) + (let ((find-and-insert + (lambda (expr) + (let ((insert + (lambda (source-properties) + (if source-properties + (insert-expression source-properties expr) + (let ((port (open-file file "a"))) + (pretty-print-with-comments port expr) + (newline port) + (close-port port)))))) + (find-expression module expr insert))))) + (define-import importer args find-and-insert))) ((importer args ...) - (if (member importer importers) - (let ((print (lambda (expr) - (leave-on-EPIPE - (pretty-print-with-comments (current-output-port) expr))))) - (match (apply (resolve-importer importer) args) - ((and expr (or ('package _ ...) - ('let _ ...))) - (print (package->definition expr))) - ((and expr ('define-public _ ...)) - (print expr)) - ((? list? expressions) - (for-each (lambda (expr) - (match expr - ((and expr (or ('package _ ...) - ('let _ ...))) - (print (package->definition expr))) - ((and expr ('define-public _ ...)) - (print expr))) - ;; Two newlines: one after the closing paren, and - ;; one to leave a blank line. - (newline) (newline)) - expressions)) - (x - (leave (G_ "'~a' import failed~%") importer)))) - (let ((hint (string-closest importer importers #:threshold 3))) - (report-error (G_ "~a: invalid importer~%") importer) - (when hint - (display-hint (G_ "Did you mean @code{~a}?~%") hint)) - (exit 1)))))) + (let ((print (lambda (expr) + (leave-on-EPIPE + (pretty-print-with-comments + (current-output-port) expr) + ;; Two newlines: one after the closing paren, and + ;; one to leave a blank line. + (newline) (newline))))) + (define-import importer args print))))) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 09 14:26:48 2024 Received: (at 68935) by debbugs.gnu.org; 9 Feb 2024 19:26:48 +0000 Received: from localhost ([127.0.0.1]:60238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWO-0001a5-D7 for submit@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:48 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:52227 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYWWL-0001Ya-33 for 68935@debbugs.gnu.org; Fri, 09 Feb 2024 14:26:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707506774; 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=aU/tInGGOD5RBYNmXV5RWsOeN5B+59LiHAqW7UIBBs4=; b=TzJhbMj4LnPtZG2ZcWq/xM7tLhhcFwzI468mkY7//X63mzglh6s6aBURPUbntNf/guN6jW pL/8FIY8uSQGHs/dhl5i9WZ8se5cweWliFh9Q9T5ZiqlOQy37z4WQIAdY95vjRpxWSxVgW BAR4f+JV6Z39jo3L0tuBEUhblHHCTLkovF+q6oVjrqBuSF84ADQ5PH8F/UCSOZm/+jtvNS BfZdU9q7xUDvuXy5ONEqTCPwSjI3LlR1un/H+nuQzqYwGrNZ7CS+yUDbio9sHgfQVV4mTA rNbks9ZaSzRS6viV07YwoM9W5uTHLLeG8dSCpoDrxvevRqxJYaHU3AlOr8/Tvg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id d178b007 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 9 Feb 2024 19:26:14 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v2 6/6] import: Discard args after --version and --help. Date: Fri, 9 Feb 2024 20:25:18 +0100 Message-ID: <0faee744258ddfaa689a35a949d8e1674cdfe27d.1707505805.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Discard args. Change-Id: Icce5cd0daf9011f7ddde7904113b31b547f063ef --- guix/scripts/import.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 850887e720..3d77d1af55 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -108, 10 +108, 10 @@ (define-command (gu [...] Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Discard args. Change-Id: Icce5cd0daf9011f7ddde7904113b31b547f063ef --- guix/scripts/import.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 850887e720..3d77d1af55 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -108,10 +108,10 @@ (define-command (gu [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/scripts/import.scm (guix-import): Discard args. Change-Id: Icce5cd0daf9011f7ddde7904113b31b547f063ef --- guix/scripts/import.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 850887e720..3d77d1af55 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -108,10 +108,10 @@ (define-command (guix-import . args) (() (format (current-error-port) (G_ "guix import: missing importer name~%"))) - ((or ("-h") ("--help")) + ((or ("-h" _ ...) ("--help" _ ...)) (leave-on-EPIPE (show-help)) (exit 0)) - ((or ("-V") ("--version")) + ((or ("-V" _ ...) ("--version" _ ...)) (show-version-and-exit "guix import")) ((or ("-i" module importer args ...) ("--insert" module importer args ...)) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 10 10:25:16 2024 Received: (at 68935) by debbugs.gnu.org; 10 Feb 2024 15:25:16 +0000 Received: from localhost ([127.0.0.1]:48778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYpEA-0005Fj-ND for submit@debbugs.gnu.org; Sat, 10 Feb 2024 10:25:15 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:51833 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYowm-0004VC-1d for 68935@debbugs.gnu.org; Sat, 10 Feb 2024 10:07:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707577613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=op7bF8F1b1OTwSeokEUg8hn+kRNWkcf7ZjC40gFNidI=; b=r6S2c8QIxEqgRHIhsMKmYJKA6MvC0bHuo8qZgI9eUAaz4rffCMftXXSv34ZKD9Jvgg988P LDe9e6pEcsMeu7sXnZy4ygJflBbmsEwZB+JE6YOYD9rOAjtRegi0K8S6+DvI97mVTtFxQZ NH8uEeFa/W818BTQCS9weTXYPHcPzuySRNnunTbTrgMkWbwTF+Yd2Pfs7cLemFapidZbIE Ev2gGedslUVkNkFJyRHrsF9rl8eidudIbYcyPLs9t8qr0mLzMHB6vgq6crcIwFaKF2khUi K5DO/BmrSruQ8vg64NmAa1blRW5FU1CBsdhDZ0ZvHYgZ6QFYp3IiLGjKtNT2Bw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id e67dc082 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Sat, 10 Feb 2024 15:06:53 +0000 (UTC) Date: Sat, 10 Feb 2024 16:06:49 +0100 From: Herman Rimm To: 68935@debbugs.gnu.org Subject: Re: [PATCH v2 5/6] import: Insert packages into modules alphabetically. Message-ID: References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Score: 3.5 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, On Fri, Feb 09, 2024 at 08:25:17PM +0100, Herman Rimm wrote: > diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm > index 77fcfe3990..850887e720 100644 > --- a/guix/scripts/import.scm > ++ [...] Content analysis details: (3.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, On Fri, Feb 09, 2024 at 08:25:17PM +0100, Herman Rimm wrote: > diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm > index 77fcfe3990..850887e720 100644 > --- a/guix/scripts/import.scm > ++ [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hi, On Fri, Feb 09, 2024 at 08:25:17PM +0100, Herman Rimm wrote: > diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm > index 77fcfe3990..850887e720 100644 > --- a/guix/scripts/import.scm > +++ b/guix/scripts/import.scm > @@ -67,10 +67,39 @@ (define (show-help) > (display (G_ " > -h, --help display this help and exit")) > (display (G_ " > + -i, --insert insert into package module alphabetically")) > + (display (G_ " > -V, --version display version information and exit")) > (newline) > (show-bug-report-information)) > > +(define (define-import importer args proc) > + "Wrap package expressions from IMPORTER with 'define-public and invoke > +PROC callback." > + (if (member importer importers) > + (match (apply (resolve-importer importer) args) > + ((and expr (or ('package _ ...) > + ('let _ ...))) > + (proc (package->definition expr))) > + ((and expr ('define-public _ ...)) With doc/package-hello.json file: [ { "name": "myhello", "version": "2.10", "source": "mirror://gnu/hello/hello-2.10.tar.gz", "build-system": "gnu", "arguments": { "tests?": false }, "home-page": "https://www.gnu.org/software/hello/", "synopsis": "Hello, GNU world: An example GNU package", "description": "GNU Hello prints a greeting.", "license": "GPL-3.0+", "native-inputs": ["gettext"] } ] 'guix import json doc/package-hello.json' produces: Starting download of /tmp/guix-file.BLTipY From https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz... following redirection to `https://mirrors.ibiblio.org/gnu/hello/hello-2.10.tar.gz'... …10.tar.gz 709KiB 1.6MiB/s 00:00 ▕██████████████████▏ 100.0% (define-public myhello (package (name "myhello") (version "2.10") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/hello/hello-" version ".tar.gz")) (sha256 (base32 "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i")))) (build-system (@ (guix build-system gnu) gnu-build-system)) (arguments `(#:tests? #f)) (native-inputs (list (@ (gnu packages gettext) gnu-gettext))) (home-page "https://www.gnu.org/software/hello/") (synopsis "Hello, GNU world: An example GNU package") (description "GNU Hello prints a greeting.") (license license:gpl3+))) Backtrace: 4 (primitive-load "/home/herman/.cache/guix/inferiors/umi…") In guix/ui.scm: 2324:7 3 (run-guix . _) 2287:10 2 (run-guix-command _ . _) In srfi/srfi-1.scm: 634:9 1 (for-each # …) In guix/scripts/import.scm: 88:21 0 (_ _) guix/scripts/import.scm:88:21: Throw to key `match-error' with args `("match" "no matching pattern" myhello)'. I think I can remove the (myhello) variable expression after definition from the JSON importer in a future revision. Just a heads up. Also I provided a reduced package-hello.json, because after fixing the comma syntax, importing the file gives: Starting download of /tmp/guix-file.dVsYSt From https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz... following redirection to `https://mirrors.ibiblio.org/gnu/hello/hello-2.10.tar.gz'... …10.tar.gz 709KiB 1.5MiB/s 00:00 ▕██████████████████▏ 100.0% Starting download of /tmp/guix-file.B2wURN From https://example.com/greeter-1.0.tar.gz... download failed "https://example.com/greeter-1.0.tar.gz" 404 "Not Found" Starting download of /tmp/guix-file.B2wURN From https://web.archive.org/web/20240210155936/https://example.com/greeter-1.0.tar.gz... following redirection to `https://web.archive.org/web/20221219143408/http://example.com/greeter-1.0.tar.gz'... download failed "https://web.archive.org/web/20221219143408/http://example.com/greeter-1.0.tar.gz" 404 "Not Found" Trying to use Disarchive to assemble /tmp/guix-file.B2wURN... could not find its Disarchive specification failed to download "/tmp/guix-file.B2wURN" from "https://example.com/greeter-1.0.tar.gz" Backtrace: 13 (primitive-load "/home/herman/.cache/guix/inferiors/umi…") In guix/ui.scm: 2324:7 12 (run-guix . _) 2287:10 11 (run-guix-command _ . _) In guix/scripts/import.scm: 80:6 10 (guix-import . _) In ice-9/boot-9.scm: 1747:15 9 (with-exception-handler # …) In guix/scripts/import/json.scm: 91:16 8 (_) In ice-9/boot-9.scm: 1747:15 7 (with-exception-handler # …) In guix/import/json.scm: 72:19 6 (_) In srfi/srfi-1.scm: 460:18 5 (fold # …) In guix/import/json.scm: 81:55 4 (_ (("inputs" . #("myhello" "hello")) ("license" . #) …) …) In guix/import/utils.scm: 543:12 3 (alist->package (("inputs" . #("myhello" "hello")) # …) _) 162:33 2 (source-spec->object "https://example.com/greeter-1.0.t…") In ice-9/ports.scm: 450:11 1 (call-with-input-file #f # …) In unknown file: 0 (open-file #f "r" #:encoding #f #:guess-encoding #f) Can greeter have a real source? What should it be? Cheers, Herman Rimm From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 16 11:07:01 2024 Received: (at 68935) by debbugs.gnu.org; 16 Feb 2024 16:07:01 +0000 Received: from localhost ([127.0.0.1]:60007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rb0jt-0008Se-Ct for submit@debbugs.gnu.org; Fri, 16 Feb 2024 11:07:01 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:38893 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rb0jn-0008SJ-5u for 68935@debbugs.gnu.org; Fri, 16 Feb 2024 11:06:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708099588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lNSc43+XZzrMQlp/BbQMKjkx4qoRKAGT0fpdUDZm5Eg=; b=qcWWo8LWSmjB3FuUeU4h2gja6fl9zyicMoMH82QWayj7kkBZu11PssG+7AnE2vw0uLEd7M Z3G6g+CztvPyWFcMXOsTXZtSoF1Oip4huVLjbInXDQMUJ0XLNtXoyy7LAxYdL+5Y5CBs96 yKJ12fbVgesLsDxvR6ECMnGRAcCYCxNJGr/BgSSLyHjFHaB8iGxoYwDgsGJchIvBDRHrSZ K/a5iSyOx4jUYQvP7FvUjuPrdMlPsbj7QAtUKQvbbikWSnDeg8lCg8kkZ9SjiLy1SvDzXT wT+0fSfAebFUN02sTTCmMTlKeh7Vx9Gi88YTz+zsvckl9lOsBwZAPxWHz5zPDA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 9a16d759 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 16 Feb 2024 16:06:28 +0000 (UTC) Date: Fri, 16 Feb 2024 17:06:22 +0100 From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v2 5/6] import: Insert packages into modules alphabetically. Message-ID: References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, On Fri, Feb 09, 2024 at 08:25:17PM +0100, Herman Rimm wrote: > + ((or ("-i" module importer args ...) > + ("--insert" module importer args ...)) > + (let ((find-and-insert > + (lambda (expr) > + (let [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) Hi, On Fri, Feb 09, 2024 at 08:25:17PM +0100, Herman Rimm wrote: > + ((or ("-i" module importer args ...) > + ("--insert" module importer args ...)) > + (let ((find-and-insert > + (lambda (expr) > + (let ((insert > + (lambda (source-properties) > + (if source-properties > + (insert-expression source-properties expr) > + (let ((port (open-file file "a"))) It should be 'module' instead of 'file' here. I will rename 'module' to 'file' in the next revision though. Cheers, Herman From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 19 16:31:40 2024 Received: (at 68935) by debbugs.gnu.org; 19 Feb 2024 21:31:40 +0000 Received: from localhost ([127.0.0.1]:43662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcBEh-0005Q4-Tz for submit@debbugs.gnu.org; Mon, 19 Feb 2024 16:31:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcBEf-0005Pp-N1 for 68935@debbugs.gnu.org; Mon, 19 Feb 2024 16:31:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcBEC-0005I7-UI; Mon, 19 Feb 2024 16:31:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=MooJTzl4K96oGsBbSd34mwLSeXHzCn3rvFmtYF7oppk=; b=WHzSKyTS+VUOMKDDtklo qz6QcS6+brvyP2eswgiy8CxI+T19Rb8gPpKVxmWGE4Kcf4Jvsxdncl/YbhPAAOVYRyggTMxKQxkZt HgQ52whWewWYJi03fIlHq1cvL3J97l9myWixkhoFpIkn752Eg8IIV02ovDu8hmP57fKZqxzvwBSf+ nvSxY18TGRuaIinC5C97HAjwjAyWJUWv7b8gc4UnX8LsSnzSyIhEe84mgEAUqxh61FMZGJJjUOU2b xeDG57pqbdjJxaAq6SooeIPltK+Qn0XlpPLt4MAgDpzAxQ0sYFICRVhAA2QKHSDzZUPiOFPL7jjbg IjJ6PLa+w7qPPg==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Herman Rimm Subject: Re: [bug#68935] [PATCH v2 3/6] utils: Add insert-expression procedure. In-Reply-To: <69ff85b93e8a7f9095412429c213a2e10e9b0e6d.1707505804.git.herman@rimm.ee> (Herman Rimm's message of "Fri, 9 Feb 2024 20:25:15 +0100") References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> <69ff85b93e8a7f9095412429c213a2e10e9b0e6d.1707505804.git.herman@rimm.ee> Date: Mon, 19 Feb 2024 22:31:05 +0100 Message-ID: <87wmr0p2ee.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 68935 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 68935@debbugs.gnu.org, Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) Herman Rimm skribis: > * guix/utils.scm (define-module): Use (guix read-print) and export > (insert-expression). > (insert-expression): Add procedure. > * tests/utils.scm ("insert-expression"): Add test. > > Change-Id: I971a43a78aa6ecaaef33c1a7a0db4b287eb85036 Nice! From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 19 16:39:10 2024 Received: (at 68935) by debbugs.gnu.org; 19 Feb 2024 21:39:10 +0000 Received: from localhost ([127.0.0.1]:43671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcBLx-0005bZ-Hi for submit@debbugs.gnu.org; Mon, 19 Feb 2024 16:39:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcBLu-0005b4-Kc for 68935@debbugs.gnu.org; Mon, 19 Feb 2024 16:39:07 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcBLQ-0006bs-0d; Mon, 19 Feb 2024 16:38:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=9Ndu8exGUElAZAUsNB7ogjjqGdGujfWTIZ8QIn3q7h0=; b=o36YviP4/ES6rILWbzF7 A81Gdys8znT9VVx05LCH77MdvLBQxDpHXnk0j16qztDQYp8/9myU95j3+910A9lH/Z682eZ+bskPm W6Yr8Ahz3woF3JZYmZ+MYiVFN6snmILmzF9kDYHii0aSARXYqAY0+DLG/VnTnJYiXYERMxAvnW/df 8NKgPDXGt7wnSyMIVooAwlDoiXKi01U4Vhvw5O8wCw2J2v4Ds0NbeqAID1k40dRuiuhZRHYWCmxah zcTFcFPfNtj5W3DS3FMbImbV4xzUfItbLO7tblMHM63CXXYS7LhrCVuglvPMKCyj+V3j6WLJud/1r uyQL5rs/ipWIzQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Herman Rimm Subject: Re: [bug#68935] [PATCH v2 4/6] utils: Add find-expression procedure. In-Reply-To: <028a3d700965947fa0547eb17d4894b8302eb67c.1707505804.git.herman@rimm.ee> (Herman Rimm's message of "Fri, 9 Feb 2024 20:25:16 +0100") References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> <028a3d700965947fa0547eb17d4894b8302eb67c.1707505804.git.herman@rimm.ee> Date: Mon, 19 Feb 2024 22:38:32 +0100 Message-ID: <87r0h8p21z.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 68935 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 68935@debbugs.gnu.org, Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) Herman Rimm skribis: > * guix/utils.scm (find-expression): Add and export procedure. > * tests/utils.scm ("find-expression"): Add test. > > Change-Id: Ie209df39c1f006b20aa6436fb1aef4c84b1694ee [...] > +(define (find-expression file expr proc) > + "Search in FILE for a top-level expression which alphabetically > +succeeds EXPR. Call PROC with the location if found, or with #f > +otherwise." > + (let* ((name (match expr > + (('define-public symbol _ ...) > + (symbol->string symbol)))) > + (source-properties > + (call-with-input-file > + file > + (lambda (port) > + (do ((syntax (read-syntax port) > + (read-syntax port))) > + ((match (syntax->datum syntax) > + (('define-public symbol _ ...) > + (string> (symbol->string symbol) > + name)) > + ((? eof-object?) #t) > + (_ #f)) > + (if (eof-object? syntax) > + #f (syntax-source syntax)))))))) > + (proc source-properties))) I think it=E2=80=99d be clearer to: 1. Omit =E2=80=98proc=E2=80=99 and always return the source properties of= the thing that has been found. 2. Pass a symbol instead of =E2=80=98expr=E2=80=99. 3. Call it =E2=80=98find-definition-insertion-location=E2=80=99 to clarif= y that it=E2=80=99s really about finding where we want to insert a definition, hence alphabetical sorting. BTW, the formatting above is unusual; for instance, =E2=80=98file=E2=80=99 = would normally appear on the same line as =E2=80=98call-with-input-file=E2=80=99. Also, write: (and (not (eof-object? syntax)) (syntax-source-syntax)) =E2=80=A6 instead of using =E2=80=98if=E2=80=99. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 19 16:43:44 2024 Received: (at 68935) by debbugs.gnu.org; 19 Feb 2024 21:43:44 +0000 Received: from localhost ([127.0.0.1]:43680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcBQO-0005ia-E8 for submit@debbugs.gnu.org; Mon, 19 Feb 2024 16:43:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcBQM-0005iB-9d for 68935@debbugs.gnu.org; Mon, 19 Feb 2024 16:43:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcBPv-0007K1-Gs; Mon, 19 Feb 2024 16:43:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=sBXqsnkFap33LiJOAkac++uinnjbzVEkTZhN3fZjx1Q=; b=ctq+0Q3/LlfnevtfGATd /RV1Qsir8e2ekmn/zuq6jnIo1c4tdRklKx0BLIQcHT4Z0e9CDfnSgj1GZKqmHGh6P9Vmf1tkfgKH1 ifIiiQpwjYP7PLKzHtWslXx/nW/kN6bK8ENSfG/chSuiyx3qUEvbUKHzZEaaaQjpoh/tiHLOPnwaU lPlmC27T/BylcQEBk0nMPj5pYNRchZgm2wmd0mDnNID3qdmvzdCMmfpxPvJAGz/UjNjnb6Exer7ub HmKGyCWjLlCtRXcKuAu3zBbfVAL79LA1szIA81IrcVvHxK1PZKF916WXb1zMAlf3zGvbZ/a3HAm4t ePIHt091gdGP3w==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Herman Rimm Subject: Re: [bug#68935] [PATCH v2 5/6] import: Insert packages into modules alphabetically. In-Reply-To: (Herman Rimm's message of "Fri, 9 Feb 2024 20:25:17 +0100") References: <3c0da641938e96a9f0c491abb74b30c75634df9a.1707505804.git.herman@rimm.ee> Date: Mon, 19 Feb 2024 22:43:12 +0100 Message-ID: <87jzn0p1u7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 68935 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 68935@debbugs.gnu.org, Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) Herman Rimm skribis: > * guix/scripts/import.scm (guix-import): Add 'insert' option. > (define-import): Add procedure. > * doc/guix.texi (Invoking guix import): Describe 'insert' option. > > Change-Id: Id021095355283ade79acde120890eb2ce9173cf7 [...] > +(define (define-import importer args proc) > + "Wrap package expressions from IMPORTER with 'define-public and invoke > +PROC callback." s/define-import/import-as-definitions/ for clarity? > + ((? list? expressions) Rather: (expressions ...). (It=E2=80=99s equivalent but more customary.) Otherwise LGTM, thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 15:46:13 2024 Received: (at 68935) by debbugs.gnu.org; 20 Feb 2024 20:46:13 +0000 Received: from localhost ([127.0.0.1]:46799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0H-0004E9-Ay for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:13 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53857 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0E-0004Do-O6 for 68935@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708461941; 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; bh=YPdZj0lREphUbToJkT/UipgGDY/iNBYxR/ni2RKD38c=; b=XYafFq3zFkDFXrAfNzrw0HTCTPO4HXVeBwihJRGpD9XB+mJpHZlkt1HxiZEtjCxL8/JFWE sMREFVZqY9dFJIYzB1mgvYrqLlxI6liwtBJh99FNBaKCWkdBXtDVAhjaCSzLqNVUt/ptGA /bBMRwQt9BX4YTVu2DKFrGP8nQQsPUt6TLcfI94fpmfp0izO8gQHDaUbvsLDk5oTNfH3le 9bkj8QmO+rrLmnSpeE9OCWNpM1MxuhfvNgo7V6fu0Mr34l0bSnSL8TGPxCBhQo79GUj8rb 2FLXsCpfrlClLEygGpOCXJVykTsDEc2me36pNHy0N/7Cr8QEp33FjfenUfWm9g== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id c28e9ca4 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 20 Feb 2024 20:45:41 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v3 0/7] Add insert option to guix import. Date: Tue, 20 Feb 2024 21:45:08 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Thanks for the feedback. Biggest issue I see is, e.g.: (define-public package-bar) ;; Unlikely comment about package-bar. Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) Hi, Thanks for the feedback. Biggest issue I see is, e.g.: (define-public package-bar) ;; Unlikely comment about package-bar. (define for-package-foo) ;; Comment related to package-foo. (define-public package-foo) after inserting package-baz becomes: (define-public package-bar) ;; Unlikely comment about package-bar. (define for-package-foo) ;; Comment related to package-foo. + (define-public package-baz) + (define-public package-foo) but for a language read from top-to-bottom I would rather want: (define-public package-bar) + + (define for-package-baz) ;; Unlikely comment about package-bar. (define for-package-foo) ;; Comment related to package-foo. (define-public package-foo) This would be the case if package-baz is inserted after package-bar, rather than before package-foo. I don't intend to implement this though, and for the large gnu/packages/crates-*.scm files, where alphabetical --insert is most useful, I believe this issue is the least likely to occur. So despite the issue, I think these patches can be upstreamed. Cheers, Herman Herman Rimm (7): doc: Note SVN dependency of texlive importer. import: Wrap package expressions with define-public. utils: Add insert-expression procedure. utils: Add find-definition-insertion-location procedure. import: Insert packages into modules alphabetically. import: Discard args after --version and --help. import: Do not return package name with json importer. doc/guix.texi | 22 ++++++++--- doc/package-hello.json | 6 +-- guix/import/json.scm | 13 +++---- guix/scripts/import.scm | 82 ++++++++++++++++++++++++++++------------- guix/utils.scm | 30 +++++++++++++++ tests/utils.scm | 28 ++++++++++++++ 6 files changed, 140 insertions(+), 41 deletions(-) base-commit: e3c612a7de679c96b9eafdb0da500dcc18d9a101 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 15:46:18 2024 Received: (at 68935) by debbugs.gnu.org; 20 Feb 2024 20:46:18 +0000 Received: from localhost ([127.0.0.1]:46806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0L-0004Em-LQ for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:17 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53857 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0G-0004Do-QM for 68935@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708461942; 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=ZFKzp2lvweiV9BP/1qeJF04+vL9f/Lpe9Ji8foAXNM0=; b=nI2d91lrFOa3H5jP+c+cERGfF3BKs33wOl/b5zNYyfnq5bH5HS52HnLInqdmpCReC/mzPZ SV1uLgKCrDs2QPvMxBXDuLScofU18++nqzDhuZX7bw40uiF4uFBAMtG6+xMWsNi2GBD8sC 23Id3bGNr1vk0WTxaWYD8zxie4KeB2V3uzcttsNS65tE4SJCtasoa6Ti/wUueef0eJutbZ Xk9k8rD/wtjGpyu5g5PoALZd3fcWVnTw1IwTHfXRjP8T4wqJILtKAzkyiKoVLCmtt3WKd2 xU1rIgFT29zrm0SRQkPDFTHEbotWVZeC40QtH6V4p4I3vJN70aAviUuAeUZmoA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id fb921af4 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 20 Feb 2024 20:45:42 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v3 1/7] doc: Note SVN dependency of texlive importer. Date: Tue, 20 Feb 2024 21:45:09 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * doc/guix.texi (Invoking guix import): Note dependency and remove duplicated words. Change-Id: I94320db8c8ab3569aa461876522d5560e37a19ea --- doc/guix.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) * doc/guix.texi (Invoking guix import): Note dependency and remove duplicated words. Change-Id: I94320db8c8ab3569aa461876522d5560e37a19ea --- doc/guix.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 9966a8e697..6bf358e762 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14339,7 +14339,7 @@ Invoking guix import Information is extracted from the @file{DESCRIPTION} file of the package. -The command command below imports metadata for the Cairo R package: +The command below imports metadata for the Cairo R package: @example guix import cran Cairo @@ -14399,10 +14399,10 @@ Invoking guix import database, a plain text file that is included in the @code{texlive-scripts} package. The source code is downloaded from possibly multiple locations in the SVN repository of the Tex Live -project. +project. Note that therefore SVN must be installed and in @code{$PATH}; +run @code{guix install subversion} if needed. -The command command below imports metadata for the @code{fontspec} -TeX package: +The command below imports metadata for the @code{fontspec} TeX package: @example guix import texlive fontspec -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 15:46:18 2024 Received: (at 68935) by debbugs.gnu.org; 20 Feb 2024 20:46:18 +0000 Received: from localhost ([127.0.0.1]:46809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0L-0004Ep-VP for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:18 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53857 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0H-0004Do-Gi for 68935@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708461942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n7/eXQHPwdA8yU/5u6PHavnbXN5Xb8pyTdzEnAI/A3A=; b=hL3KuRKPHTGzuVEvtAwWrJlhNvfr2mBOT60Sp2WcP7D0MpyF9R0/rtBS9VUM1DSKcPu/oB E0BOhhpCmmh7Wlz5ZpJjOsUk6Anc0zeTcDFC/ooahDdOPhfRmdZEDIaEZg3/++9oDg4Qec 5UAlfoYtDlhB/M8raq98WFqW03Lo+Vu5wjsq3YMbfAjTLTkEwAAXw9iELpfeYwBB724A0v 4+sg+vvraDCuGrREiJ6Rbwbc7PFV3xSEvLTgPI94sr2P/ddVSUTBWD4jxfDukhb4Vjs0JU +LUOBFOmqyomGDG2rw6jbFevmb+tKU1fSYSmwuk9tAZDri6Lm3c0SCE9AvN+6w== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id dfa9a098 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 20 Feb 2024 20:45:42 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v3 2/7] import: Wrap package expressions with define-public. Date: Tue, 20 Feb 2024 21:45:10 +0100 Message-ID: <54605c829ce9f85cb5eccc323ae3bc5e3b49a35a.1708461547.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Wrap package expressions. Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 --- guix/scripts/import.scm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) * guix/scripts/import.scm (guix-import): Wrap package expressions. Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 --- guix/scripts/import.scm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index d2a1cee56e..77fcfe3990 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2022 Philip McGrath +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +24,7 @@ ;;; along with GNU Guix. If not, see . (define-module (guix scripts import) + #:use-module (guix import utils) #:use-module (guix ui) #:use-module (guix scripts) #:use-module (guix read-print) @@ -89,12 +91,18 @@ (define-command (guix-import . args) (pretty-print-with-comments (current-output-port) expr))))) (match (apply (resolve-importer importer) args) ((and expr (or ('package _ ...) - ('let _ ...) - ('define-public _ ...))) + ('let _ ...))) + (print (package->definition expr))) + ((and expr ('define-public _ ...)) (print expr)) ((? list? expressions) (for-each (lambda (expr) - (print expr) + (match expr + ((and expr (or ('package _ ...) + ('let _ ...))) + (print (package->definition expr))) + ((and expr ('define-public _ ...)) + (print expr))) ;; Two newlines: one after the closing paren, and ;; one to leave a blank line. (newline) (newline)) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 15:46:19 2024 Received: (at 68935) by debbugs.gnu.org; 20 Feb 2024 20:46:19 +0000 Received: from localhost ([127.0.0.1]:46811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0M-0004F2-Gb for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:19 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53857 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0J-0004Do-6W for 68935@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708461943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bo58dJWIAT1XdgL+H8EMd72drBrY1EfYAOnRR/lhCuU=; b=XN8jfrwuegGuYMgZzmIIsh1GY20rB/LR3dmmZ1wyIjQ45vw/Zawt6PnVQfPI1t7wAAuh6E 7eToQEDYNtPxSGQtVmOm49y9jyR1ZG50eYOdgD6Fu301Emmqo2B8Aj8Y0t/WVBM6pyxbsr SHYioxj4wQ4zXLAf+F1OKSOcnYba6AbfeuHGsaVbnuE7YSesr2nZF1OjOJpPASeriwSokE Pta90P2wRNY1FH38yX6yDl1A0AA0DIaTx+feWNpP0LTutIRLOs/GuV1LoitN45yF/FMR1J My7hX0YcdmOniC1wyjDDdUZ8/C/VSPOhBL/9nuBkcMozD9iEubMsPME6pUaBIw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id d07c80b8 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 20 Feb 2024 20:45:43 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v3 3/7] utils: Add insert-expression procedure. Date: Tue, 20 Feb 2024 21:45:11 +0100 Message-ID: <7dc6cef7db8bf0d091825457ca0dbc65878353e0.1708461547.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/utils.scm (define-module): Use (guix read-print) and export (insert-expression). (insert-expression): Add procedure. * tests/utils.scm ("insert-expression"): Add test. Change-Id: I971a43a78aa6ecaaef33c1a7a0db4b287eb85036 --- guix/utils.scm | 11 +++++++++++ tests/utils.scm | 14 ++++++++++++++ 2 files changed, 25 insertions(+) Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) * guix/utils.scm (define-module): Use (guix read-print) and export (insert-expression). (insert-expression): Add procedure. * tests/utils.scm ("insert-expression"): Add test. Change-Id: I971a43a78aa6ecaaef33c1a7a0db4b287eb85036 --- guix/utils.scm | 11 +++++++++++ tests/utils.scm | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm index e4e9d922e7..8f0bc2399e 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -20,6 +20,7 @@ ;;; Copyright © 2023 Janneke Nieuwenhuizen ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2023 Foundation Devices, Inc. +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -38,6 +39,7 @@ (define-module (guix utils) #:use-module (guix config) + #:use-module (guix read-print) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) @@ -145,6 +147,7 @@ (define-module (guix utils) go-to-location edit-expression delete-expression + insert-expression filtered-port decompressed-port @@ -502,6 +505,14 @@ (define (delete-expression source-properties) "Delete the expression specified by SOURCE-PROPERTIES." (edit-expression source-properties (const "") #:include-trailing-newline? #t)) +(define (insert-expression source-properties expr) + "Insert EXPR before the top-level expression specified by +SOURCE-PROPERTIES." + (let* ((expr (object->string* expr 0)) + (insert (lambda (str) + (string-append expr "\n\n" str)))) + (edit-expression source-properties insert))) + ;;; ;;; Keyword arguments. diff --git a/tests/utils.scm b/tests/utils.scm index 5664165c85..cd54112846 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2023 Foundation Devices, Inc. +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -274,6 +275,19 @@ (define (test-compression/decompression method run?) string-reverse) (call-with-input-file temp-file get-string-all))) +(test-equal "insert-expression" + "(define-public package-1\n 'package)\n +(define-public package-2\n 'package)\n" + (begin + (call-with-output-file temp-file + (lambda (port) + (display "(define-public package-2\n 'package)\n" port))) + (insert-expression `((filename . ,temp-file) + (line . 0) + (column . 0)) + `(define-public package-1 'package)) + (call-with-input-file temp-file get-string-all))) + (test-equal "string-distance" '(0 1 1 5 5) (list -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 15:46:19 2024 Received: (at 68935) by debbugs.gnu.org; 20 Feb 2024 20:46:19 +0000 Received: from localhost ([127.0.0.1]:46813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0N-0004FB-7z for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:19 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:52067 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0J-0004Du-WF for 68935@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708461943; 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=fAvUAhms6sQA11IT0Mp3NqbYqy3+2zH2eBuSBomYrpQ=; b=CE3PQc8BEs0dZrCzBY4y+LHfQU7eQn7J1v+2vIXtydjbPpLrjHb7PIH8qrOvgZcsITzN+w RGWoEw56wBX9RjBtlpKVc2bxFvBIruGnjfUPabA9V1F1A6FVLRiTO1ks//ZiVdtcZ6FjYB PHkCuutlO7PonJmwQiIvD1+rSPrUPmttXn0K+8zotczr/81WRv00+8vdalZWgV1Ig9uDu2 eF4y3gLT77WCg9M/QSpeK2jda5DNXj3YnzamMLaJSnc7+oBSj8STPgYPYdhOb1WLNdu+n+ jA09745NsvUGDtFdqm4xk7sOVSsloiJlZw1JEtXglbR0jXxB4FbkcboqpBe+vQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 69319bb1 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 20 Feb 2024 20:45:43 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v3 4/7] utils: Add find-definition-insertion-location procedure. Date: Tue, 20 Feb 2024 21:45:12 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/utils.scm (find-definition-insertion-location): Add and export procedure. * tests/utils.scm ("find-definition-insertion-location"): Add test. Change-Id: Ie17e1b4a94790f58518ce121411a38d357f49feb --- guix/utils.scm | 19 +++++++++++++++++++ tests/utils.scm | 14 ++++++++++++++ 2 files changed, 33 insertions(+) Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) * guix/utils.scm (find-definition-insertion-location): Add and export procedure. * tests/utils.scm ("find-definition-insertion-location"): Add test. Change-Id: Ie17e1b4a94790f58518ce121411a38d357f49feb --- guix/utils.scm | 19 +++++++++++++++++++ tests/utils.scm | 14 ++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm index 8f0bc2399e..82a78e2dfb 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -148,6 +148,7 @@ (define-module (guix utils) edit-expression delete-expression insert-expression + find-definition-insertion-location filtered-port decompressed-port @@ -513,6 +514,24 @@ (define (insert-expression source-properties expr) (string-append expr "\n\n" str)))) (edit-expression source-properties insert))) +(define (find-definition-insertion-location file term) + "Search in FILE for a top-level public definition whose defined term +alphabetically succeeds TERM. Return the location if found, or #f +otherwise." + (let ((search-term (symbol->string term))) + (call-with-input-file file + (lambda (port) + (do ((syntax (read-syntax port) + (read-syntax port))) + ((match (syntax->datum syntax) + (('define-public current-term _ ...) + (string> (symbol->string current-term) + search-term)) + ((? eof-object?) #t) + (_ #f)) + (and (not (eof-object? syntax)) + (syntax-source syntax)))))))) + ;;; ;;; Keyword arguments. diff --git a/tests/utils.scm b/tests/utils.scm index cd54112846..52f3b58ede 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -288,6 +288,20 @@ (define-public package-2\n 'package)\n" `(define-public package-1 'package)) (call-with-input-file temp-file get-string-all))) +(test-equal "find-definition-insertion-location" + (list `((filename . ,temp-file) (line . 0) (column . 0)) + `((filename . ,temp-file) (line . 5) (column . 0)) + #f) + (begin + (call-with-output-file temp-file + (lambda (port) + (display "(define-public package-1\n 'foo)\n\n" port) + (display "(define foo 'bar)\n\n" port) + (display "(define-public package-2\n 'baz)\n" port))) + (map (lambda (term) + (find-definition-insertion-location temp-file term)) + (list 'package 'package-1 'package-2)))) + (test-equal "string-distance" '(0 1 1 5 5) (list -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 15:46:32 2024 Received: (at 68935) by debbugs.gnu.org; 20 Feb 2024 20:46:32 +0000 Received: from localhost ([127.0.0.1]:46815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0Y-0004Fh-MB for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:32 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53857 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0K-0004Do-N7 for 68935@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708461944; 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=fcOSQ6RDAjUAfWmZ7IlOJEy3lNumOgxx0rl9r1infOY=; b=ARRMI3Zg1Qe+70MetoKJXqLS3sp7MJaEItkF8+APe5bAoC31KKlorFa/8hCTOdR/X2jq5B GF0PuxOdFFbVRmiQIB4har69tQ5md2w1SBBgMTpr/zy0XXGwXqZNGldVoGXxGXwx46F16S a09q3PeYjKDZd4/y887qSsNpQTfLDCaiPUQaOuTStgUbo01pFjxHxvRxxuPZ+M6ncG+ktE 0YIYcFiu/qSt5HhvST4GsUkCHUKJAyGNVvRsGE9T4qGeNA38rFHxulbYVu4YiWgMG1qE9q +im5K2qf0WKcTJ+o/OjgKt3ZOwI4AzSIiCglOi3VgjXMdl4/yuIm/q2psJPAfQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id a61a9e73 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 20 Feb 2024 20:45:44 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v3 5/7] import: Insert packages into modules alphabetically. Date: Tue, 20 Feb 2024 21:45:13 +0100 Message-ID: <3c6f07700f23fd5afbc758dbdd0b0ae158a04b49.1708461547.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Add 'insert' option. (import-as-definitions): Add procedure. * doc/guix.texi (Invoking guix import): Describe 'insert' option. Change-Id: Id87ea707123630e12bcb6788599acac6895b26c4 --- doc/guix.texi | 14 ++++++- guix/scripts/import.scm | 82 ++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 31 deletio [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) * guix/scripts/import.scm (guix-import): Add 'insert' option. (import-as-definitions): Add procedure. * doc/guix.texi (Invoking guix import): Describe 'insert' option. Change-Id: Id87ea707123630e12bcb6788599acac6895b26c4 --- doc/guix.texi | 14 ++++++- guix/scripts/import.scm | 82 ++++++++++++++++++++++++++--------------- 2 files changed, 65 insertions(+), 31 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 6bf358e762..59838c5a17 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -124,6 +124,7 @@ Copyright @copyright{} 2023 Saku Laesvuori@* Copyright @copyright{} 2023 Graham James Addis@* Copyright @copyright{} 2023 Tomas Volf@* +Copyright @copyright{} 2024 Herman Rimm@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -14183,12 +14184,21 @@ Invoking guix import The general syntax is: @example -guix import @var{importer} @var{options}@dots{} +guix import [@var{global-options}@dots{}] @var{importer} @var{package} [@var{options}@dots{}] @end example @var{importer} specifies the source from which to import package metadata, and @var{options} specifies a package identifier and other -options specific to @var{importer}. +options specific to @var{importer}. @command{guix import} itself has the +following @var{global-options}: + +@table @code +@item --insert=@var{file} +@itemx -i @var{file} +Insert the package definition(s) that the @var{importer} generated into the +specified @var{file}, either in alphabetical order among existing package +definitions, or at the end of the file otherwise. +@end table Some of the importers rely on the ability to run the @command{gpgv} command. For these, GnuPG must be installed and in @code{$PATH}; run @code{guix install diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 77fcfe3990..aca4e61f26 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -67,10 +67,39 @@ (define (show-help) (display (G_ " -h, --help display this help and exit")) (display (G_ " + -i, --insert insert packages into file alphabetically")) + (display (G_ " -V, --version display version information and exit")) (newline) (show-bug-report-information)) +(define (import-as-definitions importer args proc) + "Wrap package expressions from IMPORTER with 'define-public and invoke +PROC callback." + (if (member importer importers) + (match (apply (resolve-importer importer) args) + ((and expr (or ('package _ ...) + ('let _ ...))) + (proc (package->definition expr))) + ((and expr ('define-public _ ...)) + (proc expr)) + ((expressions ...) + (for-each (lambda (expr) + (match expr + ((and expr (or ('package _ ...) + ('let _ ...))) + (proc (package->definition expr))) + ((and expr ('define-public _ ...)) + (proc expr)))) + expressions)) + (x + (leave (G_ "'~a' import failed~%") importer))) + (let ((hint (string-closest importer importers #:threshold 3))) + (report-error (G_ "~a: invalid importer~%") importer) + (when hint + (display-hint (G_ "Did you mean @code{~a}?~%") hint)) + (exit 1)))) + (define-command (guix-import . args) (category packaging) (synopsis "import a package definition from an external repository") @@ -84,33 +113,28 @@ (define-command (guix-import . args) (exit 0)) ((or ("-V") ("--version")) (show-version-and-exit "guix import")) + ((or ("-i" file importer args ...) + ("--insert" file importer args ...)) + (let ((find-and-insert + (lambda (expr) + (match expr + (('define-public term _ ...) + (let ((source-properties + (find-definition-insertion-location + file term))) + (if source-properties + (insert-expression source-properties expr) + (let ((port (open-file file "a"))) + (pretty-print-with-comments port expr) + (newline port) + (close-port port))))))))) + (import-as-definitions importer args find-and-insert))) ((importer args ...) - (if (member importer importers) - (let ((print (lambda (expr) - (leave-on-EPIPE - (pretty-print-with-comments (current-output-port) expr))))) - (match (apply (resolve-importer importer) args) - ((and expr (or ('package _ ...) - ('let _ ...))) - (print (package->definition expr))) - ((and expr ('define-public _ ...)) - (print expr)) - ((? list? expressions) - (for-each (lambda (expr) - (match expr - ((and expr (or ('package _ ...) - ('let _ ...))) - (print (package->definition expr))) - ((and expr ('define-public _ ...)) - (print expr))) - ;; Two newlines: one after the closing paren, and - ;; one to leave a blank line. - (newline) (newline)) - expressions)) - (x - (leave (G_ "'~a' import failed~%") importer)))) - (let ((hint (string-closest importer importers #:threshold 3))) - (report-error (G_ "~a: invalid importer~%") importer) - (when hint - (display-hint (G_ "Did you mean @code{~a}?~%") hint)) - (exit 1)))))) + (let ((print (lambda (expr) + (leave-on-EPIPE + (pretty-print-with-comments + (current-output-port) expr) + ;; Two newlines: one after the closing paren, and + ;; one to leave a blank line. + (newline) (newline))))) + (import-as-definitions importer args print))))) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 15:46:32 2024 Received: (at 68935) by debbugs.gnu.org; 20 Feb 2024 20:46:32 +0000 Received: from localhost ([127.0.0.1]:46817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0a-0004Fl-24 for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:32 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:52067 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0K-0004Du-W8 for 68935@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708461944; 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=//D2unqguqLgv4H/2VsZlZ6KSyS2GyTH7c3oA9GEgec=; b=DxAyx1vQaIIBhwqil/vr8mFxJMHMu2UAbEKPeO0iT2KgrtIhK84ea6nDseDDpxt+DIq4wo hhPoWJ+pzpd6yGfk2v89FpiT20uY3DweIg0IuP7MfosuTpXLeYOJQvxHizIXppJdShqO/7 OUlMkJ1jcci2j89TcwyGKIscJsNjGS86pm376zea2crC6ykeFSf2GICGWEGZFvfHMOYoqV PKNFICBaM3bdD5s2qhRs5n1KwOuc+Cw83n8F+GLVTpwqtks4g/YqJemLtnANNAZnJ3+cjU RQAOOoh6Zb10JnjQBc8apY6+T4MxjSwSSNvej3wKAn3PGIPAWVqD1Mbo6FGVUg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 610b92fb (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 20 Feb 2024 20:45:44 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v3 6/7] import: Discard args after --version and --help. Date: Tue, 20 Feb 2024 21:45:14 +0100 Message-ID: <95a5752b5eddc03de508cbddcfdfbfec3c55b778.1708461547.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Christopher Baines , Josselin Poiret , Ludovic Courtès , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Content-Transfer-Encoding: 8bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/scripts/import.scm (guix-import): Discard args. Change-Id: Icce5cd0daf9011f7ddde7904113b31b547f063ef --- guix/scripts/import.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index aca4e61f26..1f34cab088 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -108, 10 +108, 10 @@ (define-command (gu [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) * guix/scripts/import.scm (guix-import): Discard args. Change-Id: Icce5cd0daf9011f7ddde7904113b31b547f063ef --- guix/scripts/import.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index aca4e61f26..1f34cab088 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -108,10 +108,10 @@ (define-command (guix-import . args) (() (format (current-error-port) (G_ "guix import: missing importer name~%"))) - ((or ("-h") ("--help")) + ((or ("-h" _ ...) ("--help" _ ...)) (leave-on-EPIPE (show-help)) (exit 0)) - ((or ("-V") ("--version")) + ((or ("-V" _ ...) ("--version" _ ...)) (show-version-and-exit "guix import")) ((or ("-i" file importer args ...) ("--insert" file importer args ...)) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 15:46:33 2024 Received: (at 68935) by debbugs.gnu.org; 20 Feb 2024 20:46:33 +0000 Received: from localhost ([127.0.0.1]:46819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0a-0004Fx-KR for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:33 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53857 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0L-0004Do-N7 for 68935@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708461944; 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=sDpFI8xRmqX/KdgKWYY7UxHkW7LEikGKZE83VRXpYOM=; b=P8FyrwPjAgnavUMX0MyZBeRnj9Cf+XXsSmP4+JNKb5+ctjV6mPhQT9vLqviMfSTT3N0PT4 wGky/BffF0s1BJyx/kvJtbxB5U6PXwdX9hBPWICs2OhJsfoW8OFpD3bao8pYkuo51Epo5x o8f53fwS1oIlYD7ERpBJqsIFTBvvxkspwlIqNJHkZFT9VYxyiobs0pjwR0mni0iDKuGaKp 0VrDmC7FuCBkd++M4FtjNW2WwlAJcb+awaA5NdGjPt54/P9OrWA/1R6I1Ufw59bDxrADTJ K0e8U37j5K7PH7hZONqZlvH3NahuJH7fwP5jh7KczctzmfIktPaoWo36SjVxxQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 6d8c3a0b (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 20 Feb 2024 20:45:44 +0000 (UTC) From: Herman Rimm To: 68935@debbugs.gnu.org Subject: [PATCH v3 7/7] import: Do not return package name with json importer. Date: Tue, 20 Feb 2024 21:45:15 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/import/json.scm (json->code): Do not return package names after package expressions. * doc/package-hello.json: Fix comma errors and use valid greeter URL. Change-Id: Id71924e72f690a9bda5fbfdb65a443029adfd158 --- doc/package-hello.json | 6 +++--- guix/import/json.scm | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.3 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [81.205.150.117 listed in zen.spamhaus.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 68935 Cc: ludo@gnu.org, Herman Rimm X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.4 (/) * guix/import/json.scm (json->code): Do not return package names after package expressions. * doc/package-hello.json: Fix comma errors and use valid greeter URL. Change-Id: Id71924e72f690a9bda5fbfdb65a443029adfd158 --- doc/package-hello.json | 6 +++--- guix/import/json.scm | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/doc/package-hello.json b/doc/package-hello.json index a47e266e4b..60193e97e6 100644 --- a/doc/package-hello.json +++ b/doc/package-hello.json @@ -6,7 +6,7 @@ "build-system": "gnu", "arguments": { "tests?": false - } + }, "home-page": "https://www.gnu.org/software/hello/", "synopsis": "Hello, GNU world: An example GNU package", "description": "GNU Hello prints a greeting.", @@ -16,11 +16,11 @@ { "name": "greeter", "version": "1.0", - "source": "https://example.com/greeter-1.0.tar.gz", + "source": "mirror://gnu/hello/hello-2.10.tar.gz", "build-system": "gnu", "arguments": { "test-target": "foo", - "parallel-build?": false, + "parallel-build?": false }, "home-page": "https://example.com/", "synopsis": "Greeter using GNU Hello", diff --git a/guix/import/json.scm b/guix/import/json.scm index b87e9918c5..bf346a1bef 100644 --- a/guix/import/json.scm +++ b/guix/import/json.scm @@ -78,14 +78,13 @@ (define (json->code file-name) #:result (append result (list - (package->code (alist->package pkg names)) - (string->symbol (assoc-ref pkg "name")))))))) - (list #:names '() - #:result '()) - packages)))) + (package->code + (alist->package pkg names)))))))) + (list #:names '() + #:result '()) + packages)))) (package - (list (package->code (alist->package json)) - (string->symbol (assoc-ref json "name"))))))) + (list (package->code (alist->package json))))))) (const #f))) (define (json->scheme-file file) -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 23 12:55:21 2024 Received: (at 68935) by debbugs.gnu.org; 23 Feb 2024 17:55:21 +0000 Received: from localhost ([127.0.0.1]:57849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdZlW-0002gb-LX for submit@debbugs.gnu.org; Fri, 23 Feb 2024 12:55:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdZkb-0002dD-DZ for 68935@debbugs.gnu.org; Fri, 23 Feb 2024 12:54:22 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdZk5-0005ws-Ml; Fri, 23 Feb 2024 12:53:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=/HpNizZ2KeJfpp416v/6ynG346Tic8uy13dpO2Xpllw=; b=gXNqnTdAfFk7LuePnXis UhmDngsTzdP967n0Xa8MPyjONsg/yXgB1foAhYcRJohFlpLJNmVaVlHcq7WVnzkjKBu/nYY0U5jez tGRaQPuO0N4e4+MDiQaj40JXKimbaECc4hZlllTHIcnvE5tKDf2rjENUKFWxNxHWso6kw8G40LrA+ SGtt2/Cv0dEfseph/cHQy7KudBwlU6y1j9y6UeLz5jBQCjqrmYvehhhbcJHKIQyWJsM9YGHfy74FY gQqfD6VcpH0pArMtATG+u74pqZN5MLG9AEfVjsdOLUJNU1DGoZ24FvH54GIkBSNJyy0qOUY97ppc5 a0dYW1lVXrwPcQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Herman Rimm Subject: Re: [bug#68935] [PATCH v3 0/7] Add insert option to guix import. In-Reply-To: (Herman Rimm's message of "Tue, 20 Feb 2024 21:45:08 +0100") References: Date: Fri, 23 Feb 2024 18:53:46 +0100 Message-ID: <87v86fdq39.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68935 Cc: 68935@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Herman Rimm skribis: > after inserting package-baz becomes: > > (define-public package-bar) > ;; Unlikely comment about package-bar. >=20=20=20 > (define for-package-foo) > ;; Comment related to package-foo. > + (define-public package-baz) > + > (define-public package-foo) I think that=E2=80=99s an acceptable limitation. Also, usually one would w= rite: (define-public foo ;; Comment related to foo. (package =E2=80=A6)) This case is correctly handled. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 23 14:53:09 2024 Received: (at 68935-done) by debbugs.gnu.org; 23 Feb 2024 19:53:09 +0000 Received: from localhost ([127.0.0.1]:37837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdbbY-0002fF-7T for submit@debbugs.gnu.org; Fri, 23 Feb 2024 14:53:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdbbV-0002eW-QG for 68935-done@debbugs.gnu.org; Fri, 23 Feb 2024 14:53:06 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdbb0-0008EV-6A; Fri, 23 Feb 2024 14:52:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=x4IXGVY01rXtQZuZWQyHJQYE5iamfHKsv3mmj7/09RM=; b=q8xciLknAAL/zrAnb6C7 oDsf/5Ozd2k3vwMI/UEtHAtqY4IYetyIPrYlogmvg5BQeOQzF2W/dG7dJSpaidK7BQ2AG/P2QnHnu PPvWionHxAHHpql18b/0eFfSKqOPukNc97PZcptoTjqxXmZp7yIdaMIlTbP//o4rGH2bq8bnqdqNg fiU/n5u/Pp1kFzdBjy0lvVND2smTBJ+hDqNN5pa2YU7CYwBkOtbhZqRca4qKJ8n8Pnhq/k7cP612Q lvsgsAoRlHy2kPtNjqT//h8Cf4ZEP/zPXHOyd1Nvc6jm5gzBlbirLhwFY+D90T3SnK41CRcVw/mIK 3CPjsf1EDxO2MA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Herman Rimm Subject: Re: [bug#68935] [PATCH v3 0/7] Add insert option to guix import. In-Reply-To: (Herman Rimm's message of "Tue, 20 Feb 2024 21:45:08 +0100") References: Date: Fri, 23 Feb 2024 20:52:20 +0100 Message-ID: <87r0h3dkln.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68935-done Cc: 68935-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Herman Rimm skribis: > doc: Note SVN dependency of texlive importer. > import: Wrap package expressions with define-public. > utils: Add insert-expression procedure. > utils: Add find-definition-insertion-location procedure. > import: Insert packages into modules alphabetically. > import: Discard args after --version and --help. > import: Do not return package name with json importer. Pushed as b386c11e7804e0b577411d930b60f1e0a4a0382c, thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 23 14:54:09 2024 Received: (at 68935) by debbugs.gnu.org; 23 Feb 2024 19:54:09 +0000 Received: from localhost ([127.0.0.1]:37928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdbcX-0002iy-4H for submit@debbugs.gnu.org; Fri, 23 Feb 2024 14:54:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdbcV-0002i0-6P for 68935@debbugs.gnu.org; Fri, 23 Feb 2024 14:54:07 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdbbz-0008TO-ME; Fri, 23 Feb 2024 14:53:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=zN3xPLUZf2KUeixf+Vow5KtoVq+bKEDcQaLNHPydzIc=; b=o2nsMYF1eerVYOtWOn1l CRsrI9Ik0SE8nXqE4Fcqor+uPmBw4j5yrKHD06TqreKMc22RRF6KcXQ7RpgmqCwR0VKbMSwwMVU1l vLacuKnVZYdIUoLDNBbVVFde/uHRIh1D10eaZ5Zy1+mxqLmZL+4KorQcAdRdwzW4aNdEYQXsFtKpX BgqAX1MH4FOchHaf8J55MT2gPom3IXCOFLGS/DNfn94qKkED8wB35FoUDshHwGr+4nNYv8lSBg8lg udLvhVT5nQ/0x3RozuySnTS7PkusHfCduozMnTdsmiQcNlRSVH059xcJF5VrEr5C9jS1+uf6eCsPQ H9S0WlD3czYZxA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Herman Rimm Subject: Re: [bug#68935] [PATCH v3 3/7] utils: Add insert-expression procedure. In-Reply-To: <7dc6cef7db8bf0d091825457ca0dbc65878353e0.1708461547.git.herman@rimm.ee> (Herman Rimm's message of "Tue, 20 Feb 2024 21:45:11 +0100") References: <7dc6cef7db8bf0d091825457ca0dbc65878353e0.1708461547.git.herman@rimm.ee> Date: Fri, 23 Feb 2024 20:53:31 +0100 Message-ID: <87msrrdkjo.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68935 Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 68935@debbugs.gnu.org, Christopher Baines X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Herman Rimm skribis: > * guix/utils.scm (define-module): Use (guix read-print) and export > (insert-expression). > (insert-expression): Add procedure. > * tests/utils.scm ("insert-expression"): Add test. > > Change-Id: I971a43a78aa6ecaaef33c1a7a0db4b287eb85036 [...] > (define-module (guix utils) > #:use-module (guix config) > + #:use-module (guix read-print) I took the liberty to change that to #:autoload so users of (guix utils) don=E2=80=99t load (guix read-print) if they don=E2=80=99t actually need it. Ludo=E2=80=99. From unknown Tue Jun 17 17:56:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 23 Mar 2024 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator