From 0d2b1ec88507456c4d4ae88e66b14d1713002693 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 23 Jul 2013 15:05:24 +0200 Subject: [PATCH] add debian_wrap_maven_results.sh as taken from Szymon from vdc-bundles.git, branch feature/debian --- debian_wrap_maven_results.sh | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100755 debian_wrap_maven_results.sh diff --git a/debian_wrap_maven_results.sh b/debian_wrap_maven_results.sh new file mode 100755 index 0000000..4d20968 --- /dev/null +++ b/debian_wrap_maven_results.sh @@ -0,0 +1,82 @@ +#!/bin/bash +DISTRIBUTION=$1 +VERSION=$2 +COMMENT=$3 +SCRIPTNAME=${0##*/} + +function cleanup { + echo cleaning up ... + + # revert changelog changes + git checkout -- debian/changelog + + # remove files created by debian build + git clean -fd debian + + echo cleaup done +} + +function failIfFailed +{ + echo executing: \'$@\' ... + $@ + RET_CODE=$? + if [[ "${RET_CODE}" != "0" ]] + then + echo command \'$@\' failed + cleanup + exit 4 + + fi + echo done +} + +function usage +{ + echo 'Usage:' ${SCRIPTNAME} ' ' + exit $1 +} + +function validateInput +{ + if [[ -z "${DISTRIBUTION}" ]] + then + echo "Need to specify distribution" + usage 1 + fi + + if [[ -z "${VERSION}" ]] + then + echo "Need to specify version" + usage 2 + fi + + if [[ -z "${COMMENT}" ]] + then + echo "Need to specify Comment" + usage 3 + fi + +} + +function goUp +{ + cd .. +} + +goUp + +validateInput + +# change version in changelog +failIfFailed dch -D${DISTRIBUTION} -v ${VERSION} ${COMMENT} + + +#build debian package +failIfFailed dpkg-buildpackage -us -uc + +# upload to reprepro +# TODO: implement + +cleanup + -- 2.39.5