From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.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 YIL3NCD6wGVlnAAAqHPOHw:P1 (envelope-from ) for ; Mon, 05 Feb 2024 16:09:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id YIL3NCD6wGVlnAAAqHPOHw (envelope-from ) for ; Mon, 05 Feb 2024 16:09:20 +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=rc+HqMYW; 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=1707145760; a=rsa-sha256; cv=none; b=Q62A/DehygO9BbqmXC23Bp0zoea47kvq4b22pynfdOn7K6NNLnkKCpSfMNIKadgI1pTria 32U3MMGKjNS+UESM4BLhb78lKI2kswmCSTFtI4meioefzUUaMO+ZTzKGXg7O31hg+Yid0l +fgDvGfoqAkKTTfp0Z+gGgQZNef8fghCu3w8QaI10uCSVMKMp7Eg0kc0Wg2T7VCAoFMDZc Wm/h7arqK4FYhiPKZw4JwacLgKZZOY1q6OzCkKk9+qD6w988rULTraLdpkfZEn9qKCoTBy RaQ41hEz1Kx8GT/HvXwd9fFnOYRGOkdv0sPT9vbg3ns0NMMHeRjTYvFYfZcb9Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=rc+HqMYW; 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=1707145760; 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=/IPLwMx8HZP07Kwigd95/LUuPce0HMolgFR6mKhVN7w=; b=FDx4GREuK8Nwh9BrdPV7BM0+6cAbSfQ0yizCkEUaQTHCSa2E4VPDvkXWTq7PhAdQwk3wg7 Wn6W4XyzPpcX++xCdWImLK1HHsllBzAFNUbbz9f/xsHAK/wlsgPXOI124hROjOtbXdMLoN 7FnmvLp8DFGM5PwgUjhve6eCF0M810rzypaWiQd+Ea1gfbCeYl/2twmwcltXU2s6tn2yu7 hcE0a7o0GoYkL0p/zhp00ev9V0BbEvoMc2KXADilG1XT9rDIANmFXztavBUNLB+2p1LY8o EDH9aOu+1O+H1X83chyTh4g027V/hJcVeLXFxMVMNCVHern9iCr6LH2+e9bDuQ== 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 75FF66D0E2 for ; Mon, 5 Feb 2024 16:09:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX0ad-0000yv-Ib; Mon, 05 Feb 2024 10:08:55 -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 1rX0ab-0000xk-Pq for guix-patches@gnu.org; Mon, 05 Feb 2024 10:08:53 -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 1rX0aa-0006wF-Ve; Mon, 05 Feb 2024 10:08:52 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rX0ak-0004qU-9U; Mon, 05 Feb 2024 10:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68935] [PATCH 2/3] guix: 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: Mon, 05 Feb 2024 15:09: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: 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.170714569918554 (code B ref 68935); Mon, 05 Feb 2024 15:09:02 +0000 Received: (at 68935) by debbugs.gnu.org; 5 Feb 2024 15:08:19 +0000 Received: from localhost ([127.0.0.1]:52045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0a2-0004pA-Ix for submit@debbugs.gnu.org; Mon, 05 Feb 2024 10:08:18 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:43641 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX0Zy-0004oD-Pq for 68935@debbugs.gnu.org; Mon, 05 Feb 2024 10:08:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1707145673; 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=/IPLwMx8HZP07Kwigd95/LUuPce0HMolgFR6mKhVN7w=; b=rc+HqMYWe8lBXNtF0yrXHkxg887bK7WbSmujKr0jJTcLjoVwO9uRbXtjnXbmXJHlKBxhHT u6TqqjF3TSOWFVe9mifTHkzWCJ/KdB75/mXOa8IVd4mljebt6HTBBnJHxfMFwDXwHU0voP xnM0qEWNM34h2Ee8TYrPETqcshhLyom7PQA2KegqEngTP5EAcxkB9QTouW4RYWueHLtJo1 8U9UnZnTg2HpYGji3F1QFUybGadRdc0v7daN0Ed5HhRVamfPAXvlTdj3JRpiPak62zX3NT Tu+O0laXcnwjvTfqFLw7JcsFkfeMoxShzuEWT22zINuODvbStCC069otTdDu0A== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 38f6fb90 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 5 Feb 2024 15:07:53 +0000 (UTC) Date: Mon, 5 Feb 2024 16:07:13 +0100 Message-ID: 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Spam-Score: -5.67 X-Migadu-Queue-Id: 75FF66D0E2 X-Migadu-Spam-Score: -5.67 X-TUID: ruFW2h5y99g8 * guix/scripts/import.scm (guix-import): Wrap package expressions. Change-Id: Ic4d986a4706a692b2fecd6fded8ac72ab6311687 --- guix/scripts/import.scm | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index d2a1cee56e..80b1bec7fc 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) @@ -88,17 +90,23 @@ (define-command (guix-import . args) (leave-on-EPIPE (pretty-print-with-comments (current-output-port) expr))))) (match (apply (resolve-importer importer) args) - ((and expr (or ('package _ ...) - ('let _ ...) + ((and expr ('package _ ...)) + (print (package->definition expr))) + ((and expr (or ('let _ ...) ('define-public _ ...))) (print expr)) ((? list? expressions) (for-each (lambda (expr) - (print expr) - ;; Two newlines: one after the closing paren, and - ;; one to leave a blank line. - (newline) (newline)) - expressions)) + (match expr + ((and expr ('package _ ...)) + (print (package->definition expr))) + ((and expr (or ('let _ ...) + ('define-public _ ...))) + (print expr))) + ;; Two newlines: one after the closing paren, and + ;; one to leave a blank line. + (newline) (newline)) + expressions)) (x (leave (G_ "'~a' import failed~%") importer)))) (let ((hint (string-closest importer importers #:threshold 3))) -- 2.41.0