From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 eFb/GOEP1WWqLgEA62LTzQ:P1 (envelope-from ) for ; Tue, 20 Feb 2024 21:47:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id eFb/GOEP1WWqLgEA62LTzQ (envelope-from ) for ; Tue, 20 Feb 2024 21:47:29 +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=hL3KuRKP; 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=1708462049; 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=p5+R7ZH+BX0AWAsT8zij+rK2Myf88Y//aiedmFZiOYK8H61bmN7WOZAeyYL30mokMElG85 Eg+4rE8lzS8az2djMSLiJI9J92FLIdoLDtYM7Cv52DqtYL5nfL1AF95Pfkzyype9yUMIvZ OoEnY6lln9KBuOwUQF+Wy5tvEnf+Sc8kO2eGV6KbYtoPpJRtB968NMbNaCTzAqPLL1tea4 E0B4yWU29jlsIEGF9ckZGzl/AxFmyxyDoY3FAwGEHTDAJr6zBEfGk+v04F0O9YxkXjBT7+ zRLrwmnwgD6QyTYq1DoaeLMrcMGz43xG38IXLZyjisoWKkvUPr0NiVEED40EpA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=hL3KuRKP; 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=1708462049; a=rsa-sha256; cv=none; b=pnPyFvWto+LmjV7GtTegdXUYvEFwruTvbkRTTdqOj0ANECPThZKNqj07BBRdAUVCG/GJeM CDqGj+sAdmf0FgDu25oGlwYhgom0Wjc8hEF2fD672/JKQjbiFZIGEFiEpKPe4A+XX33OHD 9OV9SQkIpOnb20tWJMs1noUSg7T8Wk+g/0e2ShmlqnQghTkHuMhjwl3ZeJ4LQuGwSr6+kb CuYnJW+peckYAcHnB9rsb5W7/wbO/QvyQpR1VhKF1J7Rw7+RCasdj4vqbXhZbLNwTH/zO5 THV/eCle0d4n4YQFPoSnBDb2FL1H3/GZemxgL/Evs6DiBZ8fjC5OzyyGJyfSzg== 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 27EDA24735 for ; Tue, 20 Feb 2024 21:47:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcX1M-0005Hn-2C; Tue, 20 Feb 2024 15:47:20 -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 1rcX0n-000555-Q9 for guix-patches@gnu.org; Tue, 20 Feb 2024 15:46: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 1rcX0n-0004Gg-Gz; Tue, 20 Feb 2024 15:46:45 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcX15-0004Gv-6C; Tue, 20 Feb 2024 15:47:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68935] [PATCH v3 2/7] 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: Tue, 20 Feb 2024 20:47: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.170846197816311 (code B ref 68935); Tue, 20 Feb 2024 20:47:03 +0000 Received: (at 68935) by debbugs.gnu.org; 20 Feb 2024 20:46:18 +0000 Received: from localhost ([127.0.0.1]:46809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcX0L-0004Ep-VP for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:18 -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 1rcX0H-0004Do-Gi for 68935@debbugs.gnu.org; Tue, 20 Feb 2024 15:46:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1708461942; 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=hL3KuRKPHTGzuVEvtAwWrJlhNvfr2mBOT60Sp2WcP7D0MpyF9R0/rtBS9VUM1DSKcPu/oB E0BOhhpCmmh7Wlz5ZpJjOsUk6Anc0zeTcDFC/ooahDdOPhfRmdZEDIaEZg3/++9oDg4Qec 5UAlfoYtDlhB/M8raq98WFqW03Lo+Vu5wjsq3YMbfAjTLTkEwAAXw9iELpfeYwBB724A0v 4+sg+vvraDCuGrREiJ6Rbwbc7PFV3xSEvLTgPI94sr2P/ddVSUTBWD4jxfDukhb4Vjs0JU +LUOBFOmqyomGDG2rw6jbFevmb+tKU1fSYSmwuk9tAZDri6Lm3c0SCE9AvN+6w== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id dfa9a098 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 20 Feb 2024 20:45:42 +0000 (UTC) Date: Tue, 20 Feb 2024 21:45:10 +0100 Message-ID: <54605c829ce9f85cb5eccc323ae3bc5e3b49a35a.1708461547.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.48 X-Spam-Score: -5.48 X-Migadu-Queue-Id: 27EDA24735 X-TUID: bKdtcpEzIeSU * 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