Commit e8abf5c3 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmlog: add -e option support for just increment and add empty changelog entry

parent 4713d390
#!/bin/sh #!/bin/sh
# 2010, 2012 (c) Etersoft http://etersoft.ru # 2010, 2012, 2013 (c) Etersoft http://etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru> # Author: Vitaly Lipatov <lav@etersoft.ru>
# Script for update changelog or increment release # Script for update changelog or increment release
...@@ -18,12 +18,15 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then ...@@ -18,12 +18,15 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echog " -r increment release" echog " -r increment release"
echog " -s increment subrelease" echog " -s increment subrelease"
echog " -l add changelog from git log (since last release tag or TAG)" echog " -l add changelog from git log (since last release tag or TAG)"
echog " -e increment and add empty changelog entry"
echo echo
echog "Ext. options:" echog "Ext. options:"
echog " -t test run (without change files and repo)" echog " -t test run (without change files and repo)"
echo echo
echog "Example:" echog "Example:"
echog " $ rpmlog -v -l - typical build new version" echog " $ rpmlog -v -l - typical build new version"
echog " $ rpmlog -r -l HEAD~2 - build new version with last two commit message as changelog"
echog " $ rpmlog -r -e - prepare new version build with empty changelog entry"
exit 0 exit 0
fi fi
...@@ -41,6 +44,12 @@ if [ "$1" = "-l" ] ; then ...@@ -41,6 +44,12 @@ if [ "$1" = "-l" ] ; then
shift shift
fi fi
CHANGELOGADD=
if [ "$1" = "-e" ] ; then
CHANGELOGADD=$1
shift
fi
TESTRUN= TESTRUN=
if [ "$1" = "-t" ] ; then if [ "$1" = "-t" ] ; then
TESTRUN=$1 TESTRUN=$1
...@@ -71,7 +80,7 @@ if [ ! -r "$SPECNAME" ] ; then ...@@ -71,7 +80,7 @@ if [ ! -r "$SPECNAME" ] ; then
fatal "Spec $SPECNAME does not found" fatal "Spec $SPECNAME does not found"
fi fi
[ -n "$CHANGELOGUPDATE$TESTRUN" ] || fatal "Run with -t param for test or with -h for help" [ -n "$CHANGELOGADD$CHANGELOGUPDATE$TESTRUN" ] || fatal "Run with -t param for test or with -h for help"
if [ -z "$FROMTAG" ] ; then if [ -z "$FROMTAG" ] ; then
build_rpms_name $SPECNAME build_rpms_name $SPECNAME
...@@ -81,10 +90,14 @@ if [ -z "$FROMTAG" ] ; then ...@@ -81,10 +90,14 @@ if [ -z "$FROMTAG" ] ; then
# FIXME: if don't exists, use last tag? # FIXME: if don't exists, use last tag?
fi fi
if [ -n "$CHANGELOGADD" ] ; then
CHANGELOG="- "
else
# TODO: найти параметр для упрощения истории. пока - sort? # TODO: найти параметр для упрощения истории. пока - sort?
# Делает первую букву маленькой, убирает точку в конце строки # Делает первую букву маленькой, убирает точку в конце строки
CHANGELOG="`git log $FROMTAG..$TOTAG --reverse --simplify-merges --dense --pretty="- %s" | sed -e "s|\.\$||g" | sed -e "s|- \([A-Z]\)|- \l\1|g" | sed -e "s|%||g"`" CHANGELOG="`git log $FROMTAG..$TOTAG --reverse --simplify-merges --dense --pretty="- %s" | sed -e "s|\.\$||g" | sed -e "s|- \([A-Z]\)|- \l\1|g" | sed -e "s|%||g"`"
[ -n "$CHANGELOG" ] || fatal "git log was failed" [ -n "$CHANGELOG" ] || fatal "git log was failed"
fi
if [ -n "$TESTRUN" ] ; then if [ -n "$TESTRUN" ] ; then
INCREMENTMODE="" INCREMENTMODE=""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment