From ac8cc8753d2549775abf1385959d547e12cecdb7 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Sat, 18 Jan 2014 20:31:35 +0400 Subject: [PATCH] =?UTF-8?q?en=20mode=20auto,=20ne=20pas=20incr=C3=A9menter?= =?UTF-8?q?=20si=20ce=20n'est=20pas=20n=C3=A9cessaire=20le=20menu=20propos?= =?UTF-8?q?e=20de=20ne=20pas=20incr=C3=A9menter=20la=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uversion | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/uversion b/uversion index f39f3ce..2b69211 100755 --- a/uversion +++ b/uversion @@ -106,7 +106,7 @@ parse_opts "${PRETTYOPTS[@]}" \ -x,--major '$action=update; incversion=major' \ -z,--minor '$action=update; incversion=minor' \ -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=' \ -b,--beta '$action=update; setalpha=; setbeta=1; setrc=; setrelease=' \ -r,--rc '$action=update; setalpha=; setbeta=; setrc=1; setrelease=' \ @@ -243,15 +243,23 @@ elif [ "$action" == update ]; then fi # 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 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 p; psemver_incpatchlevel p; psemver_setprelease "$setprelease" p; psemver_setvar versionp p + psemver_copy k; psemver_setprelease "$setprelease" k; psemver_setvar versionk k nextvs=( "$versionx : maj incompatibles de l'API (-x)" "$versionz : maj compatibles de l'API (-z)" "$versionp : correction de bugs (-p)" + "$versionk : ne pas incrémenter la version" ) nextv="${nextvs[1]}" simple_menu nextv nextvs \ @@ -261,6 +269,7 @@ elif [ "$action" == update ]; then *-x) incversion=major;; *-z) incversion=minor;; *-p) incversion=patchlevel;; + *) incversion=;; esac fi case "$incversion" in