unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 57704@debbugs.gnu.org
Subject: [bug#57704] [PATCH core-updates] guix: packages: Remove #f from inputs when sanitizing.
Date: Fri, 9 Sep 2022 17:56:20 +0200	[thread overview]
Message-ID: <b1b6504d725df23dc910cb04591a203979cdca7b.camel@gmail.com> (raw)

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





             reply	other threads:[~2022-09-09 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 15:56 Liliana Marie Prikler [this message]
2022-09-09 15:56 ` [bug#57704] [PATCH v2] guix: packages: Remove #f from inputs when sanitizing 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b1b6504d725df23dc910cb04591a203979cdca7b.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=57704@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).