File: code-aster-run.postinst

package info (click to toggle)
astk 1.13.1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,896 kB
  • sloc: tcl: 24,251; python: 19,546; sh: 279; makefile: 51
file content (36 lines) | stat: -rw-r--r-- 970 bytes parent folder | download | duplicates (2)
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

# Source debconf library.
. /usr/share/debconf/confmodule
TEMPLATE=/usr/share/codeaster/asrun
ASRUN=/etc/codeaster/asrun
ASTER_TEMPLATE=/usr/share/codeaster/aster.template
ASTER=/etc/codeaster/aster

if [ "$1" = "configure" ]; then
       if [ -z "$2" ]; then # first install of pacakge
               mkdir -p /etc/codeaster/astkrc
               if [ "$(getconf LONG_BIT)" = 64 ]; then
                       platform=LINUX64
               else
                       platform=LINUX
               fi
               node=$(hostname -s 2>/dev/null)

               sed -e "s|^plate-forme : .*|plate-forme : $platform|;s|noeud : .*|noeud : $node|" < $TEMPLATE > $ASRUN

               cp $ASTER_TEMPLATE $ASTER
       fi

       db_get astk/EDITOR || true
       editor=${RET}

       db_get astk/TERMINAL || true
       terminal=${RET}

       sed -i -e "s|editor : .*|editor : $editor|;s|terminal : .*|terminal : $terminal|" $ASRUN
fi

#DEBHELPER#