This file is indexed.

postinst is in science-config 0.15ubuntu1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
43
44
#!/bin/sh -e

# if blends-common package is not yet installed we have to stop here
if [ ! -f /etc/blends/blends.conf ] ; then
   echo "Debian Pure Blends configuration file /etc/blends/blends.conf is missing."
   exit -1
fi
. /etc/blends/blends.conf

if [ ! -f /etc/blends/science/science.conf ] ; then
   echo "Debian Science configuration file /etc/blends/science/science.conf is missing."
   exit -1
fi
. /etc/blends/science/science.conf

# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

# If $USEUSERMENU is not set in /etc/blends/science/science.conf read it from debconf database
if [ -z $USEUSERMENU ] ; then
    db_get shared/science-config/useusermenus
    if [ $RET ] ; then
	USEUSERMENU="yes"
    fi
fi

if [ "$USEUSERMENU" = "yes" ] ; then
    db_get science-config/group 

    CURRENTBLENDUSERS=`getUsersInRole science science 1`
    # Add those users which were selected but are not yet in the group
    for user in `echo "$RET" | sed "s/([^)]*)//g" | sed "s/ //g" |  tr ',' '\n'` ; do
	if [ `echo "${CURRENTBLENDUSERS}" | grep -c -w "$user"` -eq 0 ] ; then
	    blend-user add science $user
	fi
    done
    # Del those users which were obviousely removed from list of Blend users
    for user in `getAllUsers 1` ; do
	if [ `echo "$RET" | grep -c -w "$user"` -eq 0 ] && [ `getent group science | grep -c -w $user` -gt 0 ] ; then
	    blend-user del science $user
	fi
    done
fi