unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Herman Rimm via Guix-patches via <guix-patches@gnu.org>
To: 74997@debbugs.gnu.org
Cc: "Andreas Enge" <andreas@enge.fr>,
	"Andrew Tropin" <andrew@trop.in>,
	"Christopher Baines" <guix@cbaines.net>,
	"Josselin Poiret" <dev@jpoiret.xyz>,
	"Katherine Cox-Buday" <cox.katherine.e+guix@gmail.com>,
	"Liliana Marie Prikler" <liliana.prikler@gmail.com>,
	"Ludovic Courtès" <ludo@gnu.org>,
	"Mathieu Othacehe" <othacehe@gnu.org>,
	"Nicolas Goaziou" <guix@nicolasgoaziou.fr>,
	"Simon Tournier" <zimon.toutoune@gmail.com>,
	"Tobias Geerinckx-Rice" <me@tobias.gr>
Subject: [bug#74997] [PATCH 3/5] import: utils: Move downstream-package-name to (guix utils).
Date: Fri, 20 Dec 2024 18:35:03 +0100	[thread overview]
Message-ID: <22e9c6d15adb7a3dca3afb76ba2407c076b94af2.1734715617.git.herman@rimm.ee> (raw)
In-Reply-To: <e8e619647cf325c69d274e0ff0b49ed9115327ac.1734715617.git.herman@rimm.ee>

* 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?"
-- 
2.45.2





  parent reply	other threads:[~2024-12-20 17:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-20 17:32 [bug#74997] [PATCH 1/5] import: utils: Rename guix-name to downstream-package-name Herman Rimm via Guix-patches via
2024-12-20 17:35 ` [bug#74997] [PATCH 2/5] import: texlive: Remove guix-name Herman Rimm via Guix-patches via
2024-12-20 17:35 ` Herman Rimm via Guix-patches via [this message]
2024-12-20 17:35 ` [bug#74997] [PATCH 4/5] gnu: make-arm-trusted-firmware: Use downstream-package-name Herman Rimm via Guix-patches via
2024-12-20 17:35 ` [bug#74997] [PATCH 5/5] gnu: u-boot: " Herman Rimm via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22e9c6d15adb7a3dca3afb76ba2407c076b94af2.1734715617.git.herman@rimm.ee \
    --to=guix-patches@gnu.org \
    --cc=74997@debbugs.gnu.org \
    --cc=andreas@enge.fr \
    --cc=andrew@trop.in \
    --cc=cox.katherine.e+guix@gmail.com \
    --cc=dev@jpoiret.xyz \
    --cc=guix@cbaines.net \
    --cc=guix@nicolasgoaziou.fr \
    --cc=herman@rimm.ee \
    --cc=liliana.prikler@gmail.com \
    --cc=ludo@gnu.org \
    --cc=me@tobias.gr \
    --cc=othacehe@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).