This file is indexed.

preinst is in thin 1.6.3-2build4.

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
#!/bin/sh
# -*- mode: Shell-Script -*-
# Just check if the old thin init.d conffile symlink needs to be removed

set -e

if [ "$1" = "install" -o "$1" = "upgrade" ]; then
    if [ -h /etc/init.d/thin ]; then # do we need to handle  || [ -e /etc/init.d/thin ] ? guess not.
	if [ "$(readlink /etc/init.d/thin)" = "thin1.8" ]; then
	    mv -f /etc/init.d/thin /etc/init.d/thin.dpkg-remove
	else
	    mv -f /etc/init.d/thin /etc/init.d/thin.dpkg-backup
	fi
	update-rc.d thin remove
    fi

    # thin1.8 provided the same service name, so we must remove it to avoid a failure due to insserv error
    if [ -f /etc/init.d/thin1.8 ]; then
	md5sum="$(md5sum /etc/init.d/thin1.8 | sed -e 's/ .*//')"
	old_md5sum="$(dpkg-query -W -f='${Conffiles}' thin1.8 | sed -n -e "\' /etc/init.d/thin1.8 ' { s/ obsolete$//; s/.* //; p }")"
	if [ "$md5sum" = "$old_md5sum" ]; then
	    mv -f /etc/init.d/thin1.8 /etc/init.d/thin1.8.dpkg-remove
	else
	    mv -f /etc/init.d/thin1.8 /etc/init.d/thin1.8.dpkg-backup
	fi
	update-rc.d thin1.8 remove
    fi
fi