summaryrefslogtreecommitdiff
path: root/guix/import/print.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-10-29 22:29:05 +0200
committerLudovic Courtès <ludo@gnu.org>2021-11-11 00:14:31 +0100
commitb2ed40c29f578d46d42cb1c5e99bd797cea3aba0 (patch)
tree80b35f89f329c782c55ee4b988e1d70513c9f8d7 /guix/import/print.scm
parentb3240ae846cb1ace2322a68eca3497f11d0be6f1 (diff)
import: print: Handle patches that are origins.
* guix/import/print.scm (package->code)[source->code]: Handle patches that are origins. * tests/print.scm (pkg-with-origin-input): Add 'patches' field. (pkg-with-origin-patch, pkg-with-origin-patch-source): New variables. ("package with origin patch"): New test.
Diffstat (limited to 'guix/import/print.scm')
-rw-r--r--guix/import/print.scm13
1 files changed, 11 insertions, 2 deletions
diff --git a/guix/import/print.scm b/guix/import/print.scm
index 4e65d18bc3..e04a6647b4 100644
--- a/guix/import/print.scm
+++ b/guix/import/print.scm
@@ -112,8 +112,17 @@ when evaluated."
;; FIXME: in order to be able to throw away the directory prefix,
;; we just assume that the patch files can be found with
;; "search-patches".
- ,@(if (null? patches) '()
- `((patches (search-patches ,@(map basename patches))))))))
+ ,@(cond ((null? patches)
+ '())
+ ((every string? patches)
+ `((patches (search-patches ,@(map basename patches)))))
+ (else
+ `((patches (list ,@(map (match-lambda
+ ((? string? file)
+ `(search-patch ,file))
+ ((? origin? origin)
+ (source->code origin #f)))
+ patches)))))))))
(define (package-lists->code lsts)
(list 'quasiquote