~ubuntu-branches/ubuntu/dapper/gnats/dapper

« back to all changes in this revision

Viewing changes to debian/gnats.prerm.in

  • Committer: Bazaar Package Importer
  • Author(s): Chad Walstrom
  • Date: 2005-03-07 17:56:31 UTC
  • mfrom: (1.1.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050307175631-agtm10dvjbemuc64
Tags: 4.1.0-0
* New upstream version
* debian/rules: now uses '--with-lispdir' option instead of environment
  variable overloading. Re-enabled optimization.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
# Gnats installation script -- written by Brian White <bcwhite@pobox.com>
 
4
# (This was my very first attempt at learning perl... please forgive me!)
 
5
#
 
6
# Forgiving -- rewritten to bash :-) by Milan Zamazal <pdm@debian.org>.
 
7
# ...and streamlined with SED by Chad Walstrom <chewie@debian.org>
 
8
 
 
9
set -e
 
10
 
 
11
###############################################################################
 
12
#
 
13
# Utility functions
 
14
#
 
15
 
 
16
# Call arguments and never return error
 
17
function protect () { "$@" || true; }
 
18
 
 
19
###############################################################################
 
20
#
 
21
# Common initialization for install scripts
 
22
#
 
23
 
 
24
. /usr/share/debconf/confmodule
 
25
 
 
26
protect db_get gnats/site
 
27
SITE=${RET:-@DEFSITE@}
 
28
 
 
29
###############################################################################
 
30
#
 
31
# Purge operations
 
32
#
 
33
 
 
34
if [ "$1" = purge ] ; then
 
35
 
 
36
  #
 
37
  # Remove the 'gnats' system from mail
 
38
  #
 
39
  if [ -f @MAILFILE@ ] ; then
 
40
    TEMPFILE=$(tempfile)
 
41
    OLDMAILFILE=@MAILFILE@.dpkg-old
 
42
    
 
43
    sed 's/^[ \t]*\(gnats-admin\|bugs\|query-pr\|$SITE-gnats\)\>\(.*\)$/#\1\2/' \
 
44
        @MAILFILE@ >$TEMPFILE
 
45
    cp @MAILFILE@ $OLDMAILFILE
 
46
    chmod 644 $TEMPFILE
 
47
    mv $TEMPFILE @MAILFILE@
 
48
  fi
 
49
 
 
50
  #
 
51
  # Remove symlinks to databases
 
52
  #
 
53
  protect rm -f @DB_CONFIG_DIR@/*
 
54
 
 
55
fi
 
56
 
 
57
###############################################################################
 
58
#
 
59
# Automatically added debhelper stuff
 
60
#
 
61
#DEBHELPER#