From: Michael Andres Date: Thu, 31 Jul 2008 10:26:44 +0000 (+0000) Subject: mkChangelog: show current version and last changelog entry as summary X-Git-Tag: BASE-SuSE-Code-11-Branch~551 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Flibzypp.git;a=commitdiff_plain;h=8e1733493239d2cd1fadadfd9840bbf2c4e6a408 mkChangelog: show current version and last changelog entry as summary --- diff --git a/mkChangelog b/mkChangelog index e964567..05cb5ba 100755 --- a/mkChangelog +++ b/mkChangelog @@ -13,12 +13,13 @@ EDITOR=${EDITOR:-vi} TDIR=$(dirname $0) test -n "$TDIR" && cd $TDIR -CHANGESFILE="package/libzypp.changes" +CHANGESFILE=$(ls package/*.changes) test -f "$CHANGESFILE" || errexit "No changes file '$CHANGESFILE'" VERSIONFILE="VERSION.cmake" test -f "$VERSIONFILE" || errexit "No version file '$VERSIONFILE'" +## Version.cmake tags in getversion() are still zypp specific. function usage() { exec >&2 @@ -44,7 +45,7 @@ SVN shortly after editing (current server revision + 1). The line '#---delete-or-release---#...' shows the last version submitted to autobuild ('# LAST RELEASED:; tag in $VERSIONFILE). And also the current version, asuming you already updated the $VERSIONFILE according to your changes. -(The number in parenthesis is LIBZYPP_COMPATMINOR) +(The number in parenthesis is _COMPATMINOR) - Delete the line if you don't want to submit the package to autobuild. @@ -111,11 +112,11 @@ function nextrevision() { | awk '/^Status against revision:/{print $4+1}' } -VERSIONNUMBER="$(getversion)" test -r /etc/sysconfig/mail && source /etc/sysconfig/mail EMAIL="${USER}@${FROM_HEADER:-$(hostname -f)}" +GOTVERSION="$(getversion)" TMPFILE=$(mktemp) exec 3>&1- @@ -125,7 +126,7 @@ echo "$(date) $EMAIL" echo "" echo "- " echo "- revision $(nextrevision)" -echo "$(getversion)" +echo "$GOTVERSION" echo "" cat $CHANGESFILE exec >&3 @@ -138,6 +139,7 @@ while [ "$RES" == "e" ]; do test -n "$NEWREL" && echo "$NEWREL" read -n 1 -p "(a)bort, (c)ontinue, (e)dit : " RES echo + echo case "$RES" in [eE]*) RES=e @@ -153,8 +155,9 @@ while [ "$RES" == "e" ]; do echo "Store new $CHANGESFILE" cp $TMPFILE $CHANGESFILE - cat $CHANGESFILE \ - | awk '{print}/----------/{n=n+1; if ( n == 2 ) exit 0; }' + echo "$(sed 's/^.*#---delete-or-release---#.*RELEASE:/# CURRENT RELEASE:/' <<<"$GOTVERSION")" + awk '{print}/^----------/{n=n+1; if ( n == 2 ) exit 0; }' $CHANGESFILE + ;; *) echo "Leave $CHANGESFILE untouched"