aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-05 11:08:03 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-05 11:08:03 +0100
commit2ad4f0abc90c2017041f4734f31fc3ffe9610188 (patch)
treed4df31637867482d40dc59117610b3f43413fc3a
parentd4f37febf7793c0b2b328203f1f85ab51b8fe8ad (diff)
downloadrspamd-2ad4f0abc90c2017041f4734f31fc3ffe9610188.tar.gz
rspamd-2ad4f0abc90c2017041f4734f31fc3ffe9610188.zip
Add a simple distribution script.
-rwxr-xr-xdist.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/dist.sh b/dist.sh
new file mode 100755
index 000000000..c8b201e3d
--- /dev/null
+++ b/dist.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+if [ $# -ne 1 ] ; then
+ echo "Usage: dist.sh <filename>"
+ 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