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 [ -n "${AUTOBUILD:-}" ] ; then
16 git checkout autobuild # has to exist
18 if git status --porcelain | grep -q '^?? '; then
19 printf "Uncommited changes in current working tree. Please commit/clean up.\n"
24 if [ -n "${AUTOBUILD:-}" ] ; then
25 since=$(git show -s --pretty="tformat:%h")
27 since=v$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')
30 printf "Building debian/changelog: "
31 git-dch --ignore-branch --since=$since \
32 --id-length=7 --meta --multimaint-merge -S
35 if [ -z "${AUTOBUILD:-}" ] ; then
36 if ! $EDITOR debian/changelog ; then
37 printf "Exiting as editing debian/changelog returned an error." >&2
42 debian_version="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')"
45 if echo "$debian_version" | grep -q '\.gbp' ; then
46 printf "Building snapshot version, not releasing.\n"
50 printf "Updating GRML_LIVE_VERSION string in grml-live script: "
51 sed -i "s/^GRML_LIVE_VERSION=.*/GRML_LIVE_VERSION='$debian_version'/" grml-live
54 printf "Comparing versions of debian/changelog with grml-live version string: "
55 script_version="$(awk -F= '/^GRML_LIVE_VERSION=/ {print $2}' grml-live | sed "s/'//g")"
56 debian_version="$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')"
58 if [[ "$script_version" == "$debian_version" ]] ; then
62 printf "Debian package version ($debian_version) does not match script version ($script_version).\n"
66 if $dorelease || [ -n "${AUTOBUILD:-}" ] ; then
67 git add debian/changelog grml-live
68 git commit -s -m "Release new version ${debian_version}."
71 printf "Building debian packages:\n"
72 if [ -n "${AUTOBUILD:-}" ] ; then
73 [ -d ../grml-live.build-area ] || mkdir ../grml-live.build-area
74 git-buildpackage --git-ignore-branch --git-ignore-new --git-export-dir=../grml-live.build-area -us -uc
76 git-buildpackage --git-ignore-branch --git-ignore-new $*
77 printf "Finished execution of $(basename $0). Do not forget to tag release ${debian_version}\n"
80 if [ -n "${AUTOBUILD:-}" ] ; then
82 cd ../grml-live.build-area
83 dpkg-scanpackages . /dev/null > Packages
86 PACKAGES=$(dpkg --list grml-live\* | awk '/^ii/ {print $2}')
87 apt-get -y --allow-unauthenticated install $PACKAGES
90 ## END OF FILE #################################################################