From f2a5e8b142ddfdcfc311f5c7d28f7b7cd830abf8 Mon Sep 17 00:00:00 2001 From: lars Date: Tue, 5 Dec 2006 19:48:15 +0000 Subject: [PATCH] added a policy for creating and uploading a debian package check debian changelog version before creating a debian package --- make-deb.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/make-deb.sh b/make-deb.sh index b1ac5b7..092b385 100755 --- a/make-deb.sh +++ b/make-deb.sh @@ -5,12 +5,30 @@ set -eu PRJ_ROOT=$(dirname $(cd "$(dirname $0)"; pwd)) PREFIX=cryptobox + +get_debian_version() +# compare the given version with the one from debian/changelog +{ + head -1 "$SRC_DIR/debian/changelog" | cut -f 2 -d "(" | cut -f 1 -d "-" +} + + [ $# -lt 1 -o $# -gt 2 ] && echo "Syntax: `basename $0` VERSION {PATH}" && echo && exit 1 REL_SRC_DIR=${PREFIX}-${1} [ $# -eq 2 ] && REL_SRC_DIR=$2 SRC_DIR=$(cd "$(pwd)/$REL_SRC_DIR"; pwd) [ ! -d "$SRC_DIR" ] && echo "the directory '$REL_SRC_DIR' does not exist!" && exit 2 +deb_version=$(get_debian_version) +if test "$1" = "$deb_version" + then true + else echo "The version number you specified ($1) was not equal to the current debian changelog version ($deb_version)!" + echo "Run 'debchange -i' to create a new changelog entry." + echo + exit 3 + fi + + # create the tar file "$(dirname $0)/make-tar.sh" "$@"