[med-svn] [falcon] 01/15: d/get-orig-source: make more robust

Afif Elghraoui afif at moszumanska.debian.org
Sat Dec 16 08:03:28 UTC 2017


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

afif pushed a commit to branch master
in repository falcon.

commit 7f1630ab27f7f41c4e82bf83d3d8dba98dc98abe
Author: Afif Elghraoui <afif at debian.org>
Date:   Sat Dec 16 00:52:43 2017 -0500

    d/get-orig-source: make more robust
    
    Use a temporary working directory so we know exactly where we are,
    and use a trap to cleanup.
---
 debian/get-orig-source | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/debian/get-orig-source b/debian/get-orig-source
index ec4456e..6f66948 100755
--- a/debian/get-orig-source
+++ b/debian/get-orig-source
@@ -18,14 +18,26 @@ do
     shift
 done
 
+workdir=$(mktemp -d)
+
+cleanup () {
+    rm -rf ${workdir}
+}
+
+trap cleanup EXIT
+
 # ignore <path> and rely on ../ being the path to the orig.tar.xz
 # using source package name $SPKG from debian/changelog
 # This makes it more robust for newer uupdate in future
 SPKG=$(dpkg-parsechangelog -SSource)
-cd ..
+DESTDIR=$(realpath $PWD/..)
+cd ${workdir}
 # Now ${SPKG}_${NEW_VERSION}.orig.tar.xz is upstream tarball
 new_package="${SPKG}-${NEW_VERSION}"
-rm -f ${SPKG}_${NEW_VERSION}.orig.tar.*
+
+# Remove tarball downloaded by uscan -- it doesn't contain the
+# submodules
+rm -f ${DESTDIR}/${SPKG}_${NEW_VERSION}.orig.tar.*
 
 echo "Cloning ${SPKG} version ${NEW_VERSION}"
 git clone \
@@ -48,5 +60,4 @@ find -name ".git*" -exec rm -rf {} +
 rm -rf git-sym
 cd ..
 
-tar --xz -cf ${SPKG}_${NEW_VERSION}.orig.tar.xz ${new_package}
-rm -rf ${new_package}
+tar --xz -cf ${DESTDIR}/${SPKG}_${NEW_VERSION}.orig.tar.xz ${new_package}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/falcon.git



More information about the debian-med-commit mailing list