From b2ed40c29f578d46d42cb1c5e99bd797cea3aba0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 29 Oct 2021 22:29:05 +0200 Subject: 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. --- guix/import/print.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'guix/import') 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 -- cgit v1.2.3