[Dbconfig-common-devel] dbconfig-common/dpkg postinst,1.5,1.6

seanius@haydn.debian.org seanius@haydn.debian.org


Update of /cvsroot/dbconfig-common/dbconfig-common/dpkg
In directory haydn:/org/alioth.debian.org/chroot/home/users/seanius/tmp/cvs-serv26588/dpkg

Modified Files:
	postinst 
Log Message:
okay, 1.4 is going to experimental!


	sean



Index: postinst
===================================================================
RCS file: /cvsroot/dbconfig-common/dbconfig-common/dpkg/postinst,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- postinst	23 Feb 2005 05:39:59 -0000	1.5
+++ postinst	4 Mar 2005 06:50:19 -0000	1.6
@@ -41,11 +41,17 @@
 		# synchronize info to disk
 		dbc_write_package_config
 		
+
 		###
 		### if they don't want our help, quit
 		###
 		if [ "$dbc_install" != "true" ]; then exit 0; fi
 
+		# export this if it exists, for the install/upgrade scripts
+		if [ "$dbc_generate_include" ]; then
+			export dbc_generate_include
+		fi
+
 		###
 		### now, create the app user account
 		###
@@ -74,11 +80,11 @@
 		if [ -f $dbc_scriptfile -a ! "$dbc_dbstatus" = "nothing" ]; then
 			# temporarily ignore non-zero exit vals so we can handle them
 			set +e
-			. $dbc_scriptfile
+			sh -c "$dbc_scriptfile $*"
 			_dbc_retval=$?
 			set -e
 			# check for errors
-			if [ $_dbc_retval  ]; then
+			if [ $_dbc_retval -ne 0 ]; then
 				dbc_error="$dbc_scriptfile exited with non-zero status"
 				dbc_install_error "creating database"
 			fi
@@ -131,9 +137,9 @@
 
 				# this is the file into which upgrade backups go
 				_dbc_dbfile=/var/cache/dbconfig-common/backups/${dbc_package}_${dbc_oldversion}.$dbc_dbtype	
-				echo dbconfig-common: creating database backup in $dbc_dbfile >&2
+				echo dbconfig-common: creating database backup in $_dbc_dbfile >&2
 				# backup before we upgrade
-				$dbc_dump_cmd
+				$dbc_dump_cmd > $_dbc_dbfile
 			fi
 
 			# now go through the pending sql upgrades, one by one
@@ -153,7 +159,7 @@
 				# execute the script
 				echo dbconfig-common: upgrading with $_dbc_f >&2
 				set +e
-				. $_dbc_f
+				sh -c "$_dbc_f $*"
 				_dbc_retval=$?
 				set -e
 				if [ $_dbc_retval -ne 0 ]; then