~noskcaj/ubuntu/saucy/dhelp/apache2.4

« back to all changes in this revision

Viewing changes to debian/prerm

  • Committer: Charlie Smotherman
  • Date: 2012-11-05 23:48:50 UTC
  • mfrom: (22.1.1 dhelp)
  • Revision ID: cjsmo@cableone.net-20121105234850-4a447ob81bs9a5je
Tags: 0.6.21+nmu1ubuntu1
* Merge from Debian unstable. Remaining changes:
  - lib/dhelp.rb:
    + Exit and return zero code if bdb isn't available; this usually
      indicates that dhelp is not configured yet.
* Non-Maintainer Upload
* Dropped the declaration of dependence on ruby-commandline, which was
  already done on the code
* New maintainer: Georgios M. Zarkadas <gz@member.fsf.org> (Closes: #650441). 
* Support other web servers in addition to apache2 (Closes: #669041).
* Support apache2 packaging transition for version 2.4 (Closes: #669758).
* Support new ruby packaging policy transition for Wheezy.
* Use OptionParser instead Commandline::Application (Closes: #678055).
  Thanks Gunnar Wolf.
* Support new layout of man2html cgi scripts for Wheezy.
* Keep supporting previous policies/layouts, either during build time or
  during runtime, to aid backporting.
* Man and info pages links are activated only if associated packages are
  installed on the system.
* Subsections now show in the sections list only if section is selected.
* New color, styles and icons themes.
* Package installation now does not fail if cache data cannot be generated
  during install.
* Fix some minor lintian warnings.
* Bump Standards-Version to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh -e
 
1
#!/bin/sh
 
2
#
 
3
# Copyright (C) 2001,2002 Stefan Hornburg (Racke) <racke@linuxia.de>
 
4
# Copyright (C) 2011,2012 Georgios M. Zarkadas <gz@member.fsf.org>
 
5
#
 
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.
 
10
#
 
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.
 
15
#
 
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,
 
19
# MA  02111-1307  USA.
 
20
 
 
21
set -e
2
22
 
3
23
#DEBHELPER#
4
24
 
5
 
rm -rf /var/lib/dhelp
6
 
rm -rf /usr/doc/HTML /usr/share/doc/HTML
7
 
rm -f /var/lib/dhelp/configured
8
 
 
9
 
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) \
10
 
     -a -L /usr/doc/dhelp ]; then
11
 
  rm -f /usr/doc/dhelp
12
 
fi
13
 
 
14
 
 
15
 
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) \
16
 
     -a -L /usr/doc/HTML ]; then
17
 
  rm -f /usr/doc/HTML
18
 
fi
 
25
#### Globals ####
 
26
 
 
27
DHELP_APTHOOK=/etc/apt/apt.conf.d/35dhelp
 
28
 
 
29
#### Import Library ####
 
30
 
 
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.
 
33
 
 
34
case $1 in
 
35
failed-upgrade)
 
36
    ;;
 
37
*)
 
38
    for DHELP_LIBFILE in /usr/share/dhelp/maint-scripts/*.sh; do 
 
39
        if [ -f ${DHELP_LIBFILE} ]; then
 
40
            . ${DHELP_LIBFILE}
 
41
        else
 
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."
 
45
        fi
 
46
    done
 
47
    ;;
 
48
esac
 
49
 
 
50
#### Functions ####
 
51
 
 
52
# Cleanup the files installed by the postinst.
 
53
#
 
54
do_removal_cleanup_actions ()
 
55
{
 
56
    # The directories themselves will be removed by dpkg;
 
57
    # cf. our debian/dirs entries.
 
58
 
 
59
    # Remove all cache data inside /var/lib/dhelp/tmp
 
60
 
 
61
    if [ -d /var/lib/dhelp/tmp ]; then
 
62
        rm --force /var/lib/dhelp/tmp/* || true
 
63
    fi
 
64
 
 
65
    # Remove all cache data inside /var/lib/dhelp
 
66
    # Hide the "rm: cannot remove `/var/lib/dhelp/tmp': Is a directory" error.
 
67
 
 
68
    if [ -d /var/lib/dhelp ]; then
 
69
        rm --force /var/lib/dhelp/* 2>&1 \
 
70
            | grep --invert-match '/var/lib/dhelp/tmp' || true
 
71
    fi
 
72
 
 
73
    # Remove html document index directory contents.
 
74
 
 
75
    if [ -d /usr/share/doc/HTML ]; then
 
76
        rm --force --recursive /usr/share/doc/HTML/*
 
77
    fi
 
78
}
 
79
 
 
80
#### Main script body ####
 
81
 
 
82
case $1 in
 
83
failed-upgrade)
 
84
    # Library is not available; confine ourselves to the bare essentials.
 
85
 
 
86
    do_removal_cleanup_actions
 
87
    ;;
 
88
*)
 
89
    # Disable our web server configuration snippets.
 
90
 
 
91
    try_chconf_apache2  "disable" dhelp || true
 
92
    try_chconf_lighttpd "disable" dhelp || true
 
93
 
 
94
    # Cleanup the files installed by the postinst.
 
95
 
 
96
    do_removal_cleanup_actions
 
97
    ;;
 
98
esac
 
99
 
 
100
case $1 in
 
101
purge)
 
102
    # Remove and unregister with ucf our dpkg post-invoke hook.
 
103
 
 
104
    ucf_unregister_file dhelp ${DHELP_APTHOOK}
 
105
    ;;
 
106
*)
 
107
    ;;
 
108
esac
 
109
 
 
110
unset DHELP_APTHOOK DHELP_LIBFILE || true