#!/bin/bash # # Gnats installation script -- written by Brian White # (This was my very first attempt at learning perl... please forgive me!) # # Forgiving -- rewritten to bash :-) by Milan Zamazal . # ...and streamlined with SED by Chad Walstrom set -e ############################################################################### # # Utility functions # # Call arguments and never return error function protect () { "$@" || true; } ############################################################################### # # Common initialization for install scripts # . /usr/share/debconf/confmodule protect db_get gnats/site SITE=${RET:-@DEFSITE@} ############################################################################### # # Purge operations # if [ "$1" = purge ] ; then # # Remove the 'gnats' system from mail # if [ -f @MAILFILE@ ] ; then TEMPFILE=$(tempfile) OLDMAILFILE=@MAILFILE@.dpkg-old sed 's/^[ \t]*\(gnats-admin\|bugs\|query-pr\|$SITE-gnats\)\>\(.*\)$/#\1\2/' \ @MAILFILE@ >$TEMPFILE cp @MAILFILE@ $OLDMAILFILE chmod 644 $TEMPFILE mv $TEMPFILE @MAILFILE@ fi # # Remove symlinks to databases # protect rm -f @DB_CONFIG_DIR@/* fi ############################################################################### # # Automatically added debhelper stuff # #DEBHELPER#