Entropy/etpDatabase:

- change dumped sql table creation schema from 'CREATE TABLE' to 'CREATE TABLE IF NOT EXISTS'


git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1928 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
lxnay
2008-05-12 14:15:10 +00:00
parent ffdc38e0da
commit 7b68c292f5
3 changed files with 6 additions and 0 deletions
+1
View File
@@ -1,4 +1,5 @@
TODO list
- server/client-side: upload/download make.conf and package.* from portage
- add i18n support
- server-side: improve RDEPEND check output
- server-side: add libtest to reagent
+3
View File
@@ -3234,6 +3234,9 @@ class etpDatabase:
elif name.startswith("sqlite_"):
continue
else:
t_cmd = "CREATE TABLE"
if sql.startswith(t_cmd):
sql = "CREATE TABLE IF NOT EXISTS"+sql[len(t_cmd):]
dumpfile.write("%s;\n" % sql)
self.cursor.execute("PRAGMA table_info('%s')" % name)
+2
View File
@@ -5831,6 +5831,8 @@ class RepoInterface:
if os.path.isfile(dbfile):
os.remove(dbfile)
dbconn = self.Entropy.openGenericDatabase(dbfile, xcache = False, indexing_override = False)
#dbconn.initializeDatabase()
#dbconn.createAllIndexes()
rc = dbconn.doDatabaseImport(dumpfile, dbfile)
dbconn.closeDB()
del dbconn