File: cpl-plugin-calib.postinst.in

package info (click to toggle)
cpl-plugin-amber 4.3.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,840 kB
  • sloc: ansic: 51,270; sh: 4,278; python: 295; makefile: 284
file content (40 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

#set -o pipefail

PIPELINE=__PIPELINE__
VERSION=__VERSION__

CALIB=${PIPELINE}-calib-${VERSION}
COMPONENTS="${CALIB}/cal"
TARGETDIR="/usr/share/cpl-plugins/${PIPELINE}-${VERSION}"

downloaded=0

if [ "$1" = "configure" ] ; then
    mkdir -p ${TARGETDIR}

    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#