From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id CPm2H5RzQmb+TgAAe85BDQ:P1 (envelope-from ) for ; Mon, 13 May 2024 22:09:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id CPm2H5RzQmb+TgAAe85BDQ (envelope-from ) for ; Mon, 13 May 2024 22:09:56 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b="WF6q/JK6"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715630996; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=wnNXWoqw8IXmozIC7cZTKfI2/v13ivYKrtK9YRoDSSM=; b=e9oyb9r2ImtaiwhvzJofogXg444ci/l/OJ6e+f02P80kZKkWZdgVKfsOdTJU8lFOUoHIar ax/ZKPp8zcXO6iuUWsspg7WRNsIJB/1FhDkKCsxqg7aw188V9CpmUflHs/Zy43UPNY4fr8 o8Jf34MpNUPELih//tTrnFuuv/lcivVRp5GiJFc1FtmoLcU0ZmjIBEzVP15XkeR1hsUVm9 4P8jPQIl3qjG6Ty/4T6e12ZV9rgQMZEYAZ7QLmB47neArS1NOxhKvZMoUUZ8qB2wZjHhp9 2yxMy31bSrEN+EB8GshQ972j/0Z5SnC0wgBYBLIrKxM9PtdZlfcczE4KFwnUaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b="WF6q/JK6"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715630996; a=rsa-sha256; cv=none; b=jrwcum9bW09F+YKqzs9H4O6VaDHdubxjOqrTJ11D8WqDALMpB6lekduk+SPVNXrKxKKQDe GxR26VlA31KnCir3EiEEYK3uyOfsbjyEOfkXQgFg4TB6LXE92L29DuAYGlCHdPbaTQecrU sZ3356MQY3prEHmn4AAazW7wrHhZavR5qtWKlMzMSvUUYRkTxwo6/XM0t9I6c7lT9cHPvA iWKsVsBunU+i+usKKiDBL5eMlHdlv+c2Wudiw/ZvZe+i4Y6BHUwJLgMd9ic1WOeW1gkVKn VFBs0pXC+mq8W7AjceVuQUsshE0G4NNATmr6F1MaDDq2Ui6jWDd/2Cz4LNeTKQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5995E6DC59 for ; Mon, 13 May 2024 22:09:56 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byx-0004Ia-Mi; Mon, 13 May 2024 16:09:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s6bys-0004De-Ng for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s6bys-0007oV-Fx for guix-patches@gnu.org; Mon, 13 May 2024 16:09:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byr-0000Ij-Vr; Mon, 13 May 2024 16:09:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 10/13] import: cran: Use 'maybe-list-field' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: rekado@elephly.net, guix-patches@gnu.org Resent-Date: Mon, 13 May 2024 20:09:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Cc: Ricardo Wurmus X-Debbugs-Original-Xcc: Ricardo Wurmus Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17156309301062 (code B ref 70923); Mon, 13 May 2024 20:09:05 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:50 +0000 Received: from localhost ([127.0.0.1]:34608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byc-0000Gy-AE for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:50 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47157 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byT-0000Ek-VR for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wnNXWoqw8IXmozIC7cZTKfI2/v13ivYKrtK9YRoDSSM=; b=WF6q/JK609lRt15ZRHbtoMrx7eYBxU0Dl61wVp/OGMh+aguXl/NI1t29YuGozr4gvPdcca ia095ILB6SEClx8MdYIjoGcKXOJDM8ClFOTdfdWEl2CqWDw0XCO1ocLO3b0JHrjFjsgvVG ArZ80srvJh8Tyu7raa5BEvQ0i2aohkzvLA0IOl48wBZqvq78y+wyNFs6HNbRVqiSOKUv7+ P0hpg0TskbFZIgQ2s2EElREy+0avEwDQ47bRreSc2hrgRlvAHjmduzOa+EdH0f5Ed+VO9t phd6x0womG+5qPcuiAXqwMGBTqviPnMc2F0AyyJoPk6A1OVGjSW0w4DQzjS+yg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 4f50ec2c (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:30 +0000 (UTC) Date: Mon, 13 May 2024 22:08:07 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.37 X-Spam-Score: -6.37 X-Migadu-Queue-Id: 5995E6DC59 X-Migadu-Scanner: mx13.migadu.com X-TUID: G8hg7J5WBMUM * guix/import/cran.scm (format-inputs): Delete procedure. (maybe-inputs): Use 'maybe-list-field' procedure. Change-Id: I5148afcebdac1f7fa0f8cce9e82e8cebb56c36c8 --- guix/import/cran.scm | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 6ae00cae96..70ee3eb9ec 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -85,21 +85,6 @@ (define-module (guix import cran) (define %input-style (make-parameter 'variable)) ; or 'specification -(define (format-inputs inputs) - "Generate a sorted list of package inputs from a list of upstream inputs." - (map (lambda (input) - (case (%input-style) - ((specification) - `(specification->package ,(upstream-input-downstream-name input))) - (else - ((compose string->symbol - upstream-input-downstream-name) - input)))) - (sort inputs - (lambda (a b) - (string-cilicenses license-string license-prefix) (let ((licenses (map string-trim-both @@ -188,11 +173,21 @@ (define (description->alist description) (define* (maybe-inputs package-inputs #:optional (input-type 'inputs)) "Given a list of PACKAGE-INPUTS, tries to generate the TYPE field of a package definition." - (match package-inputs - (() - '()) - ((package-inputs ...) - `((,input-type (list ,@(format-inputs package-inputs))))))) + (define (format-input input) + (case (%input-style) + ((specification) + `(specification->package ,(upstream-input-downstream-name input))) + (else + ((compose string->symbol + upstream-input-downstream-name) + input)))) + + (define (upstream-input-name