diff options
author | Christian Ruppert <idl0r@gentoo.org> | 2014-01-19 16:35:06 +0100 |
---|---|---|
committer | Christian Ruppert <idl0r@gentoo.org> | 2014-01-19 16:35:06 +0100 |
commit | c5f970565e667fa470f0d95b88f7aae84c488032 (patch) | |
tree | f6594ac46ceb7571860560e142c53e347e522e07 /dist.sh | |
parent | Some notes about Git (diff) | |
download | gitolite-gentoo-c5f970565e667fa470f0d95b88f7aae84c488032.tar.gz gitolite-gentoo-c5f970565e667fa470f0d95b88f7aae84c488032.tar.bz2 gitolite-gentoo-c5f970565e667fa470f0d95b88f7aae84c488032.zip |
Add dist.sh
Diffstat (limited to 'dist.sh')
-rwxr-xr-x | dist.sh | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -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 |