all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Herman Rimm via Guix-patches via <guix-patches@gnu.org>
To: 74849@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#74849] [PATCH 3/6] import: utils: Move guix-name to (guix utils).
Date: Fri, 13 Dec 2024 13:25:46 +0100	[thread overview]
Message-ID: <fc85bcad13a5a32fc6e23b0a5db7c739fc685b3c.1734090979.git.herman@rimm.ee> (raw)
In-Reply-To: <cover.1734090979.git.herman@rimm.ee>

* guix/import/elpa.scm: Import (guix utils).
* guix/import/texlive.scm (guix-name): Remove.
* guix/import/utils.scm (guix-name): Move to ...
* guix/utils.scm (guix-name): ... here.

Change-Id: If56a452f64ed06c8bb06a96a283a5067cb54d602
---
 guix/import/elpa.scm    |  1 +
 guix/import/texlive.scm | 10 +---------
 guix/import/utils.scm   | 10 ----------
 guix/utils.scm          |  9 +++++++++
 4 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 46b6dc98a2..11559097b5 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 (guix-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 6d04cc25ee..b2e99c40f2 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 (guix-name))
   #:use-module (ice-9 ftw)
   #:use-module (ice-9 match)
   #:use-module (ice-9 popen)
@@ -334,15 +335,6 @@ (define string->license
     ((lst ...) `(list ,@(map string->license lst)))
     (x `(error unknown-license ,x))))
 
-(define (guix-name name)
-  "Return a Guix package name for a given Texlive package NAME."
-  (string-append "texlive-"
-                 (string-map (match-lambda
-                               (#\_ #\-)
-                               (#\. #\-)
-                               (chr (char-downcase chr)))
-                             name)))
-
 (define* (filter-depends depends #:optional texlive-only)
   "Filter upstream package names DEPENDS to include only their equivalent Guix
 package names, without \"texlive-\" prefix.  When TEXLIVE-ONLY is true, ignore
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index ccf18a7bf9..610fe9970e 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -82,8 +82,6 @@ (define-module (guix import utils)
             read-lines
             chunk-lines
 
-            guix-name
-
             recursive-import))
 
 (define (factorize-uri uri version)
@@ -609,14 +607,6 @@ (define* (chunk-lines lines #:optional (pred string-null?))
             (reverse res)
             (loop (cdr after) res))))))
 
-(define (guix-name prefix name)
-  "Return a Guix package name for a given package name."
-  (string-append prefix (string-map (match-lambda
-                                      (#\_ #\-)
-                                      (#\. #\-)
-                                      (chr (char-downcase chr)))
-                                    name)))
-
 (define (topological-sort nodes
                           node-dependencies
                           node-name)
diff --git a/guix/utils.scm b/guix/utils.scm
index 537d0490e0..dfa8f0f19b 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
+            guix-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 (guix-name prefix name)
+  "Return a 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-13 12:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 12:23 [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Herman Rimm via Guix-patches via
2024-12-13 12:25 ` [bug#74849] [PATCH 1/6] gnu: arm-trusted-firmware-rk3399: Reformat Herman Rimm via Guix-patches via
2024-12-13 12:25 ` [bug#74849] [PATCH 2/6] gnu: arm-trusted-firmware: Reformat Herman Rimm via Guix-patches via
2024-12-13 12:25 ` Herman Rimm via Guix-patches via [this message]
2024-12-13 12:25 ` [bug#74849] [PATCH 4/6] gnu: make-arm-trusted-firmware: Use guix-name Herman Rimm via Guix-patches via
2024-12-15  8:04   ` Vagrant Cascadian
2024-12-13 12:25 ` [bug#74849] [PATCH 5/6] gnu: make-arm-trusted-firmware: Update to 2.12 Herman Rimm via Guix-patches via
2024-12-13 12:25 ` [bug#74849] [PATCH 6/6] gnu: arm-trusted-firmware-imx8mq: Fix build Herman Rimm via Guix-patches via
2024-12-15  8:36 ` [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Vagrant Cascadian

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

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

  git send-email \
    --in-reply-to=fc85bcad13a5a32fc6e23b0a5db7c739fc685b3c.1734090979.git.herman@rimm.ee \
    --to=guix-patches@gnu.org \
    --cc=74849@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.