[cpl-plugin-kmos] 01/03: loop over all possible upstream package names when downloading calibration data

Ole Streicher olebole at moszumanska.debian.org
Wed May 6 08:15:00 UTC 2015


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

olebole pushed a commit to branch debian
in repository cpl-plugin-kmos.

commit e081daa97290e869684e576cd4c8f7af27902400
Author: Ole Streicher <olebole at debian.org>
Date:   Wed May 6 09:02:08 2015 +0200

    loop over all possible upstream package names when downloading calibration data
---
 debian/cpl-plugin-calib.postinst.in | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/debian/cpl-plugin-calib.postinst.in b/debian/cpl-plugin-calib.postinst.in
index 894b217..a01821a 100644
--- a/debian/cpl-plugin-calib.postinst.in
+++ b/debian/cpl-plugin-calib.postinst.in
@@ -1,22 +1,40 @@
 #!/bin/sh
 
-set -e
+#set -o pipefail
 
 PIPELINE=__PIPELINE__
 VERSION=__VERSION__
 
-KIT=${PIPELINE}-kit-${VERSION}
 CALIB=${PIPELINE}-calib-${VERSION}
-URL=ftp://ftp.eso.org/pub/dfs/pipelines/${PIPELINE}/${KIT}.tar.gz
-TAR=${KIT}/${CALIB}.tar.gz
 COMPONENTS="${CALIB}/cal"
 TARGETDIR="/usr/share/cpl-plugins/${PIPELINE}-${VERSION}"
 
+downloaded=0
+
 if [ "$1" = "configure" ] ; then
     mkdir -p ${TARGETDIR}
-    wget -O- ${URL} | \
-    tar xzO ${TAR} | \
-    tar xzC ${TARGETDIR} ${COMPONENTS}  --strip-components=1
+
+    for suffix in "" $(seq -f -%.0f 1 9) ; do
+
+	KIT=${PIPELINE}-kit-${VERSION}${suffix}
+	URL=ftp://ftp.eso.org/pub/dfs/pipelines/${PIPELINE}/${KIT}.tar.gz
+	TAR=${KIT}/${CALIB}.tar.gz
+
+	wget -O- ${URL} | \
+	    tar xzO ${TAR} | \
+	    tar xzC ${TARGETDIR} ${COMPONENTS} --strip-components=1
+
+	if [ $? = 0 ] ; then
+	    downloaded=1
+	    break
+	fi
+    done
+fi
+
+if [ $downloaded = 0 ] ; then
+    exit 1
 fi
 
+set -e
+
 #DEBHELPER#

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/cpl-plugin-kmos.git



More information about the debian-science-commits mailing list