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
|
#! /bin/sh
set -e
if [ -d /usr/doc/doc-linux-html ] && [ ! -h /usr/doc/doc-linux-html ] \
&& [ -f /usr/doc/doc-linux-html/.dhelp ]; then
rm -f /usr/doc/doc-linux-html/.dhelp
rmdir /usr/doc/doc-linux-html
fi
# This version number is later than you might expect, because I missed some
# cases before 2002.04-2. The postrm only unwinds before 2001.11-1, because
# the intermediate versions were just mistakes.
if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt-nl 2002.04-2; then
# In earlier versions, /usr/share/doc/FAQ was a symlink to
# /usr/share/doc/doc-linux-html/FAQ. This reverses the sense of the
# symlink so that dpkg doesn't complain. It also cunningly handles other
# packages installing into /usr/share/doc/FAQ before this migration
# happens: they'll install through the symlink and then the whole thing
# will be moved in one piece.
if [ ! -h /usr/share/doc/doc-linux-html/FAQ ] \
&& [ -d /usr/share/doc/doc-linux-html/FAQ ]; then
# This might be in a strange state, depending on when doc-linux-text
# was installed.
if [ -h /usr/share/doc/FAQ ] || [ ! -d /usr/share/doc/FAQ ]; then
rm -f /usr/share/doc/FAQ
fi
mkdir -p /usr/share/doc/FAQ
find /usr/share/doc/doc-linux-html/FAQ -mindepth 1 -maxdepth 1 | \
xargs -r -iname mv name /usr/share/doc/FAQ/
rmdir /usr/share/doc/doc-linux-html/FAQ
ln -s ../FAQ /usr/share/doc/doc-linux-html/FAQ
fi
fi
#DEBHELPER#
exit 0
|