4
# Author : Manoj Srivastava ( srivasta@tiamat.datasync.com )
5
# Created On : Thu Oct 15 00:23:39 1998
6
# Created On Node : tiamat.datasync.com
7
# Last Modified By : Manoj Srivastava
8
# Last Modified On : Sun Jul 22 23:28:02 2001
9
# Last Machine Used: glaurung.green-gryphon.com
11
# Status : Unknown, Use with caution!
18
# Abort if any command returns an error value
21
# This script is called as the last step of the installation of the
22
# package. All the package's files are in place, dpkg has already done
23
# its automatic conffile handling, and all the packages we depend of
24
# are already fully installed and configured.
26
package_name=mime-codecs
28
if [ -z "package_name" ]; then
29
print >&2 "Internal Error. Please report a bug."
33
#perl -e 'print readlink("/usr/doc/'$package_name'"), "\n"; '
36
# Configure this package. If the package must prompt the user for
37
# information, do it here.
39
if [ -d /usr/doc ]; then
40
# Well, we still need to handle this. At this point, /usr/doc
43
if [ -d /usr/share/doc/$package_name ]; then
44
# So the new doc dir exists, goody
46
# well, either one of these is a symlink, they can be
47
# pointing off _anywhere_
49
target_dir=$(/bin/pwd);
51
starget_dir=$(/bin/pwd);
54
link_target="../share/doc/$package_name";
56
if [ -d ../share/doc/ ]; then
59
if [ "$starget_dir" = "$ltarget" ]; then
60
link_target="../share/doc/$package_name";
62
link_target="/usr/share/doc/$package_name";
65
link_target="/usr/share/doc/$package_name"
69
# Well, make sure that we do not get tripped up by the symlink
70
if [ -L /usr/doc/$package_name ]; then
71
rm -f /usr/doc/$package_name
74
if [ "$target_dir" != "$starget_dir" ]; then
75
# Ok. The directories are in different locations
76
if [ -d /usr/doc/$package_name ]; then
77
echo "Yikes! The old directory, /usr/doc/$package_name,"
78
echo "has not ben removed! This is an error; attempting"
80
find /usr/doc/$package_name/ -type f -name .dhelp \
82
find /usr/doc/$package_name/ -type d -depth \
83
-exec rmdir --ignore-fail-on-non-empty {} \;
85
if [ -d /usr/doc/$package_name ]; then
87
Failed repairs. There are old files in /usr/doc/$package_name/ created
88
by you or another script. I can copy them over to the new location
89
/usr/share/doc/$package_name, if you wish, preserving your versions of
90
the files. No files shall be over written, instead, backup versions
91
shall be created in /usr/share/doc/$package_name as needed.
93
Shall I copy the files over [Yn]?
98
echo "Not copying over, aborting";
102
cp -a --backup=t /usr/doc/$package_name \
103
/usr/share/doc/$package_name/.. ;
104
rm -rf /usr/doc/$package_name;
109
if [ -e /usr/doc/$package_name ]; then
110
echo "/usr/doc/$package_name still exists"
111
if [ -L /usr/doc/$package_name ]; then
112
echo "it is a symbolic link, overwriting"
113
ln -sf $link_target /usr/doc/$package_name
115
echo "This is an error. Aborting"
119
# File unexists. Free to go ahead and create link
120
ln -sf $link_target /usr/doc/$package_name
129
# There are three sub-cases:
130
if test "${2+set}" != set; then
131
# We're being installed by an ancient dpkg which doesn't remember
132
# which version was most recently configured, or even whether
133
# there is a most recently configured version.
136
elif test -z "$2" -o "$2" = "<unknown>"; then
137
# The package has not ever been configured on this system, or was
138
# purged since it was last configured.
142
# Version $2 is the most recently configured version of this
151
# Back out of an attempt to upgrade this package FROM THIS VERSION
152
# to version $2. Undo the effects of "prerm upgrade $2".
157
if test "$2" != in-favour; then
158
echo "$0: undocumented call to \`postinst $*'" 1>&2
161
# Back out of an attempt to remove this package, which was due to
162
# a conflict with package $3 (version $4). Undo the effects of
163
# "prerm remove in-favour $3 $4".
168
if test "$2" != in-favour -o "$5" != removing; then
169
echo "$0: undocumented call to \`postinst $*'" 1>&2
172
# Back out of an attempt to deconfigure this package, which was
173
# due to package $6 (version $7) which we depend on being removed
174
# to make way for package $3 (version $4). Undo the effects of
175
# "prerm deconfigure in-favour $3 $4 removing $6 $7".
179
*) echo "$0: didn't understand being called with \`$1'" 1>&2