File: postinst

package info (click to toggle)
qcumber 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 2,276 kB
  • sloc: python: 3,097; sh: 153; makefile: 18
file content (36 lines) | stat: -rw-r--r-- 1,071 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
#!/bin/sh

set -e

conffile=/etc/qcumber/config.txt
CHECKKRAKENDBFILE="database.idx"

. /usr/share/debconf/confmodule

db_get qcumber/krakendb || true

DEFAULTKRAKENDB="$RET"

if [ "$DEFAULTKRAKENDB" = "" ] ; then
    DEFAULTKRAKENDB="`sed '/\[PATH\]/,$d' $conffile | grep ^kraken_db | head -n 1 | sed 's/^kraken_db *= *\([^ ]\+\) *$/\1/'`"
else
    # check whether configfile has the same dir as the user has input in config step
    if ! grep -q "^kraken_db *= *$DEFAULTKRAKENDB *$" $conffile ; then
        sed -i "s:^\(kraken_db *=\) *.*$:\1 $DEFAULTKRAKENDB:" $conffile
    fi
fi

if [ "$1" = configure ] ; then
    # Make sure minikraken DB exists
    if [ ! -e "$DEFAULTKRAKENDB/$CHECKKRAKENDBFILE" ] ; then
cat <<EOT
*************************************************************************
* Minikraken DB is missing.  Either move the according files to         *
*     $DEFAULTKRAKENDB
* or call the script /usr/share/doc/qcumber/get-minikrakendb as root.   *
*************************************************************************
EOT
    fi
fi

#DEBHELPER#