[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/07: import: print: Quasiquote properties
From: |
guix-commits |
Subject: |
03/07: import: print: Quasiquote properties |
Date: |
Thu, 29 Sep 2022 17:11:01 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 8b2119a5e4793cad1df1070d488a54ceea420840
Author: itd <itd@net.in.tum.de>
AuthorDate: Fri Sep 23 16:11:52 2022 +0200
import: print: Quasiquote properties
* guix/import/print.scm (package->code): Quasiquote properties.
* tests/print.scm (pkg-with-properties, pkg-with-properties-source):
New variables.
("package with properties"): New test
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
guix/import/print.scm | 3 ++-
tests/print.scm | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/guix/import/print.scm b/guix/import/print.scm
index 66016145cb..2f54adbd8c 100644
--- a/guix/import/print.scm
+++ b/guix/import/print.scm
@@ -200,7 +200,8 @@ when evaluated."
(source ,(source->code source version))
,@(match properties
(() '())
- (_ `((properties ,properties))))
+ (_ `((properties
+ ,(list 'quasiquote (object->code properties #t))))))
,@(if replacement
`((replacement ,replacement))
'())
diff --git a/tests/print.scm b/tests/print.scm
index d9710d1ed3..b4f193b905 100644
--- a/tests/print.scm
+++ b/tests/print.scm
@@ -139,6 +139,25 @@
(description "This is a dummy package.")
(license license:gpl3+)))
+(define-with-source pkg-with-properties pkg-with-properties-source
+ (package
+ (name "test")
+ (version "1.2.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "file:///tmp/test-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah"))))
+ (properties
+ `((hidden? . #t) (upstream-name "test-upstream")))
+ (build-system (@ (guix build-system gnu) gnu-build-system))
+ (home-page "http://gnu.org")
+ (synopsis "Dummy")
+ (description "This is a dummy package.")
+ (license license:gpl3+)))
+
(test-equal "simple package"
`(define-public test ,pkg-source)
(package->code pkg))
@@ -159,4 +178,8 @@
`(define-public test ,pkg-with-arguments-source)
(package->code pkg-with-arguments))
+(test-equal "package with properties"
+ `(define-public test ,pkg-with-properties-source)
+ (package->code pkg-with-properties))
+
(test-end "print")
- branch master updated (e6777cfa5e -> 4244f5e9a7), guix-commits, 2022/09/29
- 04/07: gnu: Add lite-xl., guix-commits, 2022/09/29
- 01/07: services: shepherd: Leave the finalization thread in peace., guix-commits, 2022/09/29
- 03/07: import: print: Quasiquote properties,
guix-commits <=
- 05/07: services: certbot: Create "live" directory during activation., guix-commits, 2022/09/29
- 07/07: news: Add entry for '--with-source'., guix-commits, 2022/09/29
- 06/07: transformations: '--with-source' now operates in depth., guix-commits, 2022/09/29
- 02/07: import/utils: alist->package: Include properties., guix-commits, 2022/09/29