summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <bugzilla@tut.by>2013-04-12 19:53:59 +0200
committerAndrew Shadura <bugzilla@tut.by>2013-04-12 19:53:59 +0200
commit7bf924557a38b80ff4abe773fc93421f59bc41ef (patch)
tree89cd91045d3178555ecf4e16d616667745bf0b7b
parent75d94a3e93703a14102ab5cef904726390ac69cc (diff)
Add get-orig-source.
-rwxr-xr-xdebian/get-orig-source.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/debian/get-orig-source.sh b/debian/get-orig-source.sh
new file mode 100755
index 0000000..d90c907
--- /dev/null
+++ b/debian/get-orig-source.sh
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+TARBALLDIR=${1:-.}
+UPSTREAM_REPO=https://code.google.com/p/wmii/
+PACKAGE=wmii
+SRC_VERSION=$(dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
+SRC_REVISION=${SRC_VERSION##*hg}
+TARBALL=$(readlink -f "$TARBALLDIR/${PACKAGE}_${SRC_VERSION}.orig.tar.bz2")
+REPODIR="debian/orig-source/${PACKAGE}-${SRC_VERSION}.orig"
+if [ -e "$REPODIR" ]
+then
+ echo "$REPODIR directory found, not removing. Aborted."
+ exit 1
+fi
+mkdir -p debian/orig-source
+echo "Cloning ${UPSTREAM_REPO}"
+hg clone "${UPSTREAM_REPO}" "$REPODIR" || exit 1
+echo "Creating ${TARBALL} for revision $SRC_REVISION"
+cd "$REPODIR"
+hg archive -r "$SRC_REVISION" -X".hg*" "${TARBALL}" || exit 1
+cd "$OLDPWD"
+rm -rf debian/orig-source
+