From: Adam Sutton Date: Wed, 7 Nov 2012 11:40:40 +0000 (+0000) Subject: Tarball generation script. X-Git-Tag: v3.5~294^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddad1d21dcd64e5d51dc24c46a4f7ec24f0673b1;p=thirdparty%2Ftvheadend.git Tarball generation script. --- diff --git a/support/tarball b/support/tarball new file mode 100755 index 000000000..ca65b6646 --- /dev/null +++ b/support/tarball @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Build tarball of the current directory +# + +# Exit +function die +{ + echo "ERROR: $*" + exit 1 +} + +# Switch dir +SRCDIR=$(dirname $0)/.. +cd $SRCDIR + +# Arguments +REL=$1 +if [ ! -z "$REL" ]; then + git checkout $REL || die "could not checkout $REL" +fi + +# Clean +git checkout . || die "could not clean git tree" + +# Version +VER=$(./support/version) +echo $VER | grep -q dirty && die "git tree is not clean" +VER1=$(echo $VER | sed 's/~.*//') +echo $VER1 + +# Temp directory +TMPDIR=/tmp/tvhtar-$$ +mkdir -p $TMPDIR +trap "rm -rf $TMPDIR" EXIT + +# Copy +DSTDIR=$TMPDIR/tvheadend-$VER1 +mkdir $DSTDIR +git archive HEAD | tar -x -C $DSTDIR + +# Remove stuff we don't need +rm -rf $DSTDIR/.gitignore + +# Fix changelog (store version) +$DSTDIR/support/changelog $DSTDIR/debian/changelog "" $VER + +# Build tarball +TARFILE=$(cd $SRCDIR/..; pwd)/tvheadend-$VER1.tar.gz +tar -C $TMPDIR -zcf $TARFILE tvheadend-$VER1 + +# Done +echo "Created $TARFILE"