From patchwork Fri Feb 9 19:25:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 59964 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 047E727BBEB; Fri, 9 Feb 2024 19:27:29 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1F8E327BBEA for ; Fri, 9 Feb 2024 19:27:27 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYWWP-0002UP-Fs; Fri, 09 Feb 2024 14:26: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 1rYWWN-0002Tm-AJ for guix-patches@gnu.org; Fri, 09 Feb 2024 14:26:47 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWWN-0000ds-21 for guix-patches@gnu.org; Fri, 09 Feb 2024 14:26:47 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYWWc-0001b7-62 for guix-patches@gnu.org; Fri, 09 Feb 2024 14:27:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68935] [PATCH v2 1/6] doc: Note SVN dependency of texlive importer. References: In-Reply-To: Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 09 Feb 2024 19:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68935 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68935@debbugs.gnu.org Cc: ludo@gnu.org, Herman Rimm Received: via spool by 68935-submit@debbugs.gnu.org id=B68935.17075068016010 (code B ref 68935); Fri, 09 Feb 2024 19:27:02 +0000 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) 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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(-) base-commit: 513755d64debb44096f21e323a5b89a7a597d2ca 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 From patchwork Fri Feb 9 19:25:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 59965 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 216D927BBEA; Fri, 9 Feb 2024 19:27:29 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1829627BBE2 for ; Fri, 9 Feb 2024 19:27:27 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYWWU-0002Wr-9w; Fri, 09 Feb 2024 14:26:54 -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 1rYWWS-0002VB-Ei for guix-patches@gnu.org; Fri, 09 Feb 2024 14:26:52 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWWS-0000jG-6c; Fri, 09 Feb 2024 14:26:52 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYWWc-0001bF-Lv; Fri, 09 Feb 2024 14:27:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68935] [PATCH v2 2/6] import: Wrap package expressions with define-public. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 09 Feb 2024 19:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68935 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68935@debbugs.gnu.org Cc: ludo@gnu.org, Herman Rimm , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 68935-submit@debbugs.gnu.org id=B68935.17075068046033 (code B ref 68935); Fri, 09 Feb 2024 19:27:02 +0000 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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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)) From patchwork Fri Feb 9 19:25:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 59969 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3819D27BBEB; Fri, 9 Feb 2024 19:27:47 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5DC3027BBE2 for ; Fri, 9 Feb 2024 19:27:46 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYWWU-0002Wg-1V; Fri, 09 Feb 2024 14:26:54 -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 1rYWWS-0002V8-8k for guix-patches@gnu.org; Fri, 09 Feb 2024 14:26:52 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWWS-0000ij-03; Fri, 09 Feb 2024 14:26:52 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYWWd-0001bL-3A; Fri, 09 Feb 2024 14:27:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68935] [PATCH v2 3/6] utils: Add insert-expression procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 09 Feb 2024 19:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68935 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68935@debbugs.gnu.org Cc: ludo@gnu.org, Herman Rimm , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 68935-submit@debbugs.gnu.org id=B68935.17075068076068 (code B ref 68935); Fri, 09 Feb 2024 19:27:03 +0000 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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 From patchwork Fri Feb 9 19:25:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 59968 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D985127BBE2; Fri, 9 Feb 2024 19:27:44 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AD1FA27BBEB for ; Fri, 9 Feb 2024 19:27:43 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYWWS-0002VX-Nx; Fri, 09 Feb 2024 14:26:52 -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 1rYWWR-0002Ul-JP for guix-patches@gnu.org; Fri, 09 Feb 2024 14:26:51 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWWR-0000hz-As; Fri, 09 Feb 2024 14:26:51 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYWWd-0001bS-GV; Fri, 09 Feb 2024 14:27:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68935] [PATCH v2 4/6] utils: Add find-expression procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 09 Feb 2024 19:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68935 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68935@debbugs.gnu.org Cc: ludo@gnu.org, Herman Rimm , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 68935-submit@debbugs.gnu.org id=B68935.17075068076074 (code B ref 68935); Fri, 09 Feb 2024 19:27:03 +0000 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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 From patchwork Fri Feb 9 19:25:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 59966 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 59E3527BBEA; Fri, 9 Feb 2024 19:27:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 26FA327BBED for ; Fri, 9 Feb 2024 19:27:27 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYWWS-0002VM-IC; Fri, 09 Feb 2024 14:26:52 -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 1rYWWR-0002Uk-Fw for guix-patches@gnu.org; Fri, 09 Feb 2024 14:26:51 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWWR-0000ht-7C; Fri, 09 Feb 2024 14:26:51 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYWWd-0001bZ-W2; Fri, 09 Feb 2024 14:27:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68935] [PATCH v2 5/6] import: Insert packages into modules alphabetically. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 09 Feb 2024 19:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68935 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68935@debbugs.gnu.org Cc: ludo@gnu.org, Herman Rimm , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 68935-submit@debbugs.gnu.org id=B68935.17075068086084 (code B ref 68935); Fri, 09 Feb 2024 19:27:03 +0000 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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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))))) From patchwork Fri Feb 9 19:25:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 59967 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DE1D427BBED; Fri, 9 Feb 2024 19:27:43 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6C89B27BBE2 for ; Fri, 9 Feb 2024 19:27:43 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYWWU-0002Wh-1L; Fri, 09 Feb 2024 14:26:54 -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 1rYWWS-0002V1-1R for guix-patches@gnu.org; Fri, 09 Feb 2024 14:26:52 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYWWR-0000iS-Pi; Fri, 09 Feb 2024 14:26:51 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYWWe-0001bo-ES; Fri, 09 Feb 2024 14:27:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68935] [PATCH v2 6/6] import: Discard args after --version and --help. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 09 Feb 2024 19:27:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68935 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68935@debbugs.gnu.org Cc: ludo@gnu.org, Herman Rimm , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 68935-submit@debbugs.gnu.org id=B68935.17075068086090 (code B ref 68935); Fri, 09 Feb 2024 19:27:04 +0000 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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 ...))