]> git.donarmstrong.com Git - debbugs.git/blob - debian/postinst
[project @ 2002-11-17 16:07:00 by cjwatson]
[debbugs.git] / debian / postinst
1 #!/bin/sh -e
2
3 if [ "$1" = "configure" ]; then
4   /usr/sbin/debbugsconfig
5   if dpkg --compare-versions "$2" lt 2.4; then
6     spool=`perl -e 'require "/etc/debbugs/config"; print $gSpoolDir;'`
7     if [ -d "$spool/db" ] && [ ! -d "$spool/db-h" ]; then
8       echo "Migrating bug database to hashed format." >&2
9       /usr/sbin/debbugs-dbhash "$spool/db" "$spool/db-h"
10       echo "You can remove bug logs from $spool/db" >&2
11       echo "after ensuring that the new database works." >&2
12     else
13       echo "Cannot migrate bug database to hashed format, because:" >&2
14       if [ -d "$spool/db" ]; then
15         echo "$spool/db-h already exists."
16       else
17         echo "$spool/db is missing."
18       fi
19       echo "Rectify the situation and run the following command by hand:" >&2
20       echo "  /usr/sbin/debbugs-dbhash \"$spool/db\" \"$spool/db-h\"" >&2
21     fi
22   fi
23 fi
24
25 if [ -f /etc/debbugs/nextnumber ]; then
26   rm -f /etc/debbugs/nextnumber
27 fi
28
29 #DEBHELPER#