#37 srpm/go.lua: fix handling of version numbers with multiple digits
Merged by eclipseo. Opened by tomranta.
https://github.com/rantala/go-rpm-macros.git master

Download 37.patch
no initial comment

Fix handling of double digit version numbers, regression introduced in commit 65a2d82 ("srpm/go.lua: avoid remove char 'v' from project name").

Example:

  $ grep goipath golang-github-playground-validator-10.spec
  %global goipath         github.com/go-playground/validator/v10

Before this patch:

  $ rpmspec --srpm -q --qf '%{name}\n' golang-github-playground-validator-10.spec
  golang-github-playground-validator-v10

After this patch:

  $ rpmspec --srpm -q --qf '%{name}\n' golang-github-playground-validator-10.spec
  golang-github-playground-validator-10

I think this is wider issues that is caused by Go guidelines lagging behind the current state of Go, especially use of the modules and the release/version tags there. I guess the "v10" is actually correct if version/tag needs to be a part of the name of the packages. It will be compat package(there is need to carry more version of the same package in the distro) in a sense. IMHO general fix is to ignore the versioning part of the import path in the go rpm macros magic and let the version be defined by the rpm's version tag in spec. I'm aware that will most probably will be rather bigger undertaking, I guess including the update of the packaging guidelines.
@alexsaezm @ngompa @dbenoit What are your takes here?

Pull-Request has been merged by eclipseo

Metadata