#
# see: dh_installdeb(1)
+# Support for new place for pg_hba.conf
+# I only try to upgrade on the default cluster
+if [ -x /usr/bin/pg_lsclusters ]
+then
+ # We are with new postgresql working with clusters
+ # This is probably not te most elegant way to deal with database
+ # I install or upgrade on the default cluster if it is online
+ # or I quit gently with a big message
+ pg_version=`/usr/bin/pg_lsclusters | grep 5432 | grep online | cut -d' ' -f1`
+ if [ "x$pg_version" != "x" ]
+ then
+ export pg_hba_dir=/etc/postgresql/${pg_version}/main
+ else
+ echo "No database found online on port 5432"
+ echo "Couldn't initialize or upgrade gforge database."
+ echo "Please see postgresql documentation"
+ echo "and run dpkg-reconfigure -plow gforge-db-postgresql"
+ echo "once the problem is solved"
+ echo "exiting without error, but gforge db will not work"
+ echo "right now"
+ exit 0
+ fi
+else
+ export pg_hba_dir=/etc/postgresql
+fi
+
set -e
#set -x # Be verbose, be very verbose.
#DSFHELPER:handle-mainconffile#
case "$1" in
configure)
+ add_onevar_mainconfile default_trove_cat 18
- vars="system_name domain_name server_admin db_password shell_host users_host cvs_host lists_host download_host admin_login ip_address admin_password skill_list db_host db_name db_user newsadmin_groupid statsadmin_groupid peerrating_groupid"
- update_mainconffile $vars
/usr/sbin/gforge-config
# Patch DB configuration files
/usr/lib/gforge/bin/install-db.sh configure-files
- propose_update_install /etc/postgresql/pg_hba.conf
-
- # Clean debconf after ourselves
- db_stop
+ propose_update_install ${pg_hba_dir}/pg_hba.conf
# Setup our DB
/usr/lib/gforge/bin/install-db.sh configure