unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#57704] [PATCH core-updates] guix: packages: Remove #f from inputs when sanitizing.
@ 2022-09-09 15:56 Liliana Marie Prikler
  2022-09-09 15:56 ` [bug#57704] [PATCH v2] " Liliana Marie Prikler
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Liliana Marie Prikler @ 2022-09-09 15:56 UTC (permalink / raw)
  To: 57704

This makes it so that new-style inputs can be optional using regular Guile
patterns, e.g. (and (target-x86-64?) rust).

* guix/packages.scm (sanitize-inputs): Filter inputs by identity before adding
labels.
---
Note that this patch was prepared using master, but since it affects the
package record, it needs to go to core-updates.  I don' think there should
be a merge conflict here.

 guix/packages.scm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 94e464cd01..5bb2e81e18 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -430,11 +430,12 @@ (define %cuirass-supported-systems
 (define-inlinable (sanitize-inputs inputs)
   "Sanitize INPUTS by turning it into a list of name/package tuples if it's
 not already the case."
-  (cond ((null? inputs) inputs)
-        ((and (pair? (car inputs))
-              (string? (caar inputs)))
-         inputs)
-        (else (map add-input-label inputs))))
+  (let ((inputs (filter identity inputs)))
+    (cond ((null? inputs) inputs)
+          ((and (pair? (car inputs))
+                (string? (caar inputs)))
+           inputs)
+          (else (map add-input-label inputs)))))
 
 (define-syntax current-location-vector
   (lambda (s)
-- 
2.37.2





^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-01-20 20:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-09 15:56 [bug#57704] [PATCH core-updates] guix: packages: Remove #f from inputs when sanitizing Liliana Marie Prikler
2022-09-09 15:56 ` [bug#57704] [PATCH v2] " Liliana Marie Prikler
2022-09-10  0:33   ` Maxime Devos
2022-09-10  6:40     ` Liliana Marie Prikler
2022-09-10  7:44       ` Liliana Marie Prikler
2022-09-09 18:54 ` [bug#57704] [PATCH core-updates] " Maxime Devos
2022-09-10  7:41 ` [bug#57704] [PATCH v3] guix: Filter unspecified " Liliana Marie Prikler
2022-09-10 10:19   ` Maxime Devos
2022-09-26 20:51 ` [bug#57704] [PATCH core-updates] guix: packages: Remove #f from " Ludovic Courtès
2024-01-20 20:43   ` Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).