Skip to content

Commit

Permalink
Bugfix in changelog generator (#28)
Browse files Browse the repository at this point in the history
Now changlog will also be generated if master is rebuilt without
changes.
  • Loading branch information
midstar committed Feb 25, 2020
1 parent 818c519 commit 9a22d45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/debian_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ gzip -n --best $PKG_ROOT_PATH/usr/share/man/man1/mediaweb.1

# Create changelog
export CHANGELOG=$PKG_ROOT_PATH/usr/share/doc/mediaweb/changelog
sh $SCRIPT_PATH/generate_changelog.sh mediaweb $VERSION mediaweb-v $CHANGELOG
sh $SCRIPT_PATH/generate_changelog.sh mediaweb $VERSION $CHANGELOG
gzip -n --best $CHANGELOG

# Calculate size of root directory
Expand Down
10 changes: 4 additions & 6 deletions scripts/generate_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ set -e
print_usage() {
echo "Usage:"
echo
echo " sudo sh generate_changelong.sh <modulename> <version> <tagprefix> <outfile>"
echo " sudo sh generate_changelong.sh <modulename> <version> <outfile>"
echo
exit 1
}

if [ "$#" -ne 4 ]; then
if [ "$#" -ne 3 ]; then
echo "Error! Invalid number of parameters"
print_usage
fi

export MODULE=$1
export VERSION=$2
export TAGPREFIX=$3
export OUTFILE=$4
export LAST_TAG=`git tag -l ${TAGPREFIX}* | sort -V | tail -1`
export OUTFILE=$3

echo "$MODULE ($VERSION) unstable; urgency=low\n" > $OUTFILE;
git log --pretty=format:' * %s' $LAST_TAG..HEAD >> $OUTFILE;
git log --pretty=format:' * %s' HEAD^..HEAD >> $OUTFILE;
git log --pretty='format:%n%n -- %aN <%aE> %aD%n%n' HEAD^..HEAD >> $OUTFILE

0 comments on commit 9a22d45

Please sign in to comment.