[Dbconfig-common-changes] [dbconfig-common] r256 - in
branches/sqlite: dpkg internal
Matt Brown
mattb-guest at costa.debian.org
Sun Jun 11 05:38:10 CEST 2006
Author: mattb-guest
Date: 2006-06-11 03:38:09 +0000 (Sun, 11 Jun 2006)
New Revision: 256
Modified:
branches/sqlite/dpkg/common
branches/sqlite/internal/sqlite
Log:
Tidy up SQLite support
* Follow existing conventions for local variable names in internal/sqlite
* Use 'true' for functions not needed for SQLite implementation
Modified: branches/sqlite/dpkg/common
===================================================================
--- branches/sqlite/dpkg/common 2006-06-11 03:27:22 UTC (rev 255)
+++ branches/sqlite/dpkg/common 2006-06-11 03:38:09 UTC (rev 256)
@@ -114,17 +114,17 @@
;;
sqlite)
. /usr/share/dbconfig-common/internal/sqlite
- dbc_createuser_cmd=''
- dbc_checkuser_cmd='dbc_sqlite_check_user'
+ dbc_createuser_cmd=true
+ dbc_checkuser_cmd=true
dbc_createdb_cmd='dbc_sqlite_createdb'
dbc_dropdb_cmd='dbc_sqlite_dropdb'
- dbc_dropuser_cmd=''
+ dbc_dropuser_cmd=true
dbc_sqlexec_cmd='dbc_sqlite_exec_command'
dbc_sqlfile_cmd='dbc_sqlite_exec_file'
dbc_dump_cmd='dbc_sqlite_dump'
dbc_register_templates="$dbc_standard_templates $dbc_sqlite_templates"
dbc_default_admin=""
- dbc_default_dbuser=``;
+ dbc_default_dbuser="";
dbc_default_basepath="/var/lib/dbconfig-common"
dbc_default_owner="root:root"
dbc_default_mode="0644"
Modified: branches/sqlite/internal/sqlite
===================================================================
--- branches/sqlite/internal/sqlite 2006-06-11 03:27:22 UTC (rev 255)
+++ branches/sqlite/internal/sqlite 2006-06-11 03:38:09 UTC (rev 256)
@@ -14,19 +14,18 @@
## execute a file with sqlite commands
##
dbc_sqlite_exec_file(){
- local l_sqlfile l_retval l_error l_dbname l_errfile
+ local l_sqlfile l_retval l_dbfile
l_sqlfile=$1
- l_errfile=`mktemp -t dbconfig-common_sql_exec_error.XXXXXX`
+ l_dbfile="${dbc_basepath}/${dbc_dbname}"
if [ ! "$l_sqlfile" ]; then
dbc_error="no file supplied to execute"
dbc_log="no file supplied to execute"
return 1
fi
- dbfile="${dbc_basepath}/${dbc_dbname}"
- sqlite "$dbfile" < "$l_sqlfile"
- retval=$?
- return $retval
+ sqlite "$l_dbfile" < "$l_sqlfile"
+ l_retval=$?
+ return $l_retval
}
##
@@ -53,9 +52,9 @@
## check for the existance of a specified database
##
_dbc_sqlite_check_database(){
- local dbc_dbname
+ local dbc_dbname l_dbfile
dbc_dbname=$1
- dbfile="${dbc_basepath}/${dbc_dbname}"
+ l_dbfile="${dbc_basepath}/${dbc_dbname}"
if test -f "$dbfile"; then
return 0
else
@@ -64,26 +63,16 @@
}
##
-## check for access for a specific user
-##
-## this works by checking the filesystem permissions connect
-##
-dbc_sqlite_check_user(){
- # XXX: TODO
- return 0
-}
-
-##
## creates a new sqlite database file
##
##
dbc_sqlite_createdb(){
- local ret l_dbname
+ local ret l_dbfile
dbc_status=error
_dbc_sanity_check dbname sqlite || return 1
- dbfile="${dbc_basepath}/${dbc_dbname}"
+ l_dbfile="${dbc_basepath}/${dbc_dbname}"
dbc_logpart "creating database $dbc_dbname:"
@@ -93,8 +82,8 @@
else
mkdir -p "${dbc_basepath}"
dbc_sqlite_exec_command ".schema" && \
- chown "$dbc_owner" "$dbfile" && \
- chmod "$dbc_mode" "$dbfile"
+ chown "$dbc_owner" "$l_dbfile" && \
+ chmod "$dbc_mode" "$l_dbfile"
ret=$?
if [ "$ret" = "0" ]; then
dbc_logline "success"
@@ -145,7 +134,6 @@
## dump a sqlite database
##
dbc_sqlite_dump(){
- local dumperr
_dbc_sanity_check dbname sqlite || return 1
dbc_sqlite_exec_command ".dump"
return $?
More information about the Dbconfig-common-changes
mailing list