support des numéros style maven

This commit is contained in:
Jephté Clain 2015-03-23 13:33:55 +04:00
parent 4f0a746d04
commit 22a26d9a81
1 changed files with 27 additions and 0 deletions

View File

@ -244,6 +244,7 @@ function nbdot(s) {
return length(s)
}
BEGIN {
### utools, legacy
if (version ~ /[0-9]+(\.[0-9]+)*(-r[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9][0-9][0-9])?$/) {
metadata = ""
# traiter release date
@ -268,6 +269,32 @@ BEGIN {
# afficher la version migrée au format semver
if (metadata != "") print version "+" metadata
else print version
### maven, pom.xml
} else if (version ~ /[0-9]+(\.[0-9]+)*(-[sS][nN][aA][pP][sS][hH][oO][tT])?$/) {
prerelease = ""
# traiter prerelease
pos = length(version) - 9
if (pos > 0) {
prerelease = substr(version, pos + 2)
version = substr(version, 1, pos)
}
# traiter prerelease
match(version, /[0-9]+(\.[0-9]+(\.[0-9]+)?)?/)
pos = RLENGTH
if (pos < length(version)) {
if (prerelease != "") prerelease = prerelease "."
prerelease = prerelease substr(version, pos + 2)
}
version = substr(version, 1, pos)
# ajouter les éléments manquants
while (nbdot(version) < 2) {
version = version ".0"
}
# afficher la version migrée au format semver
if (prerelease != "") print version "-" prerelease
else print version
}
}')"
if [ -n "$mversion" ]; then