From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id OOvnF5RMV2dG/gAA62LTzQ:P1 (envelope-from ) for ; Mon, 09 Dec 2024 20:01:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id OOvnF5RMV2dG/gAA62LTzQ (envelope-from ) for ; Mon, 09 Dec 2024 21:01:24 +0100 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=mCb4QQJp; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=ZxAazH3R; 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=1733774484; h=from:from:sender:sender:reply-to: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: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=vbd9YSMArsYiTOpR2bVjbynh1n769novSpr3gLT1zpo=; b=ARAmThrkcaFYMciczvn+puIHtX423ft+XmDDkS+qszqGTHGFM4mxUv+QlkXsZkqR1jENID XrQKQWV4XthzP+tRmb/RmtRwLDiiCTy4mxVPuf+evJNPKAzq0+b8suAqfeioY4wx961BJq 6xnS8fhhVvZqPtLtm2xuEz82qRQp3ludWtxY85fucrcnLKIUkjJMVBmRzAtk0Ea8zzNtAP FGE6NAwfTanfR4r97X3kg2yoGXlGFnbpSfRvm+tQ5WU/vPQpX7rbevWHOlNJSjzp06BgEM +lGDAV/Mx6BQK/uYB5U9bBM4QSsKNKdF/qwcAJNPfiiccJZgpvvlmxpSPXmmLA== 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=mCb4QQJp; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=ZxAazH3R; 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=1733774484; a=rsa-sha256; cv=none; b=AtAfajRsd0MaEQU7xGS3GLId7zGCowgLK5cq0UrukJSDBdfrvRve2OPdPVdkTDIRs2zurk TZ1epvI3h+YrgXeEV5UUI66K+rGre8KBMyorZx3J85OPHjhVd55jivyumOD5QomonRuij2 imbqUCB7+zgZqF+KoYEoSQFG+DNnvBU0Ij4NDUGknUGv3Sbz6ElJlH8lPVypVLpZbqaPq7 6XkIE5ZTQOs+CDhERAWklxHtyMVcmhnQJ4hZ8PB2VRbLNUbPOJRgHZTVjMwEug49PTU8Rp Rlb3LJign3uFaauS+q1f35h7tq+MOkeu13P0r3pAi2u/EcgI47OCtIruQvYeeg== 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 38B7179A8B for ; Mon, 09 Dec 2024 21:01:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvR-0005EY-G1; Mon, 09 Dec 2024 15:00:13 -0500 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 1tKjvP-0005CR-Ow for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:11 -0500 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 1tKjvP-0007Z7-9H for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:11 -0500 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=vbd9YSMArsYiTOpR2bVjbynh1n769novSpr3gLT1zpo=; b=mCb4QQJpU2kS0hF9oWGOdWjLvzWq0xVvKbxk8MMdM7CCET7Z4qHZsxMCS+uxX0qmpeJw9Yu81gYAStgZ5v6QIIYyKpmE63Hwd+SoYhWer3QCgHsqncKVocLnIAWupIMkdFUdnG16eBUt+WZzmSNxZhFrRJmsMmqqu1L82FGXsHuCrhtqo4fTYEGG/IwZtnjnfP0hS9UJKRvu2vmSNL78/bpZiZ/kNCEGL2KwPtnWjTdBKGpIjK+ZFxattOApYmEYrAaOXJS1kXgz+meT8H41xNOWquMERLrxsqpDH+4l7Q54yVSo9Anajn2TXjV97Xn67DKNwMMhPYThvllUzrbkYg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvO-0002Hb-S1 for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:10 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 10/11] import: egg: Use maybe-*inputs procedures. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:10 +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 Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743768329 (code B ref 70923); Mon, 09 Dec 2024 20:00:10 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:36 +0000 Received: from localhost ([127.0.0.1]:55751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjup-0002AD-E1 for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:35 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:59135 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuk-00027N-6S for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774355; 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=vbd9YSMArsYiTOpR2bVjbynh1n769novSpr3gLT1zpo=; b=ZxAazH3RHczTLZC1WAxBnHgSkJWX4Rr1XiLBOI4fJwEnKnzpyDpCfQaf63L+2ssaXQcei0 OPqIq0jkgX14a1ot+Jghg4M/1izSCYmCF5bYDLBrIFhv4AcinzJvtE6VFLJKi98zN1Gx5h RjDs4lQiKIBd7EHHJ5hdBfv4wRI2gsJxoFTV+jBs1M1PaDOLIFs2apP0BGzgxR53gYHo5W g3ntAl/QssXz17HZUEaFx7M4QJ/cWgAzzJcLYV1dzgu8G6Y/c8iPrOtINqRpLsWtuKSU6f IH01ZopjALafZGcBs4TkWa8npIKW5Kzgm19TXt7gyXt2uVA6FHXmjpPcFH9yZQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 492b301e (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:15 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:14 +0100 Message-ID: <889b96cf8b0b08a11e116f67b836f9efd209b9e9.1733774143.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -2.66 X-Spam-Score: -2.66 X-Migadu-Queue-Id: 38B7179A8B X-TUID: 4yp7+LhodeL8 * guix/import/egg.scm (maybe-inputs): Delete procedure. (egg-parse-dependency): Simplify procedure to return strings. (egg->guix-package): Use maybe-*inputs procedures. Change-Id: Ib0a3f5b6f02912c847defd02ba7675d80005279b --- guix/import/egg.scm | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/guix/import/egg.scm b/guix/import/egg.scm index a87de1453e..049c45257e 100644 --- a/guix/import/egg.scm +++ b/guix/import/egg.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2022 Hartmut Goebel ;;; Copyright © 2024 Ekaitz Zarraga +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -230,23 +231,14 @@ (define* (egg->guix-package name version #:key (file #f) (source #f) (else char))) (maybe-symbol->string name))) - (define* (egg-parse-dependency name #:key (system? #f)) - (define extract-name - (match-lambda - ((name version) name) - (name name))) - - (define (prettify-name name) + (define* (egg-parse-dependency dependency #:key (system? #f)) + (let ((name (match dependency + ((name version) name) + (name name)))) (if system? (prettify-system-dependency name) - (maybe-symbol->string name))) - - (let ((name (prettify-name (extract-name name)))) - ;; Dependencies are sometimes specified as symbols and sometimes - ;; as strings - (string->symbol (string-append - (if system? "" package-name-prefix) - name)))) + (string-append package-name-prefix + (maybe-symbol->string name))))) (define egg-propagated-inputs (let ((dependencies (assoc-ref egg-content 'dependencies))) @@ -278,15 +270,6 @@ (define* (egg->guix-package name version #:key (file #f) (source #f) test+build-dependencies)) (() '())))) - ;; Copied from (guix import hackage). - (define (maybe-inputs input-type inputs) - (match inputs - (() - '()) - ((inputs ...) - (list (list input-type - `(list ,@inputs)))))) - (values `(package (name ,(egg-name->guix-name name)) @@ -304,16 +287,16 @@ (define* (egg->guix-package name version #:key (file #f) (source #f) "failed to download tar archive")))))) (build-system chicken-build-system) (arguments ,(list 'quasiquote (list #:egg-name name))) - ,@(maybe-inputs 'native-inputs egg-native-inputs) - ,@(maybe-inputs 'inputs egg-inputs) - ,@(maybe-inputs 'propagated-inputs egg-propagated-inputs) + ,@(maybe-native-inputs egg-native-inputs) + ,@(maybe-inputs egg-inputs) + ,@(maybe-propagated-inputs egg-propagated-inputs) (home-page ,egg-home-page) (synopsis ,egg-synopsis) (description #f) (license ,egg-licenses)) (filter (lambda (name) (not (member name '("srfi-4")))) - (map (compose guix-name->egg-name symbol->string) + (map guix-name->egg-name (append egg-propagated-inputs egg-native-inputs))))))) -- 2.45.2