From: Michael Andres Date: Thu, 12 Dec 2013 16:58:18 +0000 (+0100) Subject: mkChangelog new version convenience X-Git-Tag: upstream/14.27.0~193 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Flibzypp.git;a=commitdiff_plain;h=faa5e5b06972ae070649be9e7ad5aabdbc66400a mkChangelog new version convenience --- diff --git a/mkChangelog b/mkChangelog index e06c883..0e94c4e 100755 --- a/mkChangelog +++ b/mkChangelog @@ -84,10 +84,18 @@ function getversion() { printf "LAST_COMPAT='%s'\n", lastcompat printf "THIS_RELEASE='%s'\n", major"."minor"."patch printf "THIS_COMPAT='%s'\n", compatminor + printf "THIS_MINOR='%s'\n", minor + printf "THIS_PATCH='%s'\n", patch } ' } +function setversion() { + local KEY="$1" + local VAL="$2" + sed -i "s/^ *SET *( *${KEY} .*/SET(${KEY} \"${VAL}\")/" "$VERSIONFILE" +} + function sameVersion() { test "$LAST_RELEASE" == "$THIS_RELEASE" -a "$LAST_COMPAT" == "$THIS_COMPAT" } @@ -153,9 +161,9 @@ while true; do sameVersion && { newchangesentry Becho "!!! Version is unchanged at $LAST_RELEASE ($LAST_COMPAT)." - read -n 1 -p "$(Gecho "(a)bort, (c)ontinue, (e)dit version [e]: ")" RES + read -n 1 -p "$(Gecho "(a)bort, (c)ontinue, (P) patch, (M) minor, (I) incompat minor, (e)dit version [e]: ")" RES echo - case "${RES:-e}" in + case "${RES:-x}" in [eE]*) $EDITOR $VERSIONFILE eval $(getversion) @@ -165,6 +173,24 @@ while true; do Becho "!!! Leave $VERSIONFILE untouched" break ;; + [P]) + setversion LIBZYPP_PATCH $(($THIS_PATCH + 1)) + eval $(getversion) + continue + ;; + [M]) + setversion LIBZYPP_MINOR $(($THIS_MINOR + 1)) + setversion LIBZYPP_PATCH 0 + eval $(getversion) + continue + ;; + [I]) + setversion LIBZYPP_COMPATMINOR $(($THIS_MINOR + 1)) + setversion LIBZYPP_MINOR $(($THIS_MINOR + 1)) + setversion LIBZYPP_PATCH 0 + eval $(getversion) + continue + ;; *) errexit "aborted" ;;