From patchwork Fri Dec 20 17:35:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 35095 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9AA1427BBE9; Fri, 20 Dec 2024 17:36:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 25ADC27BBE2 for ; Fri, 20 Dec 2024 17:36:32 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOgv9-00071M-I0; Fri, 20 Dec 2024 12:36:15 -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 1tOgv6-00070X-A0 for guix-patches@gnu.org; Fri, 20 Dec 2024 12:36:12 -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 1tOgv6-00076w-0J; Fri, 20 Dec 2024 12:36:12 -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=FNiZV16DVl+v9tOWOXt1Jg/qFHHhOrF/yWnRsJTDfCU=; b=k2W9Qt8VKIrrortSAcnHgovnONHOlFmlf/F2eRni12wJSPW1atM4cDrkYuni3qx5LNZ6XQVcXsGF8oxOgXWP7P4uGD8CdASnP9mBbzrGUFqZk0MbhA+Q0fNeVVxKMJY2+POBwYQwqCrOYj/vYJJiP1n9OqB/V6KTWKGY9cdvngj4ELBtNSiOOsEd/wk0pIgbWw2QzFklr4jlv3DzIm8TGdMhKXb1niyjucPSOd+Wwn5+d1rW+2o5sWtNpBuHz5Zr3xav+Q5swwEakb+oy4ESZzzCzPneVCm2Vi7G2BJnQyXcbRgh2yySldemoH8vEt0xfN3xn8NSnxLHc4RQGYwkWw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOguw-0004nj-NV; Fri, 20 Dec 2024 12:36:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74997] [PATCH 3/5] import: utils: Move downstream-package-name to (guix utils). Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, andrew@trop.in, guix@cbaines.net, dev@jpoiret.xyz, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com, ludo@gnu.org, othacehe@gnu.org, guix@nicolasgoaziou.fr, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 20 Dec 2024 17:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74997 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74997@debbugs.gnu.org Cc: Andreas Enge , Andrew Tropin , Christopher Baines , Josselin Poiret , Katherine Cox-Buday , Liliana Marie Prikler , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Mathieu Othacehe , Nicolas Goaziou , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Andreas Enge , Andrew Tropin , Christopher Baines , Josselin Poiret , Katherine Cox-Buday , Liliana Marie Prikler , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Mathieu Othacehe , Nicolas Goaziou , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 74997-submit@debbugs.gnu.org id=B74997.173471615818422 (code B ref 74997); Fri, 20 Dec 2024 17:36:02 +0000 Received: (at 74997) by debbugs.gnu.org; 20 Dec 2024 17:35:58 +0000 Received: from localhost ([127.0.0.1]:43919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOgur-0004n3-Pt for submit@debbugs.gnu.org; Fri, 20 Dec 2024 12:35:58 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:46013 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOgun-0004mD-FY for 74997@debbugs.gnu.org; Fri, 20 Dec 2024 12:35:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1734716146; 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=FNiZV16DVl+v9tOWOXt1Jg/qFHHhOrF/yWnRsJTDfCU=; b=TmpZgGbdg/MG2p2wrI9r8cN1oRlQGEJ9vaclmcvbMbsrjuEL/AJk0TWjBu05ESkPs2z0nQ fgVaz3ZVNKq/zekyUXURrSMCl5TeV/9h3RjEI9URDO7OBVTmeZt3tgFzfAXQ03sZY9g0Nu OkhLkGi9phJ6Bxy5xOIO9pfJsoNKA+2e/WUGHeopa/+2pA4Ppla9P1tcNfW+kgCSGD7P46 76hRGwpIWQDE5qv22FLLSvLj+2rEVut5Nli+D03H51unpqGi4LuSXBr3u98Spcrqdrll4+ 6DuKOr43/Gkl96X5lJ9b2Xjdm+URtlzBjjXBsPkM1tuy4266t83A6Wn0o0EmPw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 9f20b1a0 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <74997@debbugs.gnu.org>; Fri, 20 Dec 2024 17:35:46 +0000 (UTC) Date: Fri, 20 Dec 2024 18:35:03 +0100 Message-ID: <22e9c6d15adb7a3dca3afb76ba2407c076b94af2.1734715617.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 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 X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/elpa.scm: Import (guix utils). * guix/import/texlive.scm: Import (guix utils). * guix/import/utils.scm (downstream-package-name): Move to ... * guix/utils.scm (downstream-package-name): ... here. Change-Id: If56a452f64ed06c8bb06a96a283a5067cb54d602 --- guix/import/elpa.scm | 1 + guix/import/texlive.scm | 1 + guix/import/utils.scm | 9 --------- guix/utils.scm | 9 +++++++++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index b86a6a546b..62b1d645ac 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -44,6 +44,7 @@ (define-module (guix import elpa) #:use-module (guix git) #:use-module (guix hash) #:use-module (guix store) + #:use-module ((guix utils) #:select (downstream-package-name)) #:use-module (guix base32) #:use-module (guix upstream) #:use-module (guix packages) diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm index 8ce22a1d59..8e67d11c69 100644 --- a/guix/import/texlive.scm +++ b/guix/import/texlive.scm @@ -35,6 +35,7 @@ (define-module (guix import texlive) #:use-module (guix store) #:use-module (guix svn-download) #:use-module (guix upstream) + #:use-module ((guix utils) #:select (downstream-package-name)) #:use-module (ice-9 ftw) #:use-module (ice-9 match) #:use-module (ice-9 popen) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 0b1b3b3298..6f5efa790e 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -83,7 +83,6 @@ (define-module (guix import utils) read-lines chunk-lines - downstream-package-name guix-name recursive-import)) @@ -614,14 +613,6 @@ (define* (chunk-lines lines #:optional (pred string-null?)) (reverse res) (loop (cdr after) res)))))) -(define (downstream-package-name prefix name) - "Return the Guix package name for a given package NAME." - (string-append prefix (string-map (match-lambda - (#\_ #\-) - (#\. #\-) - (chr (char-downcase chr))) - name))) - (define-deprecated/alias guix-name downstream-package-name) (define (topological-sort nodes diff --git a/guix/utils.scm b/guix/utils.scm index 537d0490e0..2d82329cb7 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -91,6 +91,7 @@ (define-module (guix utils) %current-system %current-target-system package-name->name+version + downstream-package-name target-linux? target-hurd? system-hurd? @@ -706,6 +707,14 @@ (define* (package-name->name+version spec (idx (values (substring spec 0 idx) (substring spec (1+ idx)))))) +(define (downstream-package-name prefix name) + "Return the Guix package name for a given package NAME." + (string-append prefix (string-map (match-lambda + (#\_ #\-) + (#\. #\-) + (chr (char-downcase chr))) + name))) + (define* (target-linux? #:optional (target (or (%current-target-system) (%current-system)))) "Does the operating system of TARGET use the Linux kernel?"