From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id WFgbIJ98xmXbDQAAe85BDQ:P1 (envelope-from ) for ; Fri, 09 Feb 2024 20:27:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id WFgbIJ98xmXbDQAAe85BDQ (envelope-from ) for ; Fri, 09 Feb 2024 20:27:27 +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=e3WOTY9o; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1707506847; a=rsa-sha256; cv=none; b=EUZ7/vUEdosfIOUQY7Jh63quKWlRq4LUK4cBOWfD4Ye7LwX4HLKvJY57FsBt2Eac42BH0S INkK+aH5/sXO6CTio8d+aNlFEPW+J4LNM3xsnVRRVabv6XFHHyKRsR1b1T5FNDurh1/sct /CdG6uvTmHqFMZ6QxeCyAmjGLNMpwEP2I2mg/hPUGNRebbAYVZwISo8RA7qRn3N7Wtgjp0 pvwJ0gjSudqiiEDeIT1xesxiIPT2wjFuyOB++dKj+RtvnmUtrR+iOQ5sLMNT8gPlatbFb7 nyVh5heCASBm+9+bXP+qB9VcBb4Endfn8UVnX8nDgtMpTyc/MQqWMMm7ocZWJQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=e3WOTY9o; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1707506847; 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-type:content-type: 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=n7/eXQHPwdA8yU/5u6PHavnbXN5Xb8pyTdzEnAI/A3A=; b=iceuGBySvpdKS3ZzgRAXjeVehPFl+3eN7C5wwnByWCB9PnlPrnaYxHf3nOd9d7fxZR6Rn7 5HEd38WJ7MEQBuvcxsVayRIbInK4MpIYiXsFwPIDu7sjjWM7D8HdsiZESDlogfVHelJfRS 8TPq5ToFQvXj4gEHi4RrLjcSSYWOBok6CL2gYHeSi9fLA2yAbNbcwHNHB67dpi9LOSK5sp 5dOfhGTLjGzlVwwWyBl4jugpK6S/8zZ5ymIJUgKo7dSTDBAQamqXG7IqkfIFqpO6YR7G/+ CxLeCzn+5ELPDhZF8aStLrJtlKNcWT/udRTdEeU50MHn5BH4vtnzu99vovmrZQ== 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 0F52BE4DB for ; Fri, 9 Feb 2024 20:27:27 +0100 (CET) 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 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: 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Spam-Score: -5.68 X-Migadu-Queue-Id: 0F52BE4DB X-Migadu-Spam-Score: -5.68 X-TUID: 3Jw6UYeacFX6 * 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