[Pkg-sympa-commits] [sympa] 29/30: Make possible to not use dbconfig-common (#631162)
Emmanuel Bouthenot
kolter at moszumanska.debian.org
Mon Sep 19 20:08:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
kolter pushed a commit to branch master
in repository sympa.
commit 38611a457157288731a2f82357e5f8a88341e948
Author: Emmanuel Bouthenot <kolter at openics.org>
Date: Mon Sep 19 21:44:57 2016 +0200
Make possible to not use dbconfig-common (#631162)
---
debian/sympa.postinst | 61 +++++++++++++++++++++++++++------------------------
1 file changed, 32 insertions(+), 29 deletions(-)
diff --git a/debian/sympa.postinst b/debian/sympa.postinst
index 7e619cc..6b78509 100644
--- a/debian/sympa.postinst
+++ b/debian/sympa.postinst
@@ -169,35 +169,38 @@ if grep -q "/usr/lib/sympa/queue" /etc/aliases ; then
ln -sf bin/queue /usr/lib/sympa/queue
fi
-dbc_first_version="5.3.4-6~"
-dbc_dbfile_owner="sympa:sympa"
-dbc_go sympa $@
-
-# Translate database parameters from dbconfig-common to Sympa's db_xxx
-# configuration values
-case "$dbc_dbtype" in
- mysql)
- type=mysql
- ;;
- pgsql)
- type=Pg
- ;;
- sqlite3)
- type=SQLite
- name="$dbc_basepath/$dbc_dbname"
- ;;
- *)
- echo "Unknown database type $dbc_dbtype."
- exit 1
- ;;
-esac
-# Install the database configuration
-sympa_config_update "db_type" "${type}"
-sympa_config_update "db_name" "${dbc_dbname}"
-sympa_config_update "db_host" "${dbc_dbserver}"
-sympa_config_update "db_user" "${dbc_dbuser}"
-sympa_config_update "db_passwd" "${dbc_dbpass}"
-sympa_config_update "db_port" "${dbc_dbport}"
+db_get sympa/dbconfig-install
+if [ "${RET}" != 'false' ]; then
+ dbc_first_version="5.3.4-6~"
+ dbc_dbfile_owner="sympa:sympa"
+ dbc_go sympa $@
+
+ # Translate database parameters from dbconfig-common to Sympa's db_xxx
+ # configuration values
+ case "$dbc_dbtype" in
+ mysql)
+ type=mysql
+ ;;
+ pgsql)
+ type=Pg
+ ;;
+ sqlite3)
+ type=SQLite
+ name="$dbc_basepath/$dbc_dbname"
+ ;;
+ *)
+ echo "Unsupported database type $dbc_dbtype."
+ exit 1
+ ;;
+ esac
+ # Install the database configuration
+ sympa_config_update "db_type" "${type}"
+ sympa_config_update "db_name" "${dbc_dbname}"
+ sympa_config_update "db_host" "${dbc_dbserver}"
+ sympa_config_update "db_user" "${dbc_dbuser}"
+ sympa_config_update "db_passwd" "${dbc_dbpass}"
+ sympa_config_update "db_port" "${dbc_dbport}"
+fi
echo "Ensuring that permissions and ownerships are right (this can take a while)..."
# Ensure permissions and ownerships are right
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/sympa.git
More information about the Pkg-sympa-commits
mailing list