2014-01-18 02:05:45 +04:00
|
|
|
#!/bin/bash
|
|
|
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
2014-07-07 22:06:38 +04:00
|
|
|
source "$(dirname "$0")/lib/ulib/ulib" || exit 1
|
|
|
|
urequire DEFAULTS semver
|
2014-01-18 02:05:45 +04:00
|
|
|
|
|
|
|
function display_help() {
|
2015-03-05 09:46:23 +04:00
|
|
|
uecho "$scriptname: gérer des numéros de version selon les règles du versionage sémantique v2.0.0 (http://semver.org/)
|
2014-01-18 02:05:45 +04:00
|
|
|
|
|
|
|
USAGE
|
|
|
|
$scriptname [options]
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-f, --file VERSIONFILE
|
|
|
|
Gérer le numéro de version se trouvant dans le fichier spécifié. Le
|
|
|
|
fichier est créé si nécessaire. C'est l'option par défaut si un fichier
|
|
|
|
nommé VERSION.txt se trouve dans le répertoire courant.
|
2015-03-05 09:47:22 +04:00
|
|
|
-g, --git [branch:]VERSIONFILE
|
2015-03-05 09:46:23 +04:00
|
|
|
Prendre pour valeur de départ le contenu du fichier VERSIONFILE (qui
|
|
|
|
vaut par défaut VERSION.txt) dans la branche BRANCH (qui vaut par défaut
|
|
|
|
master) du dépôt git situé dans le répertoire courant.
|
2014-01-18 02:05:45 +04:00
|
|
|
-s, --string VERSION
|
|
|
|
Prendre pour valeur de départ le numéro de version spécifié
|
|
|
|
|
|
|
|
--show
|
|
|
|
Afficher le numéro de version. C'est l'action par défaut
|
|
|
|
--check
|
2015-03-05 09:46:23 +04:00
|
|
|
Vérifier que le numéro de version est conforme aux règles du versionage
|
2014-01-18 11:11:38 +04:00
|
|
|
sémantique
|
2014-01-18 11:23:39 +04:00
|
|
|
--convert
|
|
|
|
--no-convert
|
|
|
|
Activer (resp. désactiver) la conversion automatique. Par défaut, si la
|
|
|
|
version est au format classique 'x.z[.p]-rDD/MM/YYYY', elle est
|
|
|
|
convertie automatiquement au format sémantique x.z.p+rYYYYMMDD
|
2014-01-18 02:05:45 +04:00
|
|
|
--eq VERSION
|
|
|
|
--ne VERSION
|
|
|
|
--lt VERSION
|
|
|
|
--le VERSION
|
|
|
|
--gt VERSION
|
|
|
|
--ge VERSION
|
|
|
|
--same VERSION
|
|
|
|
--diff VERSION
|
2014-01-18 23:07:41 +04:00
|
|
|
Comparer avec la version spécifiée. Les opérateurs --eq, --ne, --lt,
|
|
|
|
--le, --gt, et --ge ignorent l'identifiant de build (comme le demande la
|
2015-03-05 09:46:23 +04:00
|
|
|
règle du versionage sémantique). Les opérateurs --same et --diff
|
2014-01-18 23:07:41 +04:00
|
|
|
comparent aussi les identifiants de build.
|
2014-01-18 02:05:45 +04:00
|
|
|
-v, --set-version VERSION
|
|
|
|
Spécifier un nouveau numéro de version qui écrase la valeur actuelle.
|
2014-01-18 11:11:38 +04:00
|
|
|
Cette option ne devrait pas être utilisée en temps normal parce que cela
|
2015-03-05 09:46:23 +04:00
|
|
|
va contre les règles du versionage sémantique.
|
2014-01-18 02:05:45 +04:00
|
|
|
-u, --update
|
|
|
|
Mettre à jour le numéro de version.
|
|
|
|
|
|
|
|
--menu
|
|
|
|
Afficher un menu permettant de choisir le composant de la version à
|
|
|
|
incrémenter
|
|
|
|
-x, --major
|
|
|
|
Augmenter le numéro de version majeure
|
|
|
|
-z, --minor
|
|
|
|
Augmenter le numéro de version mineure. C'est la valeur par défaut.
|
|
|
|
-p, --patchlevel
|
|
|
|
Augmenter le numéro de patch
|
|
|
|
|
|
|
|
-l, --prelease ID
|
2014-01-18 20:59:52 +04:00
|
|
|
Spécifier un identifiant de pré-release, à ajouter au numéro de version.
|
2014-01-18 02:05:45 +04:00
|
|
|
-a, --alpha
|
|
|
|
-b, --beta
|
|
|
|
-r, --rc
|
|
|
|
Spécifier une pré-release de type alpha, beta, ou rc. Si la version est
|
|
|
|
déjà dans ce type, augmenter la dernière valeur numérique des composants
|
|
|
|
de l'identifiant, e.g. alpha deviant alpha.1, beta-1.2 devient beta-1.3,
|
|
|
|
rc1 devient rc2
|
2015-03-05 09:46:23 +04:00
|
|
|
XXX ces fonctions ne sont pas encore implémentées
|
2014-01-18 02:05:45 +04:00
|
|
|
-R, --final, --release
|
|
|
|
Supprimer l'identifiant de prérelease
|
|
|
|
|
|
|
|
-m, --metadata ID
|
2015-03-05 09:46:23 +04:00
|
|
|
Spécifier un identifiant de build, à ajouter au numéro de version.
|
|
|
|
-M, --vcs-metadata
|
|
|
|
Spécifier l'identifiant à partir de la révision actuelle dans le
|
|
|
|
gestionnaire de version. Note: pour le moment, seul git est supporté."
|
2014-01-18 02:05:45 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
action=auto
|
|
|
|
source=auto
|
|
|
|
file=
|
2015-03-05 09:46:23 +04:00
|
|
|
git=
|
2014-01-18 02:05:45 +04:00
|
|
|
version=
|
2014-01-18 11:23:39 +04:00
|
|
|
convert=auto
|
2014-01-18 02:05:45 +04:00
|
|
|
operator=
|
|
|
|
oversion=
|
|
|
|
setversion=
|
|
|
|
incversion=
|
|
|
|
setprelease=
|
|
|
|
setalpha=
|
|
|
|
setbeta=
|
|
|
|
setrc=
|
2014-01-18 11:11:38 +04:00
|
|
|
setrelease=
|
2014-01-18 02:05:45 +04:00
|
|
|
setmetadata=
|
2015-03-05 09:46:23 +04:00
|
|
|
vcsmetadata=
|
2014-01-18 02:05:45 +04:00
|
|
|
parse_opts "${PRETTYOPTS[@]}" \
|
|
|
|
--help '$exit_with display_help' \
|
2015-03-05 09:46:23 +04:00
|
|
|
-f:,--file: '$set@ file; source=file' \
|
|
|
|
-g:,--git: '$set@ git; source=git' \
|
2014-01-18 02:05:45 +04:00
|
|
|
-s:,--string: '$set@ version; source=' \
|
|
|
|
--show action=show \
|
|
|
|
--check action=check \
|
2014-01-18 11:23:39 +04:00
|
|
|
--convert convert=1 \
|
|
|
|
--no-convert convert= \
|
2014-01-18 02:05:45 +04:00
|
|
|
--eq: '$action=compare; operator=eq; set@ oversion' \
|
|
|
|
--ne: '$action=compare; operator=ne; set@ oversion' \
|
|
|
|
--lt: '$action=compare; operator=lt; set@ oversion' \
|
|
|
|
--le: '$action=compare; operator=le; set@ oversion' \
|
|
|
|
--gt: '$action=compare; operator=gt; set@ oversion' \
|
|
|
|
--ge: '$action=compare; operator=ge; set@ oversion' \
|
|
|
|
-v:,--set-version: '$action=update; set@ setversion; incversion=' \
|
|
|
|
-u,--update '$action=update; [ -z "$incversion" ] && incversion=auto' \
|
|
|
|
--menu '$action=update; incversion=menu' \
|
|
|
|
-x,--major '$action=update; incversion=major' \
|
|
|
|
-z,--minor '$action=update; incversion=minor' \
|
|
|
|
-p,--patchlevel '$action=update; incversion=patchlevel' \
|
2014-01-18 20:31:35 +04:00
|
|
|
-l:,--prelease:,--prerelease: '$action=update; set@ setprelease; [ -z "$setprelease" ] && { setalpha=; setbeta=; setrc=; setrelease=1; }' \
|
2014-01-18 11:11:38 +04:00
|
|
|
-a,--alpha '$action=update; setalpha=1; setbeta=; setrc=; setrelease=' \
|
|
|
|
-b,--beta '$action=update; setalpha=; setbeta=1; setrc=; setrelease=' \
|
|
|
|
-r,--rc '$action=update; setalpha=; setbeta=; setrc=1; setrelease=' \
|
|
|
|
-R,--release,--final '$action=update; setalpha=; setbeta=; setrc=; setrelease=1' \
|
2014-01-18 02:05:45 +04:00
|
|
|
-m:,--metadata: '$action=update; set@ setmetadata' \
|
2015-03-05 09:46:23 +04:00
|
|
|
-M,--vcs-metadata '$action=update; vcsmetadata=1' \
|
2014-01-18 02:05:45 +04:00
|
|
|
@ args -- "$@" && set -- "${args[@]}" || die "$args"
|
|
|
|
|
|
|
|
# Calculer la source
|
|
|
|
if [ "$source" == auto ]; then
|
2015-03-05 09:46:23 +04:00
|
|
|
source=file
|
2014-01-18 02:05:45 +04:00
|
|
|
for i in VERSION.txt version.txt; do
|
|
|
|
if [ -f "$i" ]; then
|
|
|
|
file="$i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2015-03-05 09:46:23 +04:00
|
|
|
elif [ "$source" == file ]; then
|
2014-01-18 02:05:45 +04:00
|
|
|
[ "$action" == auto ] && action=update
|
|
|
|
fi
|
2015-03-05 09:46:23 +04:00
|
|
|
[ "$source" == file -a -z "$file" ] && file=VERSION.txt
|
2014-01-18 02:05:45 +04:00
|
|
|
[ "$action" == auto ] && action=show
|
|
|
|
|
|
|
|
# Lire la version
|
2015-03-05 09:46:23 +04:00
|
|
|
if [ "$source" == file ]; then
|
2014-01-18 02:05:45 +04:00
|
|
|
[ -f "$file" ] && version="$(<"$file")"
|
2015-03-05 09:46:23 +04:00
|
|
|
[ -n "$version" ] || version=0.0.0
|
|
|
|
elif [ "$source" == git ]; then
|
2015-03-05 09:47:22 +04:00
|
|
|
splitfsep2 "$git" : branch name
|
2015-03-05 09:46:23 +04:00
|
|
|
[ -n "$branch" ] || branch=master
|
|
|
|
[ -n "$name" ] || name=VERSION.txt
|
|
|
|
if git rev-parse --verify --quiet "$branch:$name" >/dev/null; then
|
|
|
|
version="$(git cat-file blob "$branch:$name" 2>/dev/null)"
|
|
|
|
fi
|
|
|
|
[ -n "$version" ] || version=0.0.0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Conversion éventuelle du numéro de version
|
|
|
|
psemver_parse "$version"
|
|
|
|
if [ "$convert" == auto ]; then
|
|
|
|
[ -z "$valid" ] && convert=1 || convert=
|
|
|
|
fi
|
|
|
|
if [ -n "$convert" ]; then
|
|
|
|
mversion="$(awkrun version="$version" '
|
|
|
|
function nbdot(s) {
|
|
|
|
gsub(/[^.]/, "", s)
|
|
|
|
return length(s)
|
|
|
|
}
|
|
|
|
BEGIN {
|
|
|
|
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
|
|
|
|
pos = length(version) - 12
|
|
|
|
if (pos > 0) {
|
|
|
|
rdate = substr(version, pos + 3)
|
|
|
|
metadata = substr(rdate, 7, 4) substr(rdate, 4, 2) substr(rdate, 1, 2)
|
|
|
|
version = substr(version, 1, pos)
|
|
|
|
}
|
|
|
|
# traiter metadata
|
|
|
|
match(version, /[0-9]+(\.[0-9]+(\.[0-9]+)?)?/)
|
|
|
|
pos = RLENGTH
|
|
|
|
if (pos < length(version)) {
|
|
|
|
if (metadata != "") metadata = metadata "."
|
|
|
|
metadata = metadata 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 (metadata != "") print version "+" metadata
|
|
|
|
else print version
|
|
|
|
}
|
|
|
|
}')"
|
|
|
|
if [ -n "$mversion" ]; then
|
|
|
|
version="$mversion"
|
|
|
|
psemver_parse "$version"
|
|
|
|
fi
|
2014-01-18 02:05:45 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Actions
|
|
|
|
|
2014-01-18 11:17:51 +04:00
|
|
|
if [ "$action" == show ]; then
|
2014-01-18 20:51:36 +04:00
|
|
|
if isatty; then
|
|
|
|
estepi "La version actuelle est $version"
|
|
|
|
else
|
|
|
|
echo "$version"
|
|
|
|
fi
|
2014-01-18 11:17:51 +04:00
|
|
|
exit 0
|
2014-01-18 02:08:06 +04:00
|
|
|
fi
|
2014-01-18 02:05:45 +04:00
|
|
|
|
|
|
|
if [ "$action" == check ]; then
|
|
|
|
[ -n "$valid" ] || die "Numéro de version invalide: $version"
|
|
|
|
|
|
|
|
elif [ "$action" == compare ]; then
|
2014-01-18 11:11:38 +04:00
|
|
|
psemver_parse "$oversion" o
|
2014-01-18 23:07:41 +04:00
|
|
|
|
2014-01-18 02:05:45 +04:00
|
|
|
case "$operator" in
|
|
|
|
eq|same)
|
|
|
|
for var in valid major minor patchlevel; do
|
|
|
|
ovar="o$var"
|
|
|
|
[ "${!var}" == "${!ovar}" ] || exit 1
|
|
|
|
done
|
|
|
|
array_eq prelease oprelease || exit 1
|
|
|
|
if [ "$operator" == same ]; then
|
|
|
|
array_eq metadata ometadata || exit 1
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
ne|diff)
|
|
|
|
for var in valid major minor patchlevel; do
|
|
|
|
ovar="o$var"
|
|
|
|
[ "${!var}" != "${!ovar}" ] && exit 0
|
|
|
|
done
|
|
|
|
! array_eq prelease oprelease && exit 0
|
|
|
|
if [ "$operator" == diff ]; then
|
|
|
|
! array_eq metadata ometadata && exit 0
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
lt)
|
|
|
|
[ -z "$valid" -a -z "$ovalid" ] && exit 1
|
|
|
|
[ "$major" -lt "$omajor" ] && exit 0
|
|
|
|
[ "$major" -gt "$omajor" ] && exit 1
|
|
|
|
[ "$minor" -lt "$ominor" ] && exit 0
|
|
|
|
[ "$minor" -gt "$ominor" ] && exit 1
|
|
|
|
[ "$patchlevel" -lt "$opatchlevel" ] && exit 0
|
|
|
|
[ "$patchlevel" -gt "$opatchlevel" ] && exit 1
|
2014-01-18 12:14:14 +04:00
|
|
|
case "$(psemver_compare_prelease "" o)" in
|
|
|
|
lt) exit 0;;
|
|
|
|
esac
|
2014-01-18 02:05:45 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
le)
|
|
|
|
[ -z "$valid" -a -z "$ovalid" ] && exit 1
|
|
|
|
[ "$major" -lt "$omajor" ] && exit 0
|
|
|
|
[ "$major" -gt "$omajor" ] && exit 1
|
|
|
|
[ "$minor" -lt "$ominor" ] && exit 0
|
|
|
|
[ "$minor" -gt "$ominor" ] && exit 1
|
|
|
|
[ "$patchlevel" -lt "$opatchlevel" ] && exit 0
|
|
|
|
[ "$patchlevel" -gt "$opatchlevel" ] && exit 1
|
2014-01-18 12:14:14 +04:00
|
|
|
case "$(psemver_compare_prelease "" o)" in
|
|
|
|
lt|eq) exit 0;;
|
|
|
|
esac
|
|
|
|
exit 1
|
2014-01-18 02:05:45 +04:00
|
|
|
;;
|
|
|
|
gt)
|
|
|
|
[ -z "$valid" -a -z "$ovalid" ] && exit 1
|
|
|
|
[ "$major" -lt "$omajor" ] && exit 1
|
|
|
|
[ "$major" -gt "$omajor" ] && exit 0
|
|
|
|
[ "$minor" -lt "$ominor" ] && exit 1
|
|
|
|
[ "$minor" -gt "$ominor" ] && exit 0
|
|
|
|
[ "$patchlevel" -lt "$opatchlevel" ] && exit 1
|
|
|
|
[ "$patchlevel" -gt "$opatchlevel" ] && exit 0
|
2014-01-18 12:14:14 +04:00
|
|
|
case "$(psemver_compare_prelease "" o)" in
|
|
|
|
gt) exit 0;;
|
|
|
|
esac
|
2014-01-18 02:05:45 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
ge)
|
|
|
|
[ -z "$valid" -a -z "$ovalid" ] && exit 1
|
|
|
|
[ "$major" -lt "$omajor" ] && exit 1
|
|
|
|
[ "$major" -gt "$omajor" ] && exit 0
|
|
|
|
[ "$minor" -lt "$ominor" ] && exit 1
|
|
|
|
[ "$minor" -gt "$ominor" ] && exit 0
|
|
|
|
[ "$patchlevel" -lt "$opatchlevel" ] && exit 1
|
|
|
|
[ "$patchlevel" -gt "$opatchlevel" ] && exit 0
|
2014-01-18 12:14:14 +04:00
|
|
|
case "$(psemver_compare_prelease "" o)" in
|
|
|
|
gt|eq) exit 0;;
|
|
|
|
esac
|
|
|
|
exit 1
|
2014-01-18 02:05:45 +04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
elif [ "$action" == update ]; then
|
2014-01-18 11:17:51 +04:00
|
|
|
[ -n "$valid" ] || die "Numéro de version invalide: $version"
|
|
|
|
|
|
|
|
if [ -n "$file" ]; then
|
|
|
|
if [ -f "$file" ]; then
|
2014-01-18 20:51:36 +04:00
|
|
|
if isatty; then
|
|
|
|
estepi "La version actuelle est $version"
|
|
|
|
fi
|
2014-01-18 11:17:51 +04:00
|
|
|
else
|
2014-01-18 20:51:36 +04:00
|
|
|
if isatty; then
|
|
|
|
ask_yesno "Le fichier $(ppath "$file") n'existe pas. Faut-il le créer?" O || die
|
|
|
|
fi
|
2014-01-18 11:17:51 +04:00
|
|
|
fi
|
2014-01-18 02:05:45 +04:00
|
|
|
fi
|
|
|
|
|
2014-01-18 20:51:36 +04:00
|
|
|
# forcer le numéro de version
|
2014-01-18 20:59:52 +04:00
|
|
|
if [ -n "$setversion" ]; then
|
|
|
|
psemver_setversion "$setversion" "" || die "Numéro de version invalide: $setversion"
|
|
|
|
fi
|
2014-01-18 20:51:36 +04:00
|
|
|
|
2015-03-05 09:46:23 +04:00
|
|
|
# Calculer metadata
|
|
|
|
if [ -n "$vcsmetadata" ]; then
|
|
|
|
setmetadata="$(git rev-parse --short HEAD)" || die
|
|
|
|
fi
|
|
|
|
|
2014-01-18 02:05:45 +04:00
|
|
|
# incrémenter les numéros de version
|
2014-01-18 20:31:35 +04:00
|
|
|
if [ "$incversion" == auto ]; then
|
|
|
|
if [ -n "$setrelease" -o -n "$setprelease" -o -n "$setmetadata" ]; then
|
|
|
|
incversion=
|
|
|
|
else
|
|
|
|
incversion=menu
|
|
|
|
fi
|
|
|
|
fi
|
2014-01-18 11:11:38 +04:00
|
|
|
if [ "$incversion" == menu ]; then
|
2015-03-05 09:46:23 +04:00
|
|
|
psemver_copy x; psemver_incmajor x; psemver_setprelease "$setprelease" x; psemver_setmetadata "$setmetadata" x; psemver_setvar versionx x
|
|
|
|
psemver_copy z; psemver_incminor z; psemver_setprelease "$setprelease" z; psemver_setmetadata "$setmetadata" z; psemver_setvar versionz z
|
|
|
|
psemver_copy p; psemver_incpatchlevel p; psemver_setprelease "$setprelease" p; psemver_setmetadata "$setmetadata" p; psemver_setvar versionp p
|
|
|
|
psemver_copy k; psemver_setprelease "$setprelease" k; psemver_setmetadata "$setmetadata" k; psemver_setvar versionk k
|
2014-01-18 11:11:38 +04:00
|
|
|
nextvs=(
|
|
|
|
"$versionx : maj incompatibles de l'API (-x)"
|
|
|
|
"$versionz : maj compatibles de l'API (-z)"
|
|
|
|
"$versionp : correction de bugs (-p)"
|
2014-01-18 20:31:35 +04:00
|
|
|
"$versionk : ne pas incrémenter la version"
|
2014-01-18 11:11:38 +04:00
|
|
|
)
|
|
|
|
nextv="${nextvs[1]}"
|
|
|
|
simple_menu nextv nextvs \
|
|
|
|
-t "Incrémenter le numéro de version" \
|
|
|
|
-m "Veuillez choisir la prochaine version"
|
|
|
|
case "${nextv%)}" in
|
|
|
|
*-x) incversion=major;;
|
|
|
|
*-z) incversion=minor;;
|
|
|
|
*-p) incversion=patchlevel;;
|
2014-01-18 20:31:35 +04:00
|
|
|
*) incversion=;;
|
2014-01-18 11:11:38 +04:00
|
|
|
esac
|
|
|
|
fi
|
2015-03-05 09:46:23 +04:00
|
|
|
if [ -n "$incversion" ]; then
|
|
|
|
case "$incversion" in
|
|
|
|
major) psemver_incmajor;;
|
|
|
|
minor) psemver_incminor;;
|
|
|
|
patchlevel) psemver_incpatchlevel;;
|
|
|
|
esac
|
|
|
|
# Quand on incrémente, réinitialiser la valeur de prérelease et metadata
|
|
|
|
psemver_setprelease
|
|
|
|
psemver_setmetadata
|
|
|
|
fi
|
2014-01-18 02:05:45 +04:00
|
|
|
|
|
|
|
# spécifier prerelease
|
2014-01-18 11:11:38 +04:00
|
|
|
if [ -n "$setrelease" ]; then
|
|
|
|
psemver_setprelease ""
|
2014-01-18 02:05:45 +04:00
|
|
|
elif [ -n "$setprelease" ]; then
|
2014-01-18 20:59:52 +04:00
|
|
|
psemver_setprelease "$setprelease" || die "Identifiant de pre-release invalide: $setprelease"
|
2014-01-18 02:05:45 +04:00
|
|
|
fi
|
|
|
|
if [ -n "$setalpha" ]; then
|
2015-03-05 09:46:23 +04:00
|
|
|
: #XXX
|
2014-01-18 02:05:45 +04:00
|
|
|
elif [ -n "$setbeta" ]; then
|
2015-03-05 09:46:23 +04:00
|
|
|
: #XXX
|
2014-01-18 02:05:45 +04:00
|
|
|
elif [ -n "$setrc" ]; then
|
2015-03-05 09:46:23 +04:00
|
|
|
: #XXX
|
2014-01-18 02:05:45 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# spécifier metadata
|
2014-01-18 20:59:52 +04:00
|
|
|
if [ -n "$setmetadata" ]; then
|
|
|
|
psemver_setmetadata "$setmetadata" || die "Identifiant de build invalide: $setmetadata"
|
|
|
|
fi
|
2014-01-18 02:05:45 +04:00
|
|
|
|
2014-01-18 20:59:52 +04:00
|
|
|
# afficher le résultat final
|
2014-01-18 11:11:38 +04:00
|
|
|
psemver_setvar version
|
2014-01-18 02:05:45 +04:00
|
|
|
if [ -n "$file" ]; then
|
|
|
|
echo "$version" >"$file"
|
|
|
|
fi
|
2014-01-18 20:51:36 +04:00
|
|
|
if isatty; then
|
|
|
|
estepn "La nouvelle version est $version"
|
|
|
|
else
|
|
|
|
echo "$version"
|
|
|
|
fi
|
2014-01-18 02:05:45 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|