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 ms13.migadu.com with LMTPS id 6FWZAIEf82biTQAAe85BDQ:P1 (envelope-from ) for ; Tue, 24 Sep 2024 20:22:25 +0000 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 6FWZAIEf82biTQAAe85BDQ (envelope-from ) for ; Tue, 24 Sep 2024 22:22:25 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Zn4Mo1L1; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=IE3bJFSh; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727209344; 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-type:content-type: 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=wJ6dOQ9TXf0jcitHGpVL5Dy+F+nbHc5iyfWGbro6toY=; b=hV7Qd5DFAAZlGKQ6tyh6nOa0WQvIkG531R+Ge6XTf5z8UrLYy3Ewpba3MQPSB6qKUeWZWJ tr2wHk1+OYui6c2pfF2WrOokBUc9nq3W5NrlarLmudJ3pHxTNMhfjJUO0RKwbfaMfSa4uL S0HoMvZrvUmhSsP1+PL8gDYvZD5kl7K83GqfXX8pbf6Ll2ZwPdPWehkovW0WK/QghL3cOE QhmDiNBq1hj0ARKEhA2LjXtmb6P/2rKUdQvcwJsHGCzzhfSEkzNLdZUtEhtG6KTihTodRK 5R4l1MVLgPz3gk132WKcJh7s00s2/z0V4F5fsfWtySnXIr+SjxVYRKW6oen1Sg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727209344; a=rsa-sha256; cv=none; b=P08ZewURDhw1G5CgMzMHo7roreoMC1fG/URZlGRvU2qduLl9wdD2ds+4YAhXL+vajcjXYX 6v2mPCxjIpv9L9o/vnc/gEDlm+iuMm6exAbJEUlPAp7Ejvd1PpLx6MaJF0/oVJjhS3zS2k AT4AVuJwi7UHSbTNGWQ82DyxM615B+Wo2muoA4W5V/9xsiMAKj1/KjJ3JxdWccsIcM4SQ1 OuIsFLJ0gecBkBKJFgPIDgdzBxyLJ8imZftdcs3Zb8TsdkHSqYf5NDm14RuCAsxVR0Jc9/ NSzf+kCWMbXguwv5lCdpLmigwYj6QJYYBG02Z5USdathdVMU2tMWmAESlvpVbQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Zn4Mo1L1; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=IE3bJFSh; dmarc=pass (policy=none) header.from=gnu.org; 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" 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 C3C2BBCCB for ; Tue, 24 Sep 2024 22:22:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2x-0000hZ-RT; Tue, 24 Sep 2024 16:22:07 -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 1stC2b-0000MF-AD for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:46 -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 1stC2Y-0003PN-85 for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=wJ6dOQ9TXf0jcitHGpVL5Dy+F+nbHc5iyfWGbro6toY=; b=Zn4Mo1L1TliHQsjXyOz75tTgyZ+5rEduJUPyadmIKFhu5qVCdBcItqZMZJgXSIlS59CFjKuy0NKCxHI/c3o5sFBnBEu3vz9n3UQLVp1jhuKYkBMYRhkTf5ItRNolYTDw53tDqU9CQ2ZzN10O3aczETtJflEuB/fYpGY02GaHSuvlPhbRzaSewUEVMPJK/Ys31BO2ZIbYogBfVCYZb0GifyOQROrg4G8LkjE2bUXJIpXRXprwSEjJ1P3qnWtFwmsfDYMoEXHOu4xW1ODIeuTCexA5L+pj2AkWjBSCujqFCmUwojmcrDGsfL+WIxYUoFjBOtjgZRlwr4OpMPfY+52LUg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2w-000553-8c; Tue, 24 Sep 2024 16:22:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 08/11] import: cran: Use 'maybe-list-field' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: laurent.gatto@gmail.com, rekado@elephly.net, zimon.toutoune@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 24 Sep 2024 20:22:06 +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: Laurent Gatto , Ricardo Wurmus , Simon Tournier X-Debbugs-Original-Xcc: Laurent Gatto , Ricardo Wurmus , Simon Tournier Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.172720930019407 (code B ref 70923); Tue, 24 Sep 2024 20:22:06 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:40 +0000 Received: from localhost ([127.0.0.1]:38512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2W-00052q-1F for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:40 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37373 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2G-00050F-2x for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wJ6dOQ9TXf0jcitHGpVL5Dy+F+nbHc5iyfWGbro6toY=; b=IE3bJFShcdYCNvD35vZZxYsT8e/GEW5/sV6SzQFZizxUSwm3ejNUbPKDmBIV6QnxGTcOXv BKzylEXGR2YFk5CBzFF7uQ9jmquiBhSSz6iQZI6Ts9nPB9SDBYjjqzMyrqD2YuDdzm27o1 z9LfeMgm8KXdiQr9wZiafC4q4Y5OuggclbNclWaOz9o0ZszNxfHKKONlgmi91XCNJq+VAG PcA4zVzkyolaQH00yoO83WCR6lIAG6PcTSImYZywpULcNS0XBfoTB78qraq08zq8NkGlsD rZUX+kZO7Qc2XcYaTKc04zN75F6y+ezSu/9agX1KBknL0ojv5+tOXa4p6+PO+A== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 8bebb0f6 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:08 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:14 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.41 X-Spam-Score: -3.41 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: C3C2BBCCB X-TUID: FsEn/5nEXTJK * guix/import/cran.scm (format-inputs): Delete procedure. (maybe-inputs): Use 'maybe-list-field' procedure. Change-Id: I5148afcebdac1f7fa0f8cce9e82e8cebb56c36c8 --- guix/import/cran.scm | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 6ae00cae96..bdac059053 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -85,21 +86,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 +174,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