postinst is in gcl 2.6.7-98.
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #!/bin/sh
CONFIGFILE=/etc/default/gcl
set -e
. /usr/share/debconf/confmodule
if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ] ; then
# Generate config file, if it doesn't exist.
# An alternative is to copy in a template
# file from elsewhere.
if [ ! -e $CONFIGFILE ]; then
echo "# Config file for my package" > $CONFIGFILE
echo "DEFAULT_GCL_ANSI=" >> $CONFIGFILE
a echo "DEFAULT_GCL_PROF=" >> $CONFIGFILE
fi
# Substitute in the values from the debconf db.
# There are obvious optimizations possible here.
# The cp before the sed ensures we do not mess up
# the config file's ownership and permissions.
db_get gcl/default_gcl_ansi
if [ "$RET" = "true" ] ; then
DEFAULT_GCL_ANSI=t
else
DEFAULT_GCL_ANSI=
fi
db_get gcl/default_gcl_prof
if [ "$RET" = "true" ] ; then
DEFAULT_GCL_PROF=y
else
DEFAULT_GCL_PROF=
fi
cp -a -f $CONFIGFILE $CONFIGFILE.tmp
# If the admin deleted or commented some variables but then set
# them via debconf, (re-)add them to the conffile.
test -z "$DEFAULT_GCL_ANSI" || grep -Eq '^ *DEFAULT_GCL_ANSI=' $CONFIGFILE.tmp || echo "DEFAULT_GCL_ANSI=" >> $CONFIGFILE
test -z "$DEFAULT_GCL_PROF" || grep -Eq '^ *DEFAULT_GCL_PROF=' $CONFIGFILE.tmp || echo "DEFAULT_GCL_PROF=" >> $CONFIGFILE
sed -e "s/^ *DEFAULT_GCL_ANSI=.*/DEFAULT_GCL_ANSI=\"$DEFAULT_GCL_ANSI\"/" \
-e "s/^ *DEFAULT_GCL_PROF=.*/DEFAULT_GCL_PROF=\"$DEFAULT_GCL_PROF\"/" \
< $CONFIGFILE > $CONFIGFILE.tmp
mv -f $CONFIGFILE.tmp $CONFIGFILE
fi
# Automatically added by dh_installemacsen
if [ "$1" = "configure" ] && [ -x /usr/lib/emacsen-common/emacs-package-install ]
then
/usr/lib/emacsen-common/emacs-package-install gcl
fi
# End automatically added section
exit 0
|