From patchwork Tue Feb 20 20:45:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 2278 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 B6E7A27BBEA; Tue, 20 Feb 2024 20:47:02 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,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 4128227BBE2 for ; Tue, 20 Feb 2024 20:47:02 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcX0k-00053u-6r; Tue, 20 Feb 2024 15:46:42 -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 1rcX0j-00053Z-0h for guix-patches@gnu.org; Tue, 20 Feb 2024 15:46:41 -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 1rcX0i-0004Ff-FY for guix-patches@gnu.org; Tue, 20 Feb 2024 15:46:40 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcX14-0004Gh-BI for guix-patches@gnu.org; Tue, 20 Feb 2024 15:47:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68935] [PATCH v3 0/7] Add insert option to guix import. References: In-Reply-To: Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Feb 2024 20:47: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.170846197316257 (code B ref 68935); Tue, 20 Feb 2024 20:47:02 +0000 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) Date: Tue, 20 Feb 2024 21:45:08 +0100 Message-ID: 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 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