From: Herman Rimm via Guix-patches via <guix-patches@gnu.org>
To: 74997@debbugs.gnu.org
Cc: Andrew Tropin <andrew@trop.in>,
Efraim Flashner <efraim@flashner.co.il>,
Katherine Cox-Buday <cox.katherine.e+guix@gmail.com>,
Laurent Gatto <laurent.gatto@gmail.com>,
Liliana Marie Prikler <liliana.prikler@gmail.com>,
Ricardo Wurmus <rekado@elephly.net>,
Simon Tournier <zimon.toutoune@gmail.com>
Subject: [bug#74997] [PATCH 1/5] import: utils: Rename guix-name to downstream-package-name.
Date: Fri, 20 Dec 2024 18:32:32 +0100 [thread overview]
Message-ID: <e8e619647cf325c69d274e0ff0b49ed9115327ac.1734715617.git.herman@rimm.ee> (raw)
* guix/import/cran.scm (cran-guix-name): Adjust.
* guix/import/crate.scm (crate-name->package-name): Adjust.
* guix/import/elpa.scm (elpa-guix-name): Adjust.
* guix/import/npm-binary.scm (npm-name->name): Adjust.
* guix/import/utils.scm (downstream-package-name): Add procedure.
[description]: Use definite article, uppercase 'name' argument.
(guix-name): Deprecate.
Change-Id: I374892be18fbeaae1bc051b8d0c79ca4c33ed8c4
---
guix/import/cran.scm | 2 +-
guix/import/crate.scm | 2 +-
guix/import/elpa.scm | 2 +-
guix/import/npm-binary.scm | 2 +-
guix/import/utils.scm | 8 ++++++--
5 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index fe69cb87f7..3bea9439e1 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -478,7 +478,7 @@ (define (transform-sysname sysname)
("zlib1g-dev" "zlib")
(_ sysname)))
-(define cran-guix-name (cut guix-name "r-" <>))
+(define cran-guix-name (cut downstream-package-name "r-" <>))
(define (directory-needs-fortran? dir)
"Check if the directory DIR contains Fortran source files."
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 5996571cda..c50f0a8415 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -467,7 +467,7 @@ (define (guix-package->crate-name package)
((name _ ...) name))))
(define (crate-name->package-name name)
- (guix-name "rust-" name))
+ (downstream-package-name "rust-" name))
\f
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 46b6dc98a2..b86a6a546b 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -481,7 +481,7 @@ (define %elpa-updater
(pred package-from-elpa-repository?)
(import latest-release)))
-(define elpa-guix-name (cut guix-name "emacs-" <>))
+(define elpa-guix-name (cut downstream-package-name "emacs-" <>))
(define* (elpa-recursive-import package-name #:optional (repo 'gnu))
(recursive-import package-name
diff --git a/guix/import/npm-binary.scm b/guix/import/npm-binary.scm
index 6dfedc4910..92ac7d338e 100644
--- a/guix/import/npm-binary.scm
+++ b/guix/import/npm-binary.scm
@@ -178,7 +178,7 @@ (define (npm-name->name npm-name)
(define (clean name)
(string-map (lambda (chr) (if (char=? chr #\/) #\- chr))
(string-filter (negate (cut char=? <> #\@)) name)))
- (guix-name "node-" (clean npm-name)))
+ (downstream-package-name "node-" (clean npm-name)))
(define (name+version->symbol name version)
(string->symbol (string-append name "-" version)))
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index e45c8dfb20..0b1b3b3298 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -37,6 +37,7 @@ (define-module (guix import utils)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix utils)
#:use-module (guix packages)
+ #:use-module (guix deprecation)
#:use-module (guix discovery)
#:use-module (guix build-system)
#:use-module ((guix i18n) #:select (G_))
@@ -82,6 +83,7 @@ (define-module (guix import utils)
read-lines
chunk-lines
+ downstream-package-name
guix-name
recursive-import))
@@ -612,14 +614,16 @@ (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."
+(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
node-dependencies
node-name)
base-commit: 7f91b12fe31baa0838ae2e942d4515911e71b137
--
2.45.2
next reply other threads:[~2024-12-20 19:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 17:32 Herman Rimm via Guix-patches via [this message]
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 ` [bug#74997] [PATCH 3/5] import: utils: Move downstream-package-name to (guix utils) Herman Rimm via Guix-patches via
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=e8e619647cf325c69d274e0ff0b49ed9115327ac.1734715617.git.herman@rimm.ee \
--to=guix-patches@gnu.org \
--cc=74997@debbugs.gnu.org \
--cc=andrew@trop.in \
--cc=cox.katherine.e+guix@gmail.com \
--cc=efraim@flashner.co.il \
--cc=herman@rimm.ee \
--cc=laurent.gatto@gmail.com \
--cc=liliana.prikler@gmail.com \
--cc=rekado@elephly.net \
--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).