[packagekit] packagekit: Branch 'master'

Richard Hughes hughsient at kemper.freedesktop.org
Fri Oct 12 16:18:20 PDT 2007


 backends/conary/helpers/conaryBackend.py |    3 +++
 python/packagekit/backend.py             |    3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
diff-tree 0e77e7fe56093117dbf5ac0d7d3475e44de3c7df (from 07ea4af627cf09656c9b9c885553fb943e645446)
Author: Ken VanDine <ken at vandine.org>
Date:   Fri Oct 12 16:08:50 2007 -0400

    Added STATE_WAIT, currently used to when a refresh needs to happen before another task

diff --git a/backends/conary/helpers/conaryBackend.py b/backends/conary/helpers/conaryBackend.py
index 5eb2d12..5845500 100644
--- a/backends/conary/helpers/conaryBackend.py
+++ b/backends/conary/helpers/conaryBackend.py
@@ -374,6 +374,7 @@ class Cache(object):
 
     def _validate_tables(self):
         """ Validates that all tables are up to date. """
+        backend = PackageKitBaseBackend(self)
         stmt = ("select tbl_name from sqlite_master "
                 "where type = 'table' and tbl_name like 'conary_%'")
         self.cursor.execute(stmt)
@@ -387,6 +388,8 @@ class Cache(object):
             # Create all tables if database is empty
             if len(tbllist) == 0:
                 self._create_database()
+                backend.status(STATE_WAIT)
+                self.populate_database()
                 return True
 
     def conaryquery(self):
diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index 203987c..9f81afd 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -41,6 +41,7 @@ STATE_DOWNLOAD = "download"
 STATE_INSTALL = "install"
 STATE_UPDATE = "update"
 STATE_REMOVE = "remove"
+STATE_WAIT = "wait"
 
 RESTART_SYSTEM = "system"
 RESTART_APPLICATION = "application"
@@ -104,7 +105,7 @@ class PackageKitBaseBackend:
     def status(self,state):
         '''
         send 'status' signal
-        @param state: STATE_DOWNLOAD, STATE_INSTALL, STATE_UPDATE, STATE_REMOVE
+        @param state: STATE_DOWNLOAD, STATE_INSTALL, STATE_UPDATE, STATE_REMOVE, STATE_WAIT
         '''
         print >> sys.stderr,"status\t%s" % (state)
 



More information about the PackageKit mailing list