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 if ! $EDITOR debian/changelog ; then
27 printf "Exiting as editing debian/changelog returned an error." >&2
31 debian_version="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')"
34 if echo "$debian_version" | grep -q '\.gbp' ; then
35 printf "Building snapshot version, not releasing.\n"
39 printf "Updating GRML_LIVE_VERSION string in grml-live script: "
40 sed -i "s/^GRML_LIVE_VERSION=.*/GRML_LIVE_VERSION='$debian_version'/" grml-live
43 printf "Comparing versions of debian/changelog with grml-live version string: "
44 script_version="$(awk -F= '/^GRML_LIVE_VERSION=/ {print $2}' grml-live | sed "s/'//g")"
45 debian_version="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')"
47 if [[ "$script_version" == "$debian_version" ]] ; then
51 printf "Debian package version ($debian_version) does not match script version ($script_version).\n"
56 git add debian/changelog grml-live
57 git commit -s -m "Release new version ${debian_version}."
60 printf "Building debian packages:\n"
61 git-buildpackage --git-debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" --git-ignore-new $*
62 printf "Finished execution of $(basename $0). Do not forget to tag release ${debian_version}\n"
64 ## END OF FILE #################################################################