From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id aGqkKTm7dGR/HAAASxT56A (envelope-from ) for ; Mon, 29 May 2023 16:48:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AFmHKTm7dGRucAAAauVa8A (envelope-from ) for ; Mon, 29 May 2023 16:48:25 +0200 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 6E05B28815 for ; Mon, 29 May 2023 16:48:25 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3e9f-0002Lr-29; Mon, 29 May 2023 10:47:27 -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 1q3e9M-000247-Iy for guix-patches@gnu.org; Mon, 29 May 2023 10:47:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3e9M-00034z-AQ for guix-patches@gnu.org; Mon, 29 May 2023 10:47:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3e9M-0001QS-5D; Mon, 29 May 2023 10:47:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63571] [PATCH v2 16/19] import: gem: Factorize "bundler" special case for name mapping. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: mail@cbaines.net, guix-patches@gnu.org Resent-Date: Mon, 29 May 2023 14:47:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63571 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63571@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines X-Debbugs-Original-Xcc: Christopher Baines Received: via spool by 63571-submit@debbugs.gnu.org id=B63571.16853716165325 (code B ref 63571); Mon, 29 May 2023 14:47:08 +0000 Received: (at 63571) by debbugs.gnu.org; 29 May 2023 14:46:56 +0000 Received: from localhost ([127.0.0.1]:58793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3e9A-0001Ni-4L for submit@debbugs.gnu.org; Mon, 29 May 2023 10:46:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3e8I-0001JR-2H for 63571@debbugs.gnu.org; Mon, 29 May 2023 10:46:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3e8C-0002gN-RR; Mon, 29 May 2023 10:45:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=6ZlAGibH64klshGXHlFNs/eUrTsCzN2sVABVPXK2N70=; b=epfz9SG7AxBfIes+HcS2 GsGMjEMVNxCfF5KuXi4vM4tj8ip817uhvXNgtRGxt6wyDvDzBgfj4OPqq9NM/lDu9t3otrE9Dke/Y GJ06/G2c0BOSjItNRWdfgH9LVPjpvkYz8Nb6fE/cq/6exu1jM1RKPGnXlU/OrvaAr8zWOGHQj2Ynp pZTKxxgdsy9Gt2ODuP6ASpo2e3Ny2uT0MdQMVeRpLZSkSjA+ZsP/ZUpyr2RPSklN6iHQDTo9FGky5 lTq38ERYs0ccVwzI3freVM8rjX9RzuDiaAIT4OD/58xSq8cn0fBlNt9pt6VoLoNE4syEq2u+5o3Ny toIGBWWuMVCh2Q==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3e8C-00044B-ED; Mon, 29 May 2023 10:45:56 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 29 May 2023 16:45:27 +0200 Message-Id: <5047a5c4f0d2e3ff799412ed1b2ee37b28a2d6e6.1685371175.git.ludo@gnu.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <87y1l7fb9j.fsf@gnu.org> References: <87y1l7fb9j.fsf@gnu.org> 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: , 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685371705; a=rsa-sha256; cv=none; b=kWp+AjMZLdLUYBYMYVE6oSRD4Ac1N2pJNsor7TvuAOpEl4SqR8btNAuVZURVnvtX20/s47 lF9r97auSeQCMTr1i8v3sRfFnvt+OGI3Xa2NQQu9HygSB7Rv1BKnigawfqEXo3xRSPIXby WFi1CGuK69udf5H4qJ33ScCWuD6cmGoicDugMrJ7u5FrtzO9YycCW6jXbRpmtksKokdBy0 B7Lu80WghbOeQ00M2epcJyaXMkfkKPwjOgNbI/QwHBVDEt2k63AgJ9MsAWS4rmZY7OzR70 qU9mbm8DTWsXNTSquizTjAIgVw9eOQUE1FXZbpfL0pEE+37aUn6Qv24DUYTQVA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=epfz9SG7; 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=1685371705; h=from:from:sender:sender: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=6ZlAGibH64klshGXHlFNs/eUrTsCzN2sVABVPXK2N70=; b=MGWXDtZaZHsn3v/CLlVsuXW7AQVPvXBJGE3rIneErTuyYGqWDeVBriu+n6Nz1AuVQYqnc8 T9snG8UEHlOFky6S0h27HmpTbmX3XHilv9adEzmzyDrlZ6HnJ1g8z/QkhtNijKIntAtjf5 kVglTSmGlUHVa+I4I/zUmzRGDs2CN9/AXBBpKtuEjng2641B51maYHQ1Lw76RUncXtV3eN V8hRFfoe6IP9ESr7Enw0A9NOtlowQULFRGA7Me9GKQseQs8+fTXMnCNI09G/3x0jvGrAzq CDBh+7OPgGRK6eYeUP6hdM+1BKuiqUBeeuSfLOutwVtshFpl5Mcnu1zQMKvZWA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=epfz9SG7; 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" X-Migadu-Spam-Score: -2.55 X-Spam-Score: -2.55 X-Migadu-Queue-Id: 6E05B28815 X-TUID: CEX671AAzcaZ * guix/import/gem.scm (ruby-package-name): Add "bundler" special case. (gem->guix-package): Adjust accordingly. * tests/gem.scm ("gem-recursive-import") ("gem-recursive-import with a specific version"): Remove "ruby-bundler" from the expected packages. --- guix/import/gem.scm | 14 ++++++-------- tests/gem.scm | 30 ------------------------------ 2 files changed, 6 insertions(+), 38 deletions(-) diff --git a/guix/import/gem.scm b/guix/import/gem.scm index 4e2be0f5f8..87a75bdaa6 100644 --- a/guix/import/gem.scm +++ b/guix/import/gem.scm @@ -93,9 +93,11 @@ (define* (rubygems-fetch name #:optional version) (define (ruby-package-name name) "Given the NAME of a package on RubyGems, return a Guix-compliant name for the package." - (if (string-prefix? "ruby-" name) - (snake-case name) - (string-append "ruby-" (snake-case name)))) + (if (string=? name "bundler") + name ;special case: no prefix + (if (string-prefix? "ruby-" name) + (snake-case name) + (string-append "ruby-" (snake-case name))))) (define (make-gem-sexp name version hash home-page synopsis description dependencies licenses) @@ -135,11 +137,7 @@ (define* (gem->guix-package package-name #:key (repo 'rubygems) version (let* ((dependencies-names (map gem-dependency-name (gem-dependencies-runtime (gem-dependencies gem)))) - (dependencies (map (lambda (dep) - (if (string=? dep "bundler") - "bundler" ; special case, no prefix - (ruby-package-name dep))) - dependencies-names)) + (dependencies (map ruby-package-name dependencies-names)) (licenses (map string->license (gem-licenses gem)))) (values (make-gem-sexp (gem-name gem) (gem-version gem) (gem-sha256 gem) (gem-home-page gem) diff --git a/tests/gem.scm b/tests/gem.scm index 6aa0d279dc..023415de7b 100644 --- a/tests/gem.scm +++ b/tests/gem.scm @@ -181,21 +181,6 @@ (define test-bundler-json ('description "Another cool gem") ('home-page "https://example.com") ('license #f)) ;no licensing info - ('package - ('name "ruby-bundler") - ('version "1.14.2") - ('source - ('origin - ('method 'url-fetch) - ('uri ('rubygems-uri "bundler" 'version)) - ('sha256 - ('base32 - "1446xiz7zg0bz7kgx9jv84y0s4hpsg61dj5l3qb0i00avc1kxd9v")))) - ('build-system 'ruby-build-system) - ('synopsis "Ruby gem bundler") - ('description "Ruby gem bundler") - ('home-page "https://bundler.io/") - ('license 'license:expat)) ('package ('name "ruby-foo") ('version "1.0.0") @@ -248,21 +233,6 @@ (define test-bundler-json ('description "Another cool gem") ('home-page "https://example.com") ('license #f)) ;no licensing info - ('package - ('name "ruby-bundler") - ('version "1.14.2") - ('source - ('origin - ('method 'url-fetch) - ('uri ('rubygems-uri "bundler" 'version)) - ('sha256 - ('base32 - "1446xiz7zg0bz7kgx9jv84y0s4hpsg61dj5l3qb0i00avc1kxd9v")))) - ('build-system 'ruby-build-system) - ('synopsis "Ruby gem bundler") - ('description "Ruby gem bundler") - ('home-page "https://bundler.io/") - ('license 'license:expat)) ('package ('name "ruby-foo") ('version "2.0.0") -- 2.40.1