File: postinst

package info (click to toggle)
kbedic 4.0-10
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k
  • size: 780 kB
  • ctags: 386
  • sloc: sh: 3,184; cpp: 2,649; makefile: 66
file content (42 lines) | stat: -rw-r--r-- 1,374 bytes parent folder | download
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
41
42
#!/bin/sh -e

#DEBHELPER#

mkdir -p /usr/local/share/bedic || true

. /usr/share/debconf/confmodule

for x in x; do
    [ ! -f /usr/local/share/bedic/bg_en.dat ] \
	|| [ ! -f /usr/local/share/bedic/bg_en.dat ] \
	|| break
    db_get kbedic/download
    [ "$RET" = true ] || break
#    address=http://heanet.dl.sourceforge.net/kbedic/bedic-data-4.0.tar.gz
    address=http://ftp1.sourceforge.net/kbedic/bedic-data-4.0.tar.gz
    tmpdir=`mktemp -d`
    if \
	wget --continue --tries=1 --dns-timeout=20 --connect-timeout=20 --read-timeout=60 $address -O $tmpdir/bedic.tar.gz \
	&& tar zxf $tmpdir/bedic.tar.gz -C $tmpdir/ \
	&& [ -f $tmpdir/bedic-data-4.0/bg_en.dat ] \
	&& [ -f $tmpdir/bedic-data-4.0/en_bg.dat ]
    then
	cp $tmpdir/bedic-data-4.0/bg_en.dat /usr/local/share/bedic/bg_en.dat
	cp $tmpdir/bedic-data-4.0/en_bg.dat /usr/local/share/bedic/en_bg.dat
	chown root: /usr/local/share/bedic/*
	chmod 644  /usr/local/share/bedic/*
    else
	db_reset kbedic/failed_download
	db_input medium kbedic/failed_download || true
	db_go || true
    fi
    rm -r $tmpdir
done

# To be sure if necessary this question is asked next time the config
# script is executed.  This command can not be used in the config script
# because otherwise the question will be asked twice -- during the
# pre-configuration phase and and when the postinst is run.
db_reset kbedic/download

exit 0