GNU bug report logs - #68935
[PATCH 0/3] Add 'put' option to guix import.

Previous Next

Package: guix-patches;

Reported by: Herman Rimm <herman <at> rimm.ee>

Date: Mon, 5 Feb 2024 14:52:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #65 received at 68935 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 68935 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, Herman Rimm <herman <at> rimm.ee>
Subject: [PATCH v3 2/7] import: Wrap package expressions with define-public.
Date: Tue, 20 Feb 2024 21:45:10 +0100
* 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 <zimon.toutoune <at> gmail.com>
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2022 Philip McGrath <philip <at> philipmcgrath.com>
+;;; Copyright © 2024 Herman Rimm <herman <at> rimm.ee>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (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





This bug report was last modified 1 year and 86 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.