File: pdksh.postinst

package info (click to toggle)
mksh 40.9.20120630-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,288 kB
  • sloc: ansic: 39,060; sh: 3,812; perl: 1,018; makefile: 158
file content (62 lines) | stat: -rw-r--r-- 1,733 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
55
56
57
58
59
60
61
62
#!/bin/sh
# $MirOS: contrib/hosted/tg/deb/mksh/debian/pdksh.postinst,v 1.2 2012/06/27 07:16:31 tg Exp $

set -e

# This maintainer script can be called the following ways:
#
# * new-postinst "configure" [$most_recently_configured_version]
# The package is unpacked; all dependencies are unpacked and, when there
# are no circular dependencies, configured.
#
# * old-postinst "abort-upgrade" $new_version
# * conflictors-postinst "abort-remove" "in-favour" $package
#	$new_version
# * postinst "abort-remove"
# * deconfigureds-postinst "abort-deconfigure" "in-favour"
#	$failed_install_package $fip_version ["removing"
#	$conflicting_package $cp_version]
# The package is unpacked; all dependencies are at least Half-Installed,
# previously been configured, and not removed. In some error situations,
# dependencies may not be even fully unpacked.
#
# * postinst "triggered" "${triggers[*]}"
# For trigger-only calls, i.e. if "configure" is not called.

docdir=/usr/share/doc/pdksh
move_docdir() {
	test -d /usr/share/doc/. || return 0
	test -d $docdir && rmdir --ignore-fail-on-non-empty $docdir
	if test -e $docdir; then
		echo >&2 "The old $docdir was locally modified."
		echo >&2 "Saved as $docdir.dpkg-old"
		(mv $docdir $docdir.dpkg-old || :)
	fi
	if test -e $docdir; then
		echo >&2 "FAILED! Remove $docdir manually,"
		echo >&2 "then retry (dpkg -a --configure)."
		exit 1
	fi
	ln -sf mksh $docdir
}

case $1 in
configure)
	# convert old docdir into a symlink, dpkg won’t do that for us
	test -h $docdir || move_docdir
	test -x /usr/bin/update-menus && update-menus
	;;

abort-upgrade|abort-remove|abort-deconfigure)
	;;

triggered)
	;;

*)
	echo >&2 "postinst called with unknown subcommand '$1'"
	exit 1
	;;
esac

exit 0