unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: 47591@debbugs.gnu.org
Subject: [bug#47591] [PATCH] import: go: Replace underscores with hyphens in package names.
Date: Sun, 04 Apr 2021 11:52:03 +0200	[thread overview]
Message-ID: <bcd625f27e5acaaf9927590a1980f0f2a8566a07.1617528810.git.public@yoctocell.xyz> (raw)

As per section '16.4.2 Package Naming' in the manual, use hypens instead
of underscores in package names.

* guix/import/go.scm (go-module->guix-package-name): Replace underscores
with hyphens.
---
Maybe we should also make the linter check for underscores in package
names, and give a warning if it finds any underscores?

 guix/import/go.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index 7452b4c903..6c0231e113 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2021 François Joulaud <francois.joulaud@radiofrance.com>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -380,9 +381,11 @@ hence the need to derive this information."
   "Converts a module's path to the canonical Guix format for Go packages."
   (string-downcase (string-append "go-" (string-replace-substring
                                          (string-replace-substring
-                                          module-path
-                                          "." "-")
-                                         "/" "-"))))
+                                          (string-replace-substring
+                                           module-path
+                                           "." "-")
+                                          "/" "-")
+                                         "_" "-"))))
 
 (define-record-type <module-meta>
   (make-module-meta import-prefix vcs repo-root)

base-commit: 86617c92c6a795668b2eca3d3c3b285cb742cb24
-- 
2.31.1






             reply	other threads:[~2021-04-04  9:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-04  9:52 Xinglu Chen [this message]
2021-04-04 17:43 ` [bug#47591] [PATCH] import: go: Replace underscores with hyphens in package names Leo Famulari
2021-04-05 21:27   ` Xinglu Chen

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=bcd625f27e5acaaf9927590a1980f0f2a8566a07.1617528810.git.public@yoctocell.xyz \
    --to=public@yoctocell.xyz \
    --cc=47591@debbugs.gnu.org \
    /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).