self.file_cx = sqlite.Connection(self.file_sqlite_file)
self.other_sqlite_file = os.path.join(destdir, 'other.sqlite')
self.other_cx = sqlite.Connection(self.other_sqlite_file)
-
self.primary_cursor = self.pri_cx.cursor()
self.filelists_cursor = self.file_cx.cursor()
def create_primary_db(self):
# make the tables
schema = [
- """PRAGMA synchronous = 0;""",
- """pragma locking_mode = EXCLUSIVE;""",
+ """PRAGMA synchronous="OFF";""",
+ """pragma locking_mode="EXCLUSIVE";""",
"""CREATE TABLE conflicts ( name TEXT, flags TEXT, epoch TEXT, version TEXT, release TEXT, pkgKey INTEGER );""",
"""CREATE TABLE db_info (dbversion INTEGER, checksum TEXT);""",
"""CREATE TABLE files ( name TEXT, type TEXT, pkgKey INTEGER);""",
def create_filelists_db(self):
schema = [
- """PRAGMA synchronous = 0;""",
- """pragma locking_mode = EXCLUSIVE;""",
+ """PRAGMA synchronous="0FF";""",
+ """pragma locking_mode="EXCLUSIVE";""",
"""CREATE TABLE db_info (dbversion INTEGER, checksum TEXT);""",
"""CREATE TABLE filelist ( pkgKey INTEGER, dirname TEXT, filenames TEXT, filetypes TEXT);""",
"""CREATE TABLE packages ( pkgKey INTEGER PRIMARY KEY, pkgId TEXT);""",
def create_other_db(self):
schema = [
- """PRAGMA synchronous = 0;""",
- """pragma locking_mode = EXCLUSIVE;""",
+ """PRAGMA synchronous="OFF";""",
+ """pragma locking_mode="EXCLUSIVE";""",
"""CREATE TABLE changelog ( pkgKey INTEGER, author TEXT, date INTEGER, changelog TEXT);""",
"""CREATE TABLE db_info (dbversion INTEGER, checksum TEXT);""",
"""CREATE TABLE packages ( pkgKey INTEGER PRIMARY KEY, pkgId TEXT);""",
q = """insert into packages values (?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?,
?, ?, ?)"""
-
+
+ # write out all of do_primary_sqlite as an executescript - work on the
+ # quoting for pretty much any contingency - take from sqlutils.py
+ #
+ # e
+ #p = None
+ #q = """insert into packages values (%s, %s, %s, %s, """
+
cur.execute(q, p)
# provides, obsoletes, conflicts
md_sqlite.file_cx.commit()
self.do_other_sqlite_dump(md_sqlite.other_cursor)
md_sqlite.other_cx.commit()
+
import sys
import re
from optparse import OptionParser
+import time
import createrepo
from createrepo import MDError
sys.stdout.flush()
def main(args):
+ start_st = time.time()
conf = createrepo.MetaDataConfig()
conf = parseArgs(args, conf)
+ if conf.verbose:
+ print ('start time: %0.3f' % (time.time() - start_st))
+ mid_st = time.time()
try:
if conf.split:
mdgen = createrepo.SplitMetaDataGenerator(config_obj=conf, callback=MDCallBack())
print _('repo is up to date')
sys.exit(0)
+ if conf.verbose:
+ print ('mid time: %0.3f' % (time.time() - mid_st))
+
+ pm_st = time.time()
mdgen.doPkgMetadata()
+ if conf.verbose:
+ print ('pm time: %0.3f' % (time.time() - pm_st))
+ rm_st = time.time()
mdgen.doRepoMetadata()
+ if conf.verbose:
+ print ('rm time: %0.3f' % (time.time() - rm_st))
+ fm_st = time.time()
mdgen.doFinalMove()
+ if conf.verbose:
+ print ('fm time: %0.3f' % (time.time() - fm_st))
+
except MDError, e:
errorprint(_('%s') % e)