eapi7-ver.eclass: 'Early adopter' version of EAPI 7 version manip
authorMichał Górny <mgorny@gentoo.org>
Fri, 8 Sep 2017 11:12:30 +0000 (13:12 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 19 Sep 2017 11:08:26 +0000 (13:08 +0200)
commit59a1a0dda7300177a263eb1de347da493f09fdee
tree58f85d3b329b2807e588ae4aacc8144532bd8df4
parent99142c6811b24c976d6c532bb1c7a52cc5b3dc04
eapi7-ver.eclass: 'Early adopter' version of EAPI 7 version manip

EAPI 7 is introducing new version manipulation and comparison functions
that aim to replace versionator.eclass. This eclass provides an 'early
adopter' versions of those routines.

It serves two goals:

a. getting wider review and some real-life testing before
the specification is set in stone,

b. making it possible to adapt ebuilds to the new routines early,
reducing the future work of EAPI 7 porting,

c. improving cache generation speed (the rountines are roughly 15-20
times than versionator.eclass).

For more details on the new logic, please see the eclass documentation.
Long story short, we are introducing three functions:

1. ver_cut -- to get substrings of the version string,

2. ver_rs -- to replace version separators via indices,

3. ver_test -- to compare two version numbers.

The third function is not implemented in the eclass. It's meant to reuse
the algorithms from the package manager, and the final implementation
will most likely reuse the code from the package manager (e.g. via IPC).

The code has been initially written by Ulrich Müller.
eclass/eapi7-ver.eclass [new file with mode: 0644]
eclass/tests/eapi7-ver.sh [new file with mode: 0755]
eclass/tests/eapi7-ver_benchmark.sh [new file with mode: 0755]