2 # Filename: scripts/release_helper.sh
3 # Purpose: helper script to build grml-live Debian packages (WFM style though)
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
15 if git status --porcelain | grep -q '^?? '; then
16 printf "Uncommited changes in current working tree. Please commit/clean up.\n"
20 printf "Building debian/changelog: "
21 git-dch --debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" \
22 --since=v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}') \
23 --id-length=7 --meta --multimaint-merge -S
26 $EDITOR debian/changelog
28 debian_version="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')"
31 if echo "$debian_version" | grep -q '\.gbp' ; then
32 printf "Building snapshot version, not releasing.\n"
36 printf "Updating GRML_LIVE_VERSION string in grml-live script: "
37 sed -i "s/^GRML_LIVE_VERSION=.*/GRML_LIVE_VERSION='$debian_version'/" grml-live
40 printf "Comparing versions of debian/changelog with grml-live version string: "
41 script_version="$(awk -F= '/^GRML_LIVE_VERSION=/ {print $2}' grml-live | sed "s/'//g")"
42 debian_version="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')"
44 if [[ "$script_version" == "$debian_version" ]] ; then
48 printf "Debian package version ($debian_version) does not match script version ($script_version).\n"
53 git add debian/changelog grml-live
54 git commit -s -m "Release new version ${debian_version}."
57 printf "Building debian packages:\n"
58 git-buildpackage --git-debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" --git-ignore-new
59 printf "Finished execution of $(basename $0). Do not forget to tag release ${debian_version}\n"
61 ## END OF FILE #################################################################