[Pkg-securepass-commits] [SCM] mod-authz-securepass/master: Add get-git-source.sh

alessio at users.alioth.debian.org alessio at users.alioth.debian.org
Fri Jun 5 15:56:46 UTC 2015


The following commit has been merged in the master branch:
commit 487c8d728224b4f48f15a4a0a75c5c10a0adab15
Author: Alessio Treglia <alessio.treglia at smartodds.co.uk>
Date:   Fri Jun 5 16:55:39 2015 +0100

    Add get-git-source.sh
    
    Such script can be used to generate an upstream tarball from
    the upstream's git repository latest commit.

diff --git a/debian/get-git-source.sh b/debian/get-git-source.sh
new file mode 100755
index 0000000..594b367
--- /dev/null
+++ b/debian/get-git-source.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+PACKAGE=$(dpkg-parsechangelog | sed -ne 's/Source: \(.*\)/\1/p')
+BASE_REL=$(dpkg-parsechangelog 2>/dev/null | sed -ne 's/Version: \([0-9.]\+\)+\?.*/\1/p')
+UPSTREAM_GIT="https://github.com/garlsecurity/mod_authz_securepass"
+VERSION_SEP='~'
+
+if [ -z ${BASE_REL} ]; then
+	echo 'Please run this script from the sources root directory.'
+	exit 1
+fi
+
+echo "Fetching latest upstream code into FETCH_HEAD"
+git fetch $UPSTREAM_GIT
+
+GIT_COMMIT=`git describe --always FETCH_HEAD`
+GIT_DATE=`git --no-pager log -1 --pretty=format:%cd --date=short FETCH_HEAD | sed s/-//g`
+TARBALL="../${PACKAGE}_${BASE_REL}${VERSION_SEP}${GIT_DATE}.git${GIT_COMMIT}.orig.tar.gz"
+
+git archive --format=tar --prefix="${PACKAGE}"-"${GIT_DATE}/" HEAD | \
+	gzip -9fn > "$TARBALL"
+
+echo "Suchessfully created $TARBALL"

-- 
mod-authz-securepass packaging



More information about the Pkg-securepass-commits mailing list