[med-svn] [pbdagcon] 04/12: get-orig-source: clean up after any exit
Afif Elghraoui
afif at moszumanska.debian.org
Wed Dec 21 09:26:49 UTC 2016
This is an automated email from the git hooks/post-receive script.
afif pushed a commit to branch master
in repository pbdagcon.
commit ee91433f885efe55a0d138b9d14ba492cf5a6478
Author: Afif Elghraoui <afif at debian.org>
Date: Tue Dec 20 22:03:42 2016 -0800
get-orig-source: clean up after any exit
---
debian/get-orig-source | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/debian/get-orig-source b/debian/get-orig-source
index ed61589..4f449f0 100755
--- a/debian/get-orig-source
+++ b/debian/get-orig-source
@@ -3,14 +3,22 @@
set -ex
PKGDIR="$PWD"
+
# 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)
NEW_VERSION=$(dpkg-parsechangelog -SVersion | sed 's/\-[0-9]*$//')
+new_package="${SPKG}-${NEW_VERSION}"
+
+clean () {
+ rm -rf ../${new_package} ../${SPKG}-${NEW_VERSION}.tar.gz
+}
+
+trap clean EXIT
+
cd ..
# Now ${SPKG}_${NEW_VERSION}.orig.tar.xz is upstream tarball
-new_package="${SPKG}-${NEW_VERSION}"
rm -f ${SPKG}_${NEW_VERSION}.orig.tar.*
echo "Cloning ${SPKG} version ${NEW_VERSION}"
@@ -25,4 +33,3 @@ cd $new_package \
tar -czf ../${SPKG}-${NEW_VERSION}.tar.gz ../${new_package}
mk-origtargz --compression xz ../${SPKG}-${NEW_VERSION}.tar.gz
-rm -rf ../${new_package} ../${SPKG}-${NEW_VERSION}.tar
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/pbdagcon.git
More information about the debian-med-commit
mailing list