3
# Copyright (C) 2001,2002 Stefan Hornburg (Racke) <racke@linuxia.de>
4
# Copyright (C) 2011,2012 Georgios M. Zarkadas <gz@member.fsf.org>
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public
17
# License along with this program; if not, write to the Free
18
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6
rm -rf /usr/doc/HTML /usr/share/doc/HTML
7
rm -f /var/lib/dhelp/configured
9
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) \
10
-a -L /usr/doc/dhelp ]; then
15
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) \
16
-a -L /usr/doc/HTML ]; then
27
DHELP_APTHOOK=/etc/apt/apt.conf.d/35dhelp
29
#### Import Library ####
31
# If old version's prerm fails, our files (and thus the script library)
32
# will not be available. Thus, we need to treat this case specially.
38
for DHELP_LIBFILE in /usr/share/dhelp/maint-scripts/*.sh; do
39
if [ -f ${DHELP_LIBFILE} ]; then
42
>&2 echo "Dhelp error: file ${DHELP_LIBFILE} was not found."
43
>&2 echo "Please file a bug report at bugs.debian.org" \
44
"against the dhelp package."
52
# Cleanup the files installed by the postinst.
54
do_removal_cleanup_actions ()
56
# The directories themselves will be removed by dpkg;
57
# cf. our debian/dirs entries.
59
# Remove all cache data inside /var/lib/dhelp/tmp
61
if [ -d /var/lib/dhelp/tmp ]; then
62
rm --force /var/lib/dhelp/tmp/* || true
65
# Remove all cache data inside /var/lib/dhelp
66
# Hide the "rm: cannot remove `/var/lib/dhelp/tmp': Is a directory" error.
68
if [ -d /var/lib/dhelp ]; then
69
rm --force /var/lib/dhelp/* 2>&1 \
70
| grep --invert-match '/var/lib/dhelp/tmp' || true
73
# Remove html document index directory contents.
75
if [ -d /usr/share/doc/HTML ]; then
76
rm --force --recursive /usr/share/doc/HTML/*
80
#### Main script body ####
84
# Library is not available; confine ourselves to the bare essentials.
86
do_removal_cleanup_actions
89
# Disable our web server configuration snippets.
91
try_chconf_apache2 "disable" dhelp || true
92
try_chconf_lighttpd "disable" dhelp || true
94
# Cleanup the files installed by the postinst.
96
do_removal_cleanup_actions
102
# Remove and unregister with ucf our dpkg post-invoke hook.
104
ucf_unregister_file dhelp ${DHELP_APTHOOK}
110
unset DHELP_APTHOOK DHELP_LIBFILE || true