From: Vsevolod Stakhov Date: Fri, 5 Sep 2014 10:08:03 +0000 (+0100) Subject: Add a simple distribution script. X-Git-Tag: 0.7.0~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ad4f0abc90c2017041f4734f31fc3ffe9610188;p=thirdparty%2Frspamd.git Add a simple distribution script. --- diff --git a/dist.sh b/dist.sh new file mode 100755 index 0000000000..c8b201e3d5 --- /dev/null +++ b/dist.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +if [ $# -ne 1 ] ; then + echo "Usage: dist.sh " + exit 1 +fi + +FNAME=shift +PREFIX=`basename $FNAME | sed -e 's/\.tar.*$//'` + +OUT="" +while true ; do + OUT="/tmp/files-`strings -7 /dev/urandom | head -1 | sed -e 's/[^[:alnum:]]//g'`" + if [ ! -f "$OUT" ] ; then break ; fi +done + +git ls-files > $OUT +SUBMODULES=`git submodule | cut -d ' ' -f 3` + +for sub in $SUBMODULES ; do + (cd $sub && git ls-files | sed -e "s|^|$sub/|" >> $OUT) +done + +tar -c --no-recursion --transform "s|^|$PREFIX/|" -a -T $OUT -v -f $FNAME +rm -f $OUT