[Pkg-tcltk-commits] r1076 - dotlrn/trunk/debian
geox-guest at alioth.debian.org
geox-guest at alioth.debian.org
Sun Sep 5 14:15:03 UTC 2010
Author: geox-guest
Date: 2010-09-05 14:14:48 +0000 (Sun, 05 Sep 2010)
New Revision: 1076
Modified:
dotlrn/trunk/debian/README.Debian
dotlrn/trunk/debian/changelog
dotlrn/trunk/debian/postinst
Log:
Success to install even if postgresql is not installed
Added info about PostgreSQL dependency to README.Debian
Modified: dotlrn/trunk/debian/README.Debian
===================================================================
--- dotlrn/trunk/debian/README.Debian 2010-09-05 05:55:20 UTC (rev 1075)
+++ dotlrn/trunk/debian/README.Debian 2010-09-05 14:14:48 UTC (rev 1076)
@@ -10,6 +10,15 @@
* /usr/share/dotlrn/packages/acs-templating/www/resources/xinha-nightly/images/tango/*
* /usr/share/dotlrn/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/media/img/flv_player.swf
+- PostgreSQL dependency
+-----------------------
+
+dotLRN debian package does not depend strictly on postgresql package (it just "suggests" it), because it is possible
+to install it with an external postgresql database server.
+
+If the package is going to be installed in the same machine as the PostgreSQL server, please remember to install
+the postgresql package first (apt-get install postgresql).
+
- After Install
---------------
Modified: dotlrn/trunk/debian/changelog
===================================================================
--- dotlrn/trunk/debian/changelog 2010-09-05 05:55:20 UTC (rev 1075)
+++ dotlrn/trunk/debian/changelog 2010-09-05 14:14:48 UTC (rev 1076)
@@ -1,3 +1,10 @@
+dotlrn (2.5.0+dfsg-6) unstable; urgency=low
+
+ * Success to install even if postgresql is not installed. Closes: #595499
+ * Added info about PostgreSQL dependency to README.Debian.
+
+ -- Hector Romojaro <hromojaro at dia.uned.es> Sun, 05 Sep 2010 15:49:53 +0200
+
dotlrn (2.5.0+dfsg-5) unstable; urgency=low
* Removed non DFSG files, check README.Debian for details. Closes: #591210
Modified: dotlrn/trunk/debian/postinst
===================================================================
--- dotlrn/trunk/debian/postinst 2010-09-05 05:55:20 UTC (rev 1075)
+++ dotlrn/trunk/debian/postinst 2010-09-05 14:14:48 UTC (rev 1076)
@@ -94,89 +94,93 @@
dbuser=$dbu_name
dbpass=$dbu_password
- . /usr/share/wwwconfig-common/pgsql-createuser.sh
+ # is the database server available? Then create the user.
+ . /usr/share/wwwconfig-common/pgsql-createuser.sh > /dev/null
if [ "$status" = "error" ]
- then
- err=1
- echo $error
- fi
- . /usr/share/wwwconfig-common/pgsql-createdb.sh
- if [ "$status" = "error" ]
- then
- err=1
- echo $error
- fi
+ then
+ err=1
+ echo "* Error trying to connect to Postgresql server."
+ if [ "$db_host" = "localhost" ]
+ then
+ echo "(TIP: is the postgresql package installed?)"
+ fi
+ else
+ . /usr/share/wwwconfig-common/pgsql-createdb.sh
+ if [ "$status" = "error" ]
+ then
+ err=1
+ echo $error
+ fi
- # Modify the pg_hba.conf to grant dotlrn user access to postgresql
- # 1- Do we want to do that?
- if [ "$grant_access" = true ]; then
+ # Modify the pg_hba.conf to grant dotlrn user access to postgresql
+ # 1- Do we want to do that?
+ if [ "$grant_access" = true ]; then
- # 2- Where is the pg_hba.conf from this database instance?
- dbuser=$dba_name
- dbpass=$dba_password
- . /usr/share/wwwconfig-common/pgsql.get
- pg_hba_file=$($pgsqlcmd -c "SELECT * from pg_settings where name='hba_file';" 2>/dev/null | grep hba | cut -d\| -f2)
- pg_version=$(echo "$pg_hba_file" | cut -d\/ -f4)
- if [ "$status" = "error" ]
- then
- err=1
- echo $error
- else
- # 3- Modify the file
- # Select connection method
- if [ "A$dbu_password" != "A" ]; then
- # No Blank Password
- pg_conn_method="md5"
- else
- # Blank Password
- pg_conn_method="trust"
- fi
- # Delete all lines between ## dotLRN ... ## and ########### from previous configurations.
- # Insert connection line after the first local connection line (the postgres user connection line).
- sed -i "/^## dotLRN package debconf changes (DO NOT EDIT BYHAND) ##/,/^##########################################################/d;1,/^local/{
+ # 2- Where is the pg_hba.conf from this database instance?
+ dbuser=$dba_name
+ dbpass=$dba_password
+ . /usr/share/wwwconfig-common/pgsql.get
+ pg_hba_file=$($pgsqlcmd -c "SELECT * from pg_settings where name='hba_file';" 2>/dev/null | grep hba | cut -d\| -f2)
+ pg_version=$(echo "$pg_hba_file" | cut -d\/ -f4)
+ if [ "$status" = "error" ]
+ then
+ err=1
+ echo $error
+ else
+ # 3- Modify the file
+ # Select connection method
+ if [ "A$dbu_password" != "A" ]; then
+ # No Blank Password
+ pg_conn_method="md5"
+ else
+ # Blank Password
+ pg_conn_method="trust"
+ fi
+ # Delete all lines between ## dotLRN ... ## and ########### from previous configurations.
+ # Insert connection line after the first local connection line (the postgres user connection line).
+ sed -i "/^## dotLRN package debconf changes (DO NOT EDIT BYHAND) ##/,/^##########################################################/d;1,/^local/{
/^local/a ## dotLRN package debconf changes (DO NOT EDIT BYHAND) ##\nlocal dotlrn $dbu_name $pg_conn_method\n##########################################################
} " $pg_hba_file
- # 4-Reload postgresql conf
- /etc/init.d/postgresql reload
+ # 4-Reload postgresql conf
+ /etc/init.d/postgresql reload
+ fi
fi
- fi
+ # Modify config.tcl with debconf values
+ dbuser=$dbu_name
+ dbpass=$dbu_password
+ sed -i "/^ set db_host/,/^ set db_user/d;s/## Debconf changes (DO NOT EDIT BYHAND) ##/&\n set db_host $dbserver\n set db_password \"$dbpass\"\n set db_port \"5432\"\n set db_user $dbuser/" /etc/dotlrn/config.tcl
- # Modify config.tcl with debconf values
- dbuser=$dbu_name
- dbpass=$dbu_password
- sed -i "/^ set db_host/,/^ set db_user/d;s/## Debconf changes (DO NOT EDIT BYHAND) ##/&\n set db_host $dbserver\n set db_password \"$dbpass\"\n set db_port \"5432\"\n set db_user $dbuser/" /etc/dotlrn/config.tcl
+ # Install plpgsql on database and enable compatibility options
+ dbuser=$dba_name
+ dbpass=$dba_password
+ sqlfile=$(mktemp)
+ echo "CREATE LANGUAGE plpgsql;
+ ALTER DATABASE dotlrn SET add_missing_from = on;
+ ALTER DATABASE dotlrn SET default_with_oids = on;
+ ALTER DATABASE dotlrn SET regex_flavor = extended;
+ " > $sqlfile
+ . /usr/share/wwwconfig-common/pgsql-exec.sh
+ rm -f $sqlfile
- # Install plpgsql on database and enable compatibility options
- dbuser=$dba_name
- dbpass=$dba_password
- sqlfile=$(mktemp)
- echo "CREATE LANGUAGE plpgsql;
- ALTER DATABASE dotlrn SET add_missing_from = on;
- ALTER DATABASE dotlrn SET default_with_oids = on;
- ALTER DATABASE dotlrn SET regex_flavor = extended;
- " > $sqlfile
- . /usr/share/wwwconfig-common/pgsql-exec.sh
- rm -f $sqlfile
+ # Restart aolserver
+ invoke-rc.d aolserver4 restart
- # Restart aolserver
- invoke-rc.d aolserver4 restart
+ if [ "$status" = "error" ]
+ then
+ err=1
+ echo $error
+ fi
- if [ "$status" = "error" ]
- then
- err=1
- echo $error
- fi
-
-
- if [ "$err" = "1" ]
- then
- echo "-------------------------------------------------------------"
- echo "I've tried my best to create the dotLRN user and database"
- echo "but an error has occurred"
- echo "-------------------------------------------------------------"
- echo "You will have to set up the dotLRN user and database yourself"
- echo "-------------------------------------------------------------"
+ if [ "$err" = "1" ]
+ then
+ echo "-------------------------------------------------------------"
+ echo "I've tried my best to create the dotLRN user and database"
+ echo "but an error has occurred"
+ echo "-------------------------------------------------------------"
+ echo "You will have to set up the dotLRN user and database yourself"
+ echo "-------------------------------------------------------------"
+ fi
fi
;;
More information about the Pkg-tcltk-commits
mailing list