[zoo-project] 02/23: Add get-orig-source script for SVN snapshots.

Bas Couwenberg sebastic at debian.org
Sun Jun 26 17:27:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository zoo-project.

commit 2fd10446809bd0320be726090e84ec3283614c18
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sat Jun 25 19:22:09 2016 +0200

    Add get-orig-source script for SVN snapshots.
---
 debian/get-orig-source | 78 ++++++++++++++++++++++++++------------------------
 1 file changed, 41 insertions(+), 37 deletions(-)

diff --git a/debian/get-orig-source b/debian/get-orig-source
index e486809..41998b3 100755
--- a/debian/get-orig-source
+++ b/debian/get-orig-source
@@ -1,45 +1,49 @@
 #!/bin/sh
-# if you need to repack for whatever reason you can
-# use this script via uscan or directly
-#
-# FIXME: currently the code is not conform to Debian Policy
-#        http://www.debian.org/doc/debian-policy/ch-source.html
-#        "get-orig-source (optional)"
-#        This target may be invoked in any directory, ...
-# --> currently it is assumed the script is called in the
-#     source directory featuring the debian/ dir
-
-COMPRESS=xz
 
 set -e
-NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
-
-if ! echo $@ | grep -q upstream-version ; then
-    VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
-    uscan --force-download
-else
-    VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${NAME}.*?\1?"`
-    if echo "$VERSION" | grep -q "upstream-version" ; then
-        echo "Unable to parse version number"
-        exit
-    fi
-fi
 
-TARDIR=${NAME}-${VERSION}
-mkdir -p ../tarballs
-cd ../tarballs
-# need to clean up the tarballs dir first because upstream tarball might
-# contain a directory with unpredictable name
-rm -rf *
-tar -xaf ../${TARDIR}.tar.gz
-
-UPSTREAMTARDIR=`find . -mindepth 1 -maxdepth 1 -type d`
-if [ "${UPSTREAMTARDIR}" != "${TARDIR}" ] ; then
-    mv "${UPSTREAMTARDIR}" "${TARDIR}"
+SVNREPO=http://svn.zoo-project.org/svn/trunk
+
+if [ -z "${SVNREV}" ]; then
+    echo "Usage: SVNREV=<N> debian/get-orig-source"
+    exit 1
 fi
 
-# Remove useless binaries
-# ... do something which needs to be done ...
+PACKAGE=$(dpkg-parsechangelog | grep ^Source: | awk '{print $2}')
+
+UPSTREAM_VERSION=$(dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p' | sed -e 's/\+.*//; s/^[0-9]://')
+
+VERSION="${UPSTREAM_VERSION}+svn${SVNREV}"
+
+DEBIANDIR=$(readlink -f $(dirname $0))
+PACKAGEDIR=$(readlink -f $(dirname ${DEBIANDIR}))
+PARENTDIR=$(readlink -f $(dirname ${PACKAGEDIR}))
+
+TMPDIR=$(mktemp -d)
+
+TARDIR=${PACKAGE}-${VERSION}
+TARFILE=${NAME}-${VERSION}.tar.gz
+
+cd ${TMPDIR}
+
+echo "Export SVN r${SVNREV} from ${SVNREPO} to ${TMPDIR}/${TARDIR}"
+svn -r ${SVNREV} export ${SVNREPO} ${TARDIR}
+
+# Remove upstream packaging
+rm -rfv ${TARDIR}/debian/
+
+# Remove workshop files & docs
+rm -rfv ${TARDIR}/workshop/ ${TARDIR}/docs/
+
+ORIGTARFILE="${PACKAGE}_${VERSION}+ds.orig.tar.gz"
+
+echo "Creating orig tarball: ${ORIGTARFILE}"
+GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf ${ORIGTARFILE} "${TARDIR}"
+
+mv ${ORIGTARFILE} ${PARENTDIR}
 
-GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
 rm -rf ${TARDIR}
+cd -
+rm -rf ${TMPDIR}
+
+exit 0

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/zoo-project.git



More information about the Pkg-grass-devel mailing list