On Sat, 09 Sep 2017 17:54:52 +0200
Michał Górny <mgo...@gentoo.org> wrote:

> I'm not sure if there's a serious proposal behind all this but I suppose
> it's all just perl-specific insanity that is of no value to everyone
> else.

Yeah, some of the stuff I suggested there are generalisations, because
it doesn't make sense to suggest such a feature and have it be
*excusively* for Perl usage.

Pretty much 100% of our usage would be just the 3-position + truncate form.

So:

  $(ver_fixlen $(ver_3float ${PV}) 3)

Or something would be most of it.

We'd probably just keep doing what we're doing with hard-normalization
+ hard-version-maps, mostly because its more obvious what is going on.

But we do have people who keep wanting something that maps $PV to
upstream, and the existing tools to do that aren't /quite/ ideal.

NB: Above, the simplified tools are:

 ver_fixlen $version $length  

 - ensure everything after first '.' are numbers 
 - make sure there are at most $length characters after '.'
 - if characters over $length limit are not '0', error.
 - truncate extraneous 0's beyond $length limit
 - if the remaining number of digits after the '.' is less than $length, 0-pad


 ver_3float $version

 - assume every group after the first '.' are the range 0-999
 - expand every group to 3 digits , so 0 == 000, 1 == 001, 10 == 010, etc.
 - concatenate all minor groups 
 - emit ${first}.${minor_groups}

I think those two would be all perl people might have a use for.

( Again, wouldn't be something we'd deploy at volume in
perl-module.eclass, would only be for the people who wanted to
simplify their own custom maintenance outside the perl herd )

I really only suggested these sorts of things because I figured "its
going to be in an EAPI? maybe the implementation might be in python?,
doing this sort of thing in python might actually be viable, whereas
its a terrible nightmare to do this kind of string manipulation in bash"

Though I figure its possible to in bash, I'm just not insane enough to
try (yet, getting there)

Attachment: pgplA2oBvXjL8.pgp
Description: OpenPGP digital signature

Reply via email to