[proj-rdnap] 02/04: Update get-orig-source script to work from a temp directory.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sun May 3 17:13:17 UTC 2015


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

sebastic pushed a commit to branch master
in repository proj-rdnap.

commit c7c94cb6d5f87dc650c9c884d4c9d2a1429d3ecc
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sun May 3 17:42:39 2015 +0200

    Update get-orig-source script to work from a temp directory.
---
 debian/changelog       |  6 ++++++
 debian/get-orig-source | 48 ++++++++++++++++++++++++++++--------------------
 2 files changed, 34 insertions(+), 20 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f7239fe..debc35f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+proj-rdnap (2008-3) UNRELEASED; urgency=medium
+
+  * Update get-orig-source script to work from a temp directory.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 03 May 2015 17:42:09 +0200
+
 proj-rdnap (2008-2) unstable; urgency=medium
 
   * Remove reference to appendix 1 from description.
diff --git a/debian/get-orig-source b/debian/get-orig-source
index 3324344..47a6669 100755
--- a/debian/get-orig-source
+++ b/debian/get-orig-source
@@ -1,19 +1,25 @@
 #!/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
+
+set -e
 
 COMPRESS=xz
 
-set -e
 NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
 
+PACKAGE=$NAME
+
+DEBIANDIR=$(readlink -f $(dirname $0))
+PACKAGEDIR=$(readlink -f $(dirname ${DEBIANDIR}))
+PARENTDIR=$(readlink -f $(dirname ${PACKAGEDIR}))
+
+CHANGELOGFILE=${DEBIANDIR}/changelog
+
+TMPDIR=$(mktemp -d)
+
+cd ${TMPDIR}
+
 # RDNAPTRANS2008
 # https://www.kadaster.nl/web/file?uuid=f7ea740f-0f3c-402a-bf34-896dac7d557f&owner=23cbe925-35ce-4a72-ac8c-a33a0c19ae1e&contentid=9675
 #
@@ -21,8 +27,8 @@ NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
 # https://www.kadaster.nl/web/show?mode=preview&contentid=9674&id=107118&l_id=17022&webid=26098
 
 if ! echo $@ | grep -q upstream-version ; then
-    VERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
-    wget "https://www.kadaster.nl/web/file?uuid=f7ea740f-0f3c-402a-bf34-896dac7d557f&owner=23cbe925-35ce-4a72-ac8c-a33a0c19ae1e&contentid=9675" -O ../RDNAPTRANS2008.zip
+    VERSION=`dpkg-parsechangelog -l"$CHANGELOGFILE" | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
+    wget "https://www.kadaster.nl/web/file?uuid=f7ea740f-0f3c-402a-bf34-896dac7d557f&owner=23cbe925-35ce-4a72-ac8c-a33a0c19ae1e&contentid=9675" -O RDNAPTRANS2008.zip
 else
     VERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${NAME}.*?\1?"`
     if echo "$VERSION" | grep -q "upstream-version" ; then
@@ -31,13 +37,7 @@ else
     fi
 fi
 
-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 *
-
-unzip ../RDNAPTRANS2008.zip -d RDNAPTRANS2008
+unzip RDNAPTRANS2008.zip -d RDNAPTRANS2008
 
 # RDNAPTRANS2008.zip is not redistributable! 
 # The grid correction files for PROJ.4 are shipped in the file NTv2_2008.zip,
@@ -52,6 +52,14 @@ if [ "${UPSTREAMTARDIR}" != "${TARDIR}" ] ; then
     mv "${UPSTREAMTARDIR}" "${TARDIR}"
 fi
 
-GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf ../"$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
-cd ../
-rm -rf tarballs
+ORIGTARFILE="${PACKAGE}_${VERSION}.orig.tar.${COMPRESS}"
+
+GZIP="--best --no-name" XZ_OPT="-6v" tar --owner=root --group=root --mode=a+rX -caf ${ORIGTARFILE} "${TARDIR}"
+
+mv ${ORIGTARFILE} ${PARENTDIR}
+
+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/proj-rdnap.git



More information about the Pkg-grass-devel mailing list