set -x # echo commands executed
# change version in changelog
-git-dch -a --ignore-branch
-# we now what we're doing and we don't want an editor.….
-echo | EDITOR=true dch -D ${DISTRIBUTION} --newversion ${VERSION} --no-force-save-on-release --force-distribution --force-bad-version
+git-dch -a --ignore-branch --no-full --no-meta --id-length=7
+# replace first version (enclosed in brackets) with real version
+sed -i "0,/(.*)/s//($VERSION)/" debian/changelog
+# replace first UNRELEASED with $DISTRIBUTION
+sed -i "0,/UNRELEASED/s//$DISTRIBUTION/" debian/changelog
# build debian package (just binary, no source package)
dpkg-buildpackage -us -uc -b