[Dbconfig-common-changes] [dbconfig-common] r268 - branches/sqlite/internal

Matt Brown mattb-guest at costa.debian.org
Tue Jun 27 12:15:13 CEST 2006


Author: mattb-guest
Date: 2006-06-27 10:15:08 +0000 (Tue, 27 Jun 2006)
New Revision: 268

Modified:
   branches/sqlite/internal/sqlite
Log:
Improve error handling as suggested by sean


Modified: branches/sqlite/internal/sqlite
===================================================================
--- branches/sqlite/internal/sqlite	2006-06-18 08:57:54 UTC (rev 267)
+++ branches/sqlite/internal/sqlite	2006-06-27 10:15:08 UTC (rev 268)
@@ -23,8 +23,8 @@
 		dbc_log="no file supplied to execute"
 		return 1
 	fi
-	sqlite "$l_dbfile" < "$l_sqlfile"
-	l_retval=$?
+	l_retval=0
+	sqlite "$l_dbfile" < "$l_sqlfile" || l_retval=$?
 	return $l_retval
 }
 
@@ -42,8 +42,7 @@
 	cat << EOF > $l_sqlfile
 $statement
 EOF
-	dbc_sqlite_exec_file "$l_sqlfile"
-	l_retval=$?
+	dbc_sqlite_exec_file "$l_sqlfile" || l_retval=$?
 	rm -f "$l_sqlfile"
 	return $l_retval
 }
@@ -80,11 +79,11 @@
 		dbc_logline "already exists"
 		dbc_status=nothing
 	else
+		ret=0
 		mkdir -p "${dbc_basepath}"
 		dbc_sqlite_exec_command ".schema" && \
 		chown "$dbc_owner" "$l_dbfile" && \
-		chmod "$dbc_mode" "$l_dbfile"
-		ret=$?
+		chmod "$dbc_mode" "$l_dbfile" || ret=$?
 		if [ "$ret" = "0" ]; then
 			dbc_logline "success"
 			dbc_logpart "verifying database $dbc_dbname exists:"




More information about the Dbconfig-common-changes mailing list