ajout de get_archive_versionsuffix()
This commit is contained in:
parent
e84b6999c3
commit
a8eb70adad
|
@ -1 +1 @@
|
|||
36
|
||||
37
|
||||
|
|
28
ulib/base
28
ulib/base
|
@ -1719,7 +1719,9 @@ function get_archive_basename() {
|
|||
}
|
||||
function get_archive_appname() {
|
||||
# Obtenir le nom probable de l'application ou du framework contenu dans
|
||||
# l'archive $1
|
||||
# l'archive $1, e.g:
|
||||
# get_archive_versionsuffix app-0.1.tgz
|
||||
# --> app
|
||||
local appname="$(basename -- "$1")"
|
||||
# supprimer l'extension
|
||||
appname="${appname%.zip}"
|
||||
|
@ -1737,14 +1739,36 @@ function get_archive_appname() {
|
|||
print substr($0, 1, RSTART - 1)
|
||||
} else if (match($0, /([0-9]+([-_.][0-9]+)*([a-zA-Z][0-9]*|[-_.][0-9]+[a-zA-Z][0-9]*)?)$/)) {
|
||||
print substr($0, 1, RSTART - 1)
|
||||
} else if (match($0, /([0-9]+[a-z][a-z][a-z]?)$/, vs)) {
|
||||
# version style AMUE, e.g. 430la
|
||||
print substr($0, 1, RSTART - 1)
|
||||
} else {
|
||||
print $0
|
||||
}
|
||||
}'
|
||||
}
|
||||
function get_archive_versionsuffix() {
|
||||
# Obtenir la valeur probable de la version de l'application ou du framework
|
||||
# contenu dans l'archive $1, avec le caractère de séparation, e.g:
|
||||
# get_archive_versionsuffix app-0.1.tgz
|
||||
# --> -0.1
|
||||
local basename="$(get_archive_basename "$1")"
|
||||
echo "$basename" | awk '{
|
||||
if (match($0, /([-_.][0-9]+([-_.][0-9]+)*([a-zA-Z][0-9]*|[-_.][0-9]+[a-zA-Z][0-9]*)?)$/, vs)) {
|
||||
print vs["1"]
|
||||
} else if (match($0, /([0-9]+([-_.][0-9]+)*([a-zA-Z][0-9]*|[-_.][0-9]+[a-zA-Z][0-9]*)?)$/, vs)) {
|
||||
print vs["1"]
|
||||
} else if (match($0, /([0-9]+[a-z][a-z][a-z]?)$/, vs)) {
|
||||
# version style AMUE, e.g. 430la
|
||||
print vs["1"]
|
||||
}
|
||||
}'
|
||||
}
|
||||
function get_archive_version() {
|
||||
# Obtenir la valeur probable de la version de l'application ou du framework
|
||||
# contenu dans l'archive $1
|
||||
# contenu dans l'archive $1, e.g:
|
||||
# get_archive_versionsuffix app-0.1.tgz
|
||||
# --> 0.1
|
||||
local basename="$(get_archive_basename "$1")"
|
||||
echo "$basename" | awk '{
|
||||
if (match($0, /[-_.]([0-9]+([-_.][0-9]+)*([a-zA-Z][0-9]*|[-_.][0-9]+[a-zA-Z][0-9]*)?)$/, vs)) {
|
||||
|
|
Loading…
Reference in New Issue