]> git.donarmstrong.com Git - debbugs.git/blobdiff - debian/postinst
[project @ 2002-11-25 12:25:05 by cjwatson]
[debbugs.git] / debian / postinst
index 41b1d8533dd58f8dee12daa9449322c7fb0b0833..5a8a38783a5de0630c673c11f1421c07a018f60b 100755 (executable)
@@ -2,6 +2,24 @@
 
 if [ "$1" = "configure" ]; then
   /usr/sbin/debbugsconfig
+  if dpkg --compare-versions "$2" lt 2.4; then
+    spool=`perl -e 'require "/etc/debbugs/config"; print $gSpoolDir;'`
+    if [ -d "$spool/db" ] && [ ! -d "$spool/db-h" ]; then
+      echo "Migrating bug database to hashed format." >&2
+      /usr/sbin/debbugs-dbhash "$spool/db" "$spool/db-h"
+      echo "You can remove bug logs from $spool/db" >&2
+      echo "after ensuring that the new database works." >&2
+    else
+      echo "Cannot migrate bug database to hashed format, because:" >&2
+      if [ -d "$spool/db" ]; then
+       echo "$spool/db-h already exists."
+      else
+       echo "$spool/db is missing."
+      fi
+      echo "Rectify the situation and run the following command by hand:" >&2
+      echo "  /usr/sbin/debbugs-dbhash \"$spool/db\" \"$spool/db-h\"" >&2
+    fi
+  fi
 fi
 
 if [ -f /etc/debbugs/nextnumber ]; then