[bug#77093,rust-team,10/18] scripts: import: Add two newlines for ‘--insert’ option.
Message ID | 4e38cd180a457bcd8ca56b6a6ad58042cef81014.1742281797.git.hako@ultrarare.space |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0CFBF27BBEA; Tue, 18 Mar 2025 07:28:09 +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=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI, PDS_OTHER_BAD_TLD,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,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 CE5E327BBE2 for <patchwork@mira.cbaines.net>; Tue, 18 Mar 2025 07:28:08 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1tuRMf-0007od-Jg; Tue, 18 Mar 2025 03:27:57 -0400 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 <Debian-debbugs@debbugs.gnu.org>) id 1tuRMK-0007eW-NT for guix-patches@gnu.org; Tue, 18 Mar 2025 03:27:36 -0400 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 <Debian-debbugs@debbugs.gnu.org>) id 1tuRM3-0001Ud-E4; Tue, 18 Mar 2025 03:27:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=q8EtGgJNAcVCCAJm1iKNtDwPxS31GnBy41AJ8jW1jdQ=; b=HTTkxUPZhZURZZdJTlgI1WmnUCjQhkjAU21UJBUsmRef+I8yJK3bOMLBokj9qVirchvbUaA6QaM/mF0usCec33Zt5VIMrMnbZBy+pLxrY8TN7jRHMd6hEPYtD/aHq9YNFW9HOIuUkWfxQKCddXeZ6Meufrg8LpraC4R89++EAbTCcp905ny1MceWhRE6BJmJ27MqGTJnVNe+7pGwLFDEborDYwZDybY4Rf0tg1FOGIi27aqkUYt6mQ5aB7AV4dtWmKT9uaD7b/ePjcX5//ppDDpbd9EufIreKaHPqQETQ+KGuY+p6lZlPRpEWo4VRouNkAaq4eN9y1rCvkVCG1pDmg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tuRM0-0004pv-CA; Tue, 18 Mar 2025 03:27:12 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77093] [PATCH rust-team 10/18] scripts: import: Add two newlines for =?utf-8?b?4oCYLS1pbnNlcnTigJk=?= option. Resent-From: Hilton Chain <hako@ultrarare.space> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: hako@ultrarare.space, guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 18 Mar 2025 07:27:12 +0000 Resent-Message-ID: <handler.77093.B77093.174228281018308@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77093 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77093@debbugs.gnu.org Cc: Hilton Chain <hako@ultrarare.space>, Hilton Chain <hako@ultrarare.space>, Christopher Baines <guix@cbaines.net>, Josselin Poiret <dev@jpoiret.xyz>, Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org>, Mathieu Othacehe <othacehe@gnu.org>, Simon Tournier <zimon.toutoune@gmail.com>, Tobias Geerinckx-Rice <me@tobias.gr> X-Debbugs-Original-Xcc: Hilton Chain <hako@ultrarare.space>, Christopher Baines <guix@cbaines.net>, Josselin Poiret <dev@jpoiret.xyz>, Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org>, Mathieu Othacehe <othacehe@gnu.org>, Simon Tournier <zimon.toutoune@gmail.com>, Tobias Geerinckx-Rice <me@tobias.gr> Received: via spool by 77093-submit@debbugs.gnu.org id=B77093.174228281018308 (code B ref 77093); Tue, 18 Mar 2025 07:27:12 +0000 Received: (at 77093) by debbugs.gnu.org; 18 Mar 2025 07:26:50 +0000 Received: from localhost ([127.0.0.1]:35931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1tuRLe-0004l7-Ei for submit@debbugs.gnu.org; Tue, 18 Mar 2025 03:26:50 -0400 Received: from mx.boiledscript.com ([88.99.243.112]:60898) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <hako@ultrarare.space>) id 1tuRKx-0004eH-0H for 77093@debbugs.gnu.org; Tue, 18 Mar 2025 03:26:08 -0400 From: Hilton Chain <hako@ultrarare.space> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=mail; t=1742282765; 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=q8EtGgJNAcVCCAJm1iKNtDwPxS31GnBy41AJ8jW1jdQ=; b=OjA7pfqCMaKy+OtktgkAcdABZnhPHIF0q3dfH1mYIae3oAQEQ5GT7szzq1PwaDt8Gz71o/ vcraSMatvQdCqVZgU01ETOLP2iMl34asf+hnrAPO/gtkJled5l/yrhxUErl02/VewcPjxq e+IMy5lW/il5WRnNOgP9GXZOnLya3IFgnfjtXNcnJu/mER+DMpMJsymd/ha41RA1B11C+N Afn0R7Jdj9gpphlQqoL9ZdmGMFUMt7lVTVn2Rrvxbe1NICcKw2yimmP8arjV4+fXfMfGcK xvmQffR1lpk2JXiIwz7RYXe2dbZ26PHGW8nmAWWmakVxcul7HCZmCsXfo8GVnQ== Date: Tue, 18 Mar 2025 15:24:23 +0800 Message-ID: <4e38cd180a457bcd8ca56b6a6ad58042cef81014.1742281797.git.hako@ultrarare.space> In-Reply-To: <cover.1742281797.git.hako@ultrarare.space> References: <cover.1742281797.git.hako@ultrarare.space> MIME-Version: 1.0 X-MS-Reactions: disallow Content-Type: text/plain; charset=UTF-8 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: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> 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 |
Series |
New Rust packaging workflow based on lockfile importer.
|
|
Commit Message
Hilton Chain
March 18, 2025, 7:24 a.m. UTC
For consistency with ‘insert-expression’. * guix/scripts/import.scm (guix-import): Add two newlines when inserting. Change-Id: I55b45ca137d175fdf6ee5c0bb2b6b1ca8385750d --- guix/scripts/import.scm | 1 + 1 file changed, 1 insertion(+)
Comments
Is this only relevant for packages crated with 'guix import cargo'? If so we should probably just change the importer to add a newline to the misbehaving importer. On Tue, Mar 18, 2025 at 03:24:23PM +0800, Hilton Chain wrote: > For consistency with ‘insert-expression’. > > * guix/scripts/import.scm (guix-import): Add two newlines when inserting. > > Change-Id: I55b45ca137d175fdf6ee5c0bb2b6b1ca8385750d > --- > guix/scripts/import.scm | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm > index 4fad329cd3..58a84d0db7 100644 > --- a/guix/scripts/import.scm > +++ b/guix/scripts/import.scm > @@ -129,6 +129,7 @@ (define-command (guix-import . args) > (let ((port (open-file file "a"))) > (pretty-print-with-comments port expr) > (newline port) > + (newline port) > (close-port port))))))))) > (import-as-definitions importer args find-and-insert))) > ((importer args ...) > -- > 2.48.1 > > > >
On Tue, 18 Mar 2025 19:49:33 +0800, Efraim Flashner wrote: > > [1 <text/plain; utf-8 (quoted-printable)>] > Is this only relevant for packages crated with 'guix import cargo'? If > so we should probably just change the importer to add a newline to the > misbehaving importer. > > On Tue, Mar 18, 2025 at 03:24:23PM +0800, Hilton Chain wrote: > > For consistency with ‘insert-expression’. > > > > * guix/scripts/import.scm (guix-import): Add two newlines when inserting. > > > > Change-Id: I55b45ca137d175fdf6ee5c0bb2b6b1ca8385750d > > --- > > guix/scripts/import.scm | 1 + > > 1 file changed, 1 insertion(+) This is a general issue, adding one newline doesn't work well with appending multiple definitions. For appending n definitions, (n - 1) lines need manual addition: --8<---------------cut here---------------start------------->8--- a b c --8<---------------cut here---------------end--------------->8--- By adding two newlines, only one line needs manual deletion: --8<---------------cut here---------------start------------->8--- a b c --8<---------------cut here---------------end--------------->8---
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 4fad329cd3..58a84d0db7 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -129,6 +129,7 @@ (define-command (guix-import . args) (let ((port (open-file file "a"))) (pretty-print-with-comments port expr) (newline port) + (newline port) (close-port port))))))))) (import-as-definitions importer args find-and-insert))) ((importer args ...)