From: Mike Taylor Date: Tue, 10 Aug 2010 16:39:28 +0000 (+0100) Subject: New file, copied from $GIT/torus/mkdist.sh, which has evolved to X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=a6e87710f24e27778d8494f60c7815f4a87da8b0;p=git-tools-moved-to-github.git New file, copied from $GIT/torus/mkdist.sh, which has evolved to become generic and configurable. --- diff --git a/id-deb-build/mkdist.sh b/id-deb-build/mkdist.sh new file mode 100755 index 0000000..925d249 --- /dev/null +++ b/id-deb-build/mkdist.sh @@ -0,0 +1,49 @@ +die () { + echo >&2 "$@" + exit 1 +} + +if test -f IDMETA; then + . ./IDMETA +else + echo "Warning: no IDMETA file. Limping along anyway" >&2 +fi + +#we will keep this to get the project name +DEBCHANGELOG=debian/changelog +l=`head -1 $DEBCHANGELOG` + +if [ "x$NAME" != x ]; then + echo "Got name $NAME from IDMETA file" +else + NAME=`echo $l|sed 's/ .*//g'` + echo "Warning: assuming name $NAME from debian/changelog" +fi + +if [ "x$2" != x ]; then + echo "Overriding name $NAME with $2" + NAME=$2 +fi + +if [ "x$VERSION" != x ]; then + echo "Got version $VERSION from IDMETA file" +else + FULLVERSION=`echo $l|sed 's/.*(//g'|sed 's/).*//g'` + VERSION=`echo $FULLVERSION|sed 's/-.*//g'` + echo "Warning: assuming version $VERSION from debian/changelog" +fi + +if [ "x$1" != x ]; then + echo "Overriding version $VERSION with $1" + VERSION=$1 +fi + +git archive --format=tar --prefix=$NAME-$VERSION/ v${VERSION} > tmp.tar || die "This version is not tagged in Git"; +tar xf tmp.tar +rm tmp.tar +for file in debian $OMIT_FROM_DIST; do + echo "Omitting $file from distribution" + rm -r $NAME-$VERSION/$file +done +tar cfz $NAME-$VERSION.tar.gz $NAME-$VERSION +rm -r $NAME-$VERSION