[Pkg-tcltk-commits] r1077 - openacs/trunk/debian

geox-guest at alioth.debian.org geox-guest at alioth.debian.org
Sun Sep 5 14:15:19 UTC 2010


Author: geox-guest
Date: 2010-09-05 14:15:14 +0000 (Sun, 05 Sep 2010)
New Revision: 1077

Modified:
   openacs/trunk/debian/README.Debian
   openacs/trunk/debian/changelog
   openacs/trunk/debian/postinst
Log:
Success to install even if postgresql is not installed.
Added info about PostgreSQL dependency to README.Debian


Modified: openacs/trunk/debian/README.Debian
===================================================================
--- openacs/trunk/debian/README.Debian	2010-09-05 14:14:48 UTC (rev 1076)
+++ openacs/trunk/debian/README.Debian	2010-09-05 14:15:14 UTC (rev 1077)
@@ -11,6 +11,15 @@
 * /usr/share/openacs/packages/acs-templating/www/resources/xinha-nightly/images/tango/*
 * /usr/share/openacs/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/media/img/flv_player.swf
 
+- PostgreSQL dependency
+-----------------------
+
+OpenACS 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: openacs/trunk/debian/changelog
===================================================================
--- openacs/trunk/debian/changelog	2010-09-05 14:14:48 UTC (rev 1076)
+++ openacs/trunk/debian/changelog	2010-09-05 14:15:14 UTC (rev 1077)
@@ -1,3 +1,10 @@
+openacs (5.5.1+dfsg-6) unstable; urgency=low
+
+  * Success to install even if postgresql is not installed.
+  * Added info about PostgreSQL dependency to README.Debian. 
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Sun, 05 Sep 2010 15:56:09 +0200
+
 openacs (5.5.1+dfsg-5) unstable; urgency=low
 
   * Removed non DFSG files, check README.Debian for details. Closes: #591207

Modified: openacs/trunk/debian/postinst
===================================================================
--- openacs/trunk/debian/postinst	2010-09-05 14:14:48 UTC (rev 1076)
+++ openacs/trunk/debian/postinst	2010-09-05 14:15:14 UTC (rev 1077)
@@ -93,92 +93,97 @@
 	dbadmpass=$dba_password
 	dbuser=$dbu_name
         dbpass=$dbu_password
-
-	. /usr/share/wwwconfig-common/pgsql-createuser.sh
-	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
 	
-	# Modify the pg_hba.conf to grant openacs 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)
+	# 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 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
-          	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 ## Openacs ... ## and ########### from previous configurations.
-			# Insert connection line after the first local connection line (the postgres user connection line).
-			sed -i "/^## Openacs package debconf changes (DO NOT EDIT BYHAND) ##/,/^##########################################################/d;1,/^local/{
+		then
+			err=1
+			echo $error
+		fi
+	
+		# Modify the pg_hba.conf to grant openacs 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 ## Openacs ... ## and ########### from previous configurations.
+				# Insert connection line after the first local connection line (the postgres user connection line).
+				sed -i "/^## Openacs package debconf changes (DO NOT EDIT BYHAND) ##/,/^##########################################################/d;1,/^local/{
         /^local/a ## Openacs package debconf changes (DO NOT EDIT BYHAND) ##\nlocal   openacs     $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/openacs/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/openacs/config.tcl
 
-	# Install plpgsql on database and enable compatibility options
-	dbuser=$dba_name
-	dbpass=$dba_password
-	sqlfile=$(mktemp)
-	echo "CREATE LANGUAGE plpgsql;
-		ALTER DATABASE openacs SET add_missing_from = on;
-		ALTER DATABASE openacs SET default_with_oids = on;
-		ALTER DATABASE openacs 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 openacs SET add_missing_from = on;
+			ALTER DATABASE openacs SET default_with_oids = on;
+			ALTER DATABASE openacs 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 OpenACS user and database"
-		echo "but an error has occurred"
-		echo "-------------------------------------------------------------"
-		echo "You will have to set up the OpenACS user and database yourself"
-		echo "-------------------------------------------------------------"
+		if [ "$err" = "1" ]
+		then
+			echo "-------------------------------------------------------------"
+			echo "I've tried my best to create the OpenACS user and database"
+			echo "but an error has occurred"
+			echo "-------------------------------------------------------------"
+			echo "You will have to set up the OpenACS user and database yourself"
+			echo "-------------------------------------------------------------"
+		fi
 	fi
-
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)




More information about the Pkg-tcltk-commits mailing list