Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 506378 - Add repoman check for perl gentoo version scheme
Summary: Add repoman check for perl gentoo version scheme
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal enhancement with 1 vote (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-31 16:14 UTC by Mikle Kolyada (RETIRED)
Modified: 2019-12-21 09:31 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2014-03-31 16:14:27 UTC
Hello.

Last time i'm noticed, that not all developer have  clear understanding about how  perl gentoo-specific version scheme works. We already have the module[0], which can help with convertion, see below how it works[1]. In other words, it might be useful to have repoman check for version scheme if possible.

[0]  -  dev-perl/Gentoo-PerlMod-Version

[1]  - zlogene@unrandom ~ $ /usr/bin/gentoo-perlmod-version.pl 0.70
0.70 => 0.700.0
zlogene@unrandom ~ $
Comment 1 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2014-03-31 21:50:03 UTC
If you just want to invoke it to return a translated number:

FOO="$(gentoo-perlmod-version.pl --oneshot 0.70)"
is apropos of 

FOO="0.700.0"
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2014-10-27 21:13:47 UTC
Basically the test should schematically work like this: 

if "ebuild inherits perl-module.eclass (direct or indirect)" and "ebuild defines MODULE_VERSION" then

  VALUE1=${PV}
  VALUE2=$(gentoo-perlmod-version.pl --oneshot ${MODULE_VERSION})

  test fails if VALUE1 != VALUE2

endif

-----

of course re-writing this in python might make sense for a repoman test...
Comment 3 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2014-10-28 08:31:43 UTC
Though getting it *right* in python however could be far more challenging than you'd expect.

Even how perl's version.pm normalises internally is a bit mystical, and this utility heavily relies on that module to do its dirty work, so that it is directly asking the perl versioning scheme how to interpret versions given.

Attempts I've seen so far at replicating this behaviour without using perl's implementation have more often than not simply been broken.

For instance, euscan habitually seems to think its "1.2." instead of "1.2.0"
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2017-01-02 08:23:01 UTC
(In reply to Kent Fredric (IRC: kent\n) from comment #3)
> Though getting it *right* in python however could be far more challenging
> than you'd expect.
> 

It's probably easier then to call an external perl script *once* per dev-perl ebuild in such a plugin.
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2017-01-02 16:17:39 UTC
Yes, adding a non-python plugin is possible for repoman.

It will need a python wrapper though.

For an example, see the webrsync portage module.  It calls the bash based emerge-webrsync command.  And the repoman modules are I think quite simple.

I can help with the repoman module if you can provide the perl to run.
Comment 6 Tim Harder gentoo-dev 2019-12-03 02:07:44 UTC
For anyone interested in the check and not the repoman-specific implementation, it's been available in the last couple pkgcheck releases and currently goes by the keyword result "MismatchedPerlVersion" as seen currently in CI.
Comment 7 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-12-21 09:31:43 UTC
I'd say ci is enough. Repoman is slow-mode developed thing. The main idea was to give developers warnings about misversioning, the tooling performing this check is less relevant.