en mode auto, ne pas incrémenter si ce n'est pas nécessaire

le menu propose de ne pas incrémenter la version
This commit is contained in:
Jephte CLAIN 2014-01-18 20:31:35 +04:00
parent ec89c5ea57
commit ac8cc8753d
1 changed files with 11 additions and 2 deletions

View File

@ -106,7 +106,7 @@ parse_opts "${PRETTYOPTS[@]}" \
-x,--major '$action=update; incversion=major' \ -x,--major '$action=update; incversion=major' \
-z,--minor '$action=update; incversion=minor' \ -z,--minor '$action=update; incversion=minor' \
-p,--patchlevel '$action=update; incversion=patchlevel' \ -p,--patchlevel '$action=update; incversion=patchlevel' \
-l:,--prelease:,--prerelease: '$action=update; set@ setprelease' \ -l:,--prelease:,--prerelease: '$action=update; set@ setprelease; [ -z "$setprelease" ] && { setalpha=; setbeta=; setrc=; setrelease=1; }' \
-a,--alpha '$action=update; setalpha=1; setbeta=; setrc=; setrelease=' \ -a,--alpha '$action=update; setalpha=1; setbeta=; setrc=; setrelease=' \
-b,--beta '$action=update; setalpha=; setbeta=1; setrc=; setrelease=' \ -b,--beta '$action=update; setalpha=; setbeta=1; setrc=; setrelease=' \
-r,--rc '$action=update; setalpha=; setbeta=; setrc=1; setrelease=' \ -r,--rc '$action=update; setalpha=; setbeta=; setrc=1; setrelease=' \
@ -243,15 +243,23 @@ elif [ "$action" == update ]; then
fi fi
# incrémenter les numéros de version # incrémenter les numéros de version
[ "$incversion" == auto ] && incversion=menu if [ "$incversion" == auto ]; then
if [ -n "$setrelease" -o -n "$setprelease" -o -n "$setmetadata" ]; then
incversion=
else
incversion=menu
fi
fi
if [ "$incversion" == menu ]; then if [ "$incversion" == menu ]; then
psemver_copy x; psemver_incmajor x; psemver_setprelease "$setprelease" x; psemver_setvar versionx x psemver_copy x; psemver_incmajor x; psemver_setprelease "$setprelease" x; psemver_setvar versionx x
psemver_copy z; psemver_incminor z; psemver_setprelease "$setprelease" z; psemver_setvar versionz z psemver_copy z; psemver_incminor z; psemver_setprelease "$setprelease" z; psemver_setvar versionz z
psemver_copy p; psemver_incpatchlevel p; psemver_setprelease "$setprelease" p; psemver_setvar versionp p psemver_copy p; psemver_incpatchlevel p; psemver_setprelease "$setprelease" p; psemver_setvar versionp p
psemver_copy k; psemver_setprelease "$setprelease" k; psemver_setvar versionk k
nextvs=( nextvs=(
"$versionx : maj incompatibles de l'API (-x)" "$versionx : maj incompatibles de l'API (-x)"
"$versionz : maj compatibles de l'API (-z)" "$versionz : maj compatibles de l'API (-z)"
"$versionp : correction de bugs (-p)" "$versionp : correction de bugs (-p)"
"$versionk : ne pas incrémenter la version"
) )
nextv="${nextvs[1]}" nextv="${nextvs[1]}"
simple_menu nextv nextvs \ simple_menu nextv nextvs \
@ -261,6 +269,7 @@ elif [ "$action" == update ]; then
*-x) incversion=major;; *-x) incversion=major;;
*-z) incversion=minor;; *-z) incversion=minor;;
*-p) incversion=patchlevel;; *-p) incversion=patchlevel;;
*) incversion=;;
esac esac
fi fi
case "$incversion" in case "$incversion" in