-git-buildpackage --git-debian-branch="$(git branch | awk -F\*\ '/^* / { print $2}' )" --git-ignore-new $*
-printf "Finished execution of $(basename $0). Do not forget to tag release ${debian_version}\n"
+if [ -n "${AUTOBUILD:-}" ] ; then
+ [ -d ../grml-live.build-area ] || mkdir ../grml-live.build-area
+ rm -rf ../grml-live.build-area/grml-live* # otherwise we're keeping files forever...
+ git-buildpackage --git-ignore-branch --git-ignore-new --git-export-dir=../grml-live.build-area -us -uc
+else
+ git-buildpackage --git-ignore-branch --git-ignore-new $*
+ printf "Finished execution of $(basename $0). Do not forget to tag release ${debian_version}\n"
+fi
+
+if [ -n "${AUTOBUILD:-}" ] ; then
+ (
+ cd ../grml-live.build-area
+ dpkg-scanpackages . /dev/null > Packages
+ dpkg-scanpackages . /dev/null | gzip > Packages.gz
+ )
+ git checkout master
+ git branch -D ${autobuild_branch} || true
+
+ env APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none sudo apt-get update
+
+ PACKAGES=$(dpkg --list grml-live\* | awk '/^ii/ {print $2}')
+ env APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none sudo apt-get -y \
+ -o DPkg::Options::=--force-confmiss \
+ -o DPkg::Options::=--force-confnew \
+ --allow-unauthenticated install $PACKAGES
+fi