@@ -30,21 +30,26 @@ cd $package
3030# check versions
3131VERSION=$( cat libyang.spec | grep " Version: " | awk ' {print $NF}' )
3232OLDVERSION=$( cat ../libyang.spec | grep " Version: " | awk ' {print $NF}' )
33- if [ " $VERSION " == " $OLDVERSION " ]; then
33+ if [ -z " $FORCEVERSION " -a " $VERSION " == " $OLDVERSION " ]; then
3434 exit 0
3535fi
3636
3737# create new changelog and paste old changelog
38- logtime=$( git log -i --grep=" VERSION .* $OLDVERSION " | grep " Date: " | sed ' s/Date:[ ]*//' )
39- echo -e " $name ($VERSION ) stable; urgency=low\n" > debian.changelog
40- git log --since=" $logtime " --pretty=format:" * %s (%aN)%n" | grep " BUGFIX\|CHANGE\|FEATURE" >> debian.changelog
41- git log -1 --pretty=format:" %n -- %aN <%aE> %aD%n" >> debian.changelog
42- echo -e " \n" >> debian.changelog
38+ if [ " $VERSION " != " $OLDVERSION " ]; then
39+ logtime=$( git log -i --grep=" VERSION .* $OLDVERSION " | grep " Date: " | sed ' s/Date:[ ]*//' )
40+ echo -e " $name ($VERSION ) stable; urgency=low\n" > debian.changelog
41+ git log --since=" $logtime " --pretty=format:" * %s (%aN)%n" | grep " BUGFIX\|CHANGE\|FEATURE" >> debian.changelog
42+ git log -1 --pretty=format:" %n -- %aN <%aE> %aD%n" >> debian.changelog
43+ echo -e " \n" >> debian.changelog
44+ fi
4345cat ../debian.changelog >> debian.changelog
44- git log -1 --date=format:' %a %b %d %Y' --pretty=format:" * %ad %aN <%aE>" | tr -d " \n" >> libyang.spec
45- echo " $VERSION " >> libyang.spec
46- git log --since=" $logtime " --pretty=format:" - %s (%aN)" | grep " BUGFIX\|CHANGE\|FEATURE" >> libyang.spec
47- echo -e " \n" >> libyang.spec
46+
47+ if [ " $VERSION " != " $OLDVERSION " ]; then
48+ git log -1 --date=format:' %a %b %d %Y' --pretty=format:" * %ad %aN <%aE>" | tr -d " \n" >> libyang.spec
49+ echo " $VERSION " >> libyang.spec
50+ git log --since=" $logtime " --pretty=format:" - %s (%aN)" | grep " BUGFIX\|CHANGE\|FEATURE" >> libyang.spec
51+ echo -e " \n" >> libyang.spec
52+ fi
4853cat ../libyang.spec | sed -e ' 1,/%changelog/d' >> libyang.spec
4954
5055# download source and update to opensuse build
0 commit comments