39 lines
1,018 B
Bash
Executable file
39 lines
1,018 B
Bash
Executable file
#!/bin/bash
|
|
set -x
|
|
|
|
if [ ! -d debian -o ! -d base -o ! -d testsuite ]; then
|
|
echo "this script must be run from the root of the source tree (the directory with debian and src in it)"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
GIT_TAG=$(git describe --tags | sed -re 's/-[^-]+-[^-]+$//')
|
|
GIT_VERSION=$(git describe --tags | sed -e 's/-test/~test/')
|
|
if [ $? -ne 0 ]; then
|
|
echo "error determining version!"
|
|
exit 1
|
|
fi
|
|
|
|
DEB_VERSION=`git show HEAD:debian/changelog | head -1 | sed 's/.*(\(.*\)).*/\1/'`
|
|
|
|
NEW_DEB_VERSION=$(echo $GIT_VERSION | sed -r 's/-pre/~pre/; s/-/./g')
|
|
|
|
if [ "$NEW_DEB_VERSION" = "$DEB_VERSION" ]; then
|
|
echo "no changes since the version at the top of the debian/changelog file"
|
|
echo "not modifying debian/changelog"
|
|
exit 0
|
|
fi
|
|
|
|
set -e
|
|
(
|
|
echo "rtai ($NEW_DEB_VERSION) $(lsb_release -cs); urgency=low"
|
|
echo
|
|
git log --pretty=format:" * %w(72,0,6)%s" $GIT_TAG..
|
|
echo
|
|
echo
|
|
echo " -- buildbot <buildbot@example.com> $(date -R)"
|
|
echo
|
|
git show HEAD:debian/changelog
|
|
) > debian/changelog
|
|
|
|
dch -r --nomultimaint ""
|