aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2014-01-19 16:35:06 +0100
committerChristian Ruppert <idl0r@gentoo.org>2014-01-19 16:35:06 +0100
commitc5f970565e667fa470f0d95b88f7aae84c488032 (patch)
treef6594ac46ceb7571860560e142c53e347e522e07 /dist.sh
parentSome notes about Git (diff)
downloadgitolite-gentoo-c5f970565e667fa470f0d95b88f7aae84c488032.tar.gz
gitolite-gentoo-c5f970565e667fa470f0d95b88f7aae84c488032.tar.bz2
gitolite-gentoo-c5f970565e667fa470f0d95b88f7aae84c488032.zip
Add dist.sh
Diffstat (limited to 'dist.sh')
-rwxr-xr-xdist.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/dist.sh b/dist.sh
new file mode 100755
index 0000000..5a4be36
--- /dev/null
+++ b/dist.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+branch=$(git rev-parse --abbrev-ref HEAD)
+
+if [ "${branch}" = "master-g2" ]; then
+ # GL2
+ export GL_BINDIR="$(pwd)/src"
+ export GL_RC="$(pwd)/conf/example.gitolite.rc"
+
+ dirs="conf/ hooks/ src/"
+else
+ # GL3
+ export GL_LIBDIR="$(pwd)/src"
+
+ dirs="src/"
+ perl_opts="-Isrc/lib/"
+fi
+
+if [ -z "${1}" ]; then
+ tag=$(git tag | grep '^gitolite-gentoo-.*$' | sort -r | head -n 1)
+else
+ tag=$1
+fi
+
+for foo in $(find ${dirs} -type f); do
+ [ "${foo:$((${#foo}-3))}" = ".pm" ] && { perl $perl_opts -c $foo; continue; }
+ [ -n "$(grep -m 1 '^#!/usr/bin/perl' $foo)" ] && { perl $perl_opts -c $foo; continue; }
+done
+
+git archive --prefix=${tag}/ --format tar $branch > ${tag}.tar
+bzip2 -9 ${tag}.tar