From ea645508304f0d589b003d9fcc6ccc0f0c13bcdb Mon Sep 17 00:00:00 2001 From: lxnay Date: Tue, 27 May 2008 14:09:24 +0000 Subject: [PATCH] Entropy/Repository Service: - fix database handling when reloading the interface data git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1996 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/entropy.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/entropy.py b/libraries/entropy.py index 6ed2d0c78..ee54fadf1 100644 --- a/libraries/entropy.py +++ b/libraries/entropy.py @@ -15502,7 +15502,8 @@ class RepositorySocketServerInterface(SocketHostInterface): if os.path.isfile(self.repositories[x]['download_lock']) and \ not self.repositories[x]['locked']: self.repositories[x]['locked'] = True - self.close_db(self.repositories[x]['dbpath']) + mydbpath = os.path.join(self.repositories[x]['dbpath'],etpConst['etpdatabasefile']) + self.close_db(mydbpath) do_lock.add(repository) mytxt = blue("%s.") % (_("database got locked. Locking services for it"),) self.updateProgress( @@ -15515,6 +15516,8 @@ class RepositorySocketServerInterface(SocketHostInterface): ) elif not os.path.isfile(self.repositories[x]['download_lock']) and \ self.repositories[x]['locked']: + mydbpath = os.path.join(self.repositories[x]['dbpath'],etpConst['etpdatabasefile']) + self.close_db(mydbpath) mytxt = blue("%s.") % (_("unlocking and indexing database"),) self.updateProgress( "[%s] %s" % ( @@ -15525,7 +15528,6 @@ class RepositorySocketServerInterface(SocketHostInterface): type = "info" ) # woohoo, got unlocked eventually - mydbpath = os.path.join(self.repositories[x]['dbpath'],etpConst['etpdatabasefile']) mydb = self.open_db(mydbpath) mydb.createAllIndexes() mydb.commitChanges() @@ -17240,6 +17242,7 @@ class ServerMirrorsInterface: dbconn = self.Entropy.openServerDatabase(read_only = False, no_upload = True, repo = repo, indexing = False) dbconn.dropAllIndexes() dbconn.vacuum() + dbconn.vacuum() dbconn.commitChanges() self.Entropy.close_server_database(dbconn)