unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / Atom feed
* [bug#47591] [PATCH] import: go: Replace underscores with hyphens in package names.
@ 2021-04-04  9:52 Xinglu Chen
  2021-04-04 17:43 ` Leo Famulari
  0 siblings, 1 reply; 3+ messages in thread
From: Xinglu Chen @ 2021-04-04  9:52 UTC (permalink / raw)
  To: 47591

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






^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#47591] [PATCH] import: go: Replace underscores with hyphens in package names.
  2021-04-04  9:52 [bug#47591] [PATCH] import: go: Replace underscores with hyphens in package names Xinglu Chen
@ 2021-04-04 17:43 ` Leo Famulari
  2021-04-05 21:27   ` Xinglu Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2021-04-04 17:43 UTC (permalink / raw)
  To: Xinglu Chen; +Cc: 47591

On Sun, Apr 04, 2021 at 11:52:03AM +0200, Xinglu Chen wrote:
> 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.

Thanks! Pushed as 426ade6c8bdab243da719e369a887284368179bb

> Maybe we should also make the linter check for underscores in package
> names, and give a warning if it finds any underscores?

Definitely!

I would leave existing packages alone, however, unless they are causing
some problem.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#47591] [PATCH] import: go: Replace underscores with hyphens in package names.
  2021-04-04 17:43 ` Leo Famulari
@ 2021-04-05 21:27   ` Xinglu Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Xinglu Chen @ 2021-04-05 21:27 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 47591

On Sun, Apr 04 2021, Leo Famulari wrote:

>> Maybe we should also make the linter check for underscores in package
>> names, and give a warning if it finds any underscores?
>
> Definitely!
>
> I would leave existing packages alone, however, unless they are causing
> some problem.

Do you mean that there should be a whitelist for all the packages that
already have underscores in their names, or?

Also, there has been some discussion about replacing underscores in
package names[1].

[1]: https://yhetil.org/guix-devel/87v991vkpi.fsf@nckx




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-05 21:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-04  9:52 [bug#47591] [PATCH] import: go: Replace underscores with hyphens in package names Xinglu Chen
2021-04-04 17:43 ` Leo Famulari
2021-04-05 21:27   ` Xinglu Chen

unofficial mirror of guix-patches@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-patches/1 guix-patches/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-patches guix-patches/ https://yhetil.org/guix-patches \
		guix-patches@gnu.org
	public-inbox-index guix-patches

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.patches


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git