File: postinst

package info (click to toggle)
man2html 1.5p-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 528 kB
  • ctags: 83
  • sloc: ansic: 1,273; sh: 271; makefile: 92
file content (54 lines) | stat: -rw-r--r-- 1,328 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
# $Id: postinst,v 1.13 2004/08/08 17:21:13 robert Exp $
set -e

#DEBHELPER#

. /usr/share/debconf/confmodule

if [ "$1" != "configure" ] ; then 
	db_stop || true
	exit 0  
fi

if dpkg --compare-versions "$2" lt-nl "1.5k-1" ; then
	rm -f /var/cache/man2html/manindex* /var/cache/man2html/whatis*

	# remove old unused glimpse files
	rm -f /var/cache/man2html/.glimpse*
fi


if [ -e /var/cache/man2html/ ] \
	&& [ -x /usr/bin/index++ ] \
	&& [ ! -e /var/cache/man2html/man2html.swish++.index ] \
	&& [ ! -e /var/cache/man2html/man2html.swish++.index.tmp ]; then
	db_get man2html/index_manpages || true
	db_stop || true
	if [ "$RET" = "true" ]; then
		tf=`tempfile -p 'm2h-' -s '.swish++.out'`
		echo "Running index++ in the background to index your manpages"
		echo "(redirected to $tf)."
		

		if [ -e /usr/local/man ]; then
			LOCALMAN=$(find /usr/local/man -type d -name "man?")
		fi
		
		if [ -e /usr/local/share/man ]; then
			LOCALSMAN=$(find /usr/local/share/man -type d -name "man?")
		fi
		
		
		index++ --config-file=/usr/share/man2html/swish++.conf \
			/usr/share/man/man* \
			/usr/man/man* \
			/usr/X11R6/man/man* $LOCALMAN $LOCALSMAN 2>&1 > "$tf" &
	fi
else
	db_stop || true
fi

echo "Tune your web browser to http://`hostname --fqdn`/cgi-bin/man/man2html to view"
echo "your installed manpages."
exit 0