From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id eH7DE8YP1WWpRgEAe85BDQ:P1 (envelope-from ) for ; Tue, 20 Feb 2024 21:47:02 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id eH7DE8YP1WWpRgEAe85BDQ (envelope-from ) for ; Tue, 20 Feb 2024 21:47:02 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=XYafFq3z; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708462022; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=YPdZj0lREphUbToJkT/UipgGDY/iNBYxR/ni2RKD38c=; b=ZHOj7jc3gg287X1sAoEb+yMvup96GS8mdAp+2k6y/9bMpE03738+nlq6ghGT0nwDw+dmM/ x7jrKwUh1AaMJC1mveWRx9UDMJDDolQ9RNn0VUkQp5ZKJGiGjVbDqCAY+OjsuPYAeYJpZk AVq6GLTfwtChmWWwjIoevrd9wWGlnJXgLpQz9uS3BhFJdlrBRKZL0MLvFl0RUuRX5GLFYI JUlhLMzjM01GOurS6spWiEq149LL8hzCm0YpoPJZQbaMgEGB0yX8IJiyi0wUBc7cyzCjpW V7DqxYhBe8BbfvhWvWtfh3g9OmXkRt5vWJg3pyJiSFvGWTk6dVP+Q4xnRipkxA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=XYafFq3z; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708462022; a=rsa-sha256; cv=none; b=AC1maglabraVmVxJizLLJ0S+TVdt+Qs324DVp1vQ4YsuyKRE1Ob2Pd7FQuuDoYMMs7AgYq 6ltaBwr0AR3wH6330Np+lz9CuxDy7SJAZxp1JirzAiZxcyzFrH8UMzbUiRDyFPSoFWG4iZ rr7CSEXyeEYcDqUjsPUT/QP8WdL73B7ayqPZNBGdPXEvhVAkwTEIlov+CaqnB0j4yoNpbL IWHB7VFH3vPsn4Yy4YPdj37TXcqXHn8OM0k7J7/vCajtOqeX+0QKDTyhJlU4VI2LYiWt6U ebirZGcIbggAUvgOcUEkAgGxl6xlI5yfRXKM+Y17u0idmbhehuhTAnxgsqdELg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 364252374C for ; Tue, 20 Feb 2024 21:47:02 +0100 (CET) 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 Content-Transfer-Encoding: 8bit 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 From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.48 X-Spam-Score: -6.48 X-Migadu-Queue-Id: 364252374C X-TUID: APBak4WBDxls 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