[packagekit] packagekit: Branch 'master' - 2 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Tue Nov 6 14:49:53 PST 2007
backends/conary/helpers/conaryBackend.py | 6 +++---
backends/dummy/.gitignore | 4 ++++
backends/pisi/helpers/pisiBackend.py | 6 +++---
backends/test/.gitignore | 4 ++++
backends/yum/helpers/yumBackend.py | 20 ++++++++++----------
python/packagekit/backend.py | 2 +-
6 files changed, 25 insertions(+), 17 deletions(-)
New commits:
commit ee4800d2c8bbf94ce21f85fecc38f4cae2fe70b8
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Nov 6 22:48:51 2007 +0000
harmonise the C and python constants to fix the yum backend
diff --git a/backends/conary/helpers/conaryBackend.py b/backends/conary/helpers/conaryBackend.py
index 7a0c3a7..0dd7343 100644
--- a/backends/conary/helpers/conaryBackend.py
+++ b/backends/conary/helpers/conaryBackend.py
@@ -188,7 +188,7 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
'Package already installed')
try:
- self.status(STATE_INSTALL)
+ self.status(STATUS_INSTALL)
self._do_package_update(name, version, flavor, apply=True)
except:
pass
@@ -207,7 +207,7 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
self.error(ERROR_PACKAGE_NOT_INSTALLED,
'Package not installed')
try:
- self.status(STATE_REMOVE)
+ self.status(STATUS_REMOVE)
name = '-%s' % name
self._do_package_update(name, version, flavor, apply=True)
except:
@@ -395,7 +395,7 @@ class Cache(object):
# Create all tables if database is empty
if len(tbllist) == 0:
self._create_database()
- backend.status(STATE_WAIT)
+ backend.status(STATUS_WAIT)
self.populate_database()
return True
diff --git a/backends/pisi/helpers/pisiBackend.py b/backends/pisi/helpers/pisiBackend.py
index ca4482d..4b308e8 100644
--- a/backends/pisi/helpers/pisiBackend.py
+++ b/backends/pisi/helpers/pisiBackend.py
@@ -250,7 +250,7 @@ class PackageKitPisiBackend(PackageKitBaseBackend):
self.percentage(None)
try:
- self.status(STATE_INSTALL)
+ self.status(STATUS_INSTALL)
pisi.api.install([file])
except pisi.Error,e:
# FIXME: Error: internal-error : Package re-install declined
@@ -266,7 +266,7 @@ class PackageKitPisiBackend(PackageKitBaseBackend):
package = self.get_package_from_id(package_id)[0]
if self.packagedb.has_package(package):
- self.status(STATE_INSTALL)
+ self.status(STATUS_INSTALL)
try:
pisi.api.install([package])
except pisi.Error,e:
@@ -297,7 +297,7 @@ class PackageKitPisiBackend(PackageKitBaseBackend):
package = self.get_package_from_id(package_id)[0]
if self.installdb.has_package(package):
- self.status(STATE_REMOVE)
+ self.status(STATUS_REMOVE)
try:
pisi.api.remove([package])
except pisi.Error,e:
diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 3f8d07e..085acdd 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -260,7 +260,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
PackageKitBaseBackend.doLock(self)
except:
if retries == 0:
- self.status(STATE_WAIT)
+ self.status(STATUS_WAIT)
time.sleep(2)
retries += 1
if retries > 100:
@@ -1177,18 +1177,18 @@ class PackageKitCallback(RPMBaseCallback):
TS_ERASE: INFO_REMOVING,
TS_INSTALL: INFO_INSTALLING,
TS_TRUEINSTALL : INFO_INSTALLING,
- TS_OBSOLETED: INFO_OBSOLETE,
+ TS_OBSOLETED: INFO_OBSOLETING,
TS_OBSOLETING: INFO_INSTALLING,
TS_UPDATED: INFO_CLEANUP}
# Map yum transactions with pk state enums
- self.state_actions = { TS_UPDATE : STATE_UPDATE,
- TS_ERASE: STATE_REMOVE,
- TS_INSTALL: STATE_INSTALL,
- TS_TRUEINSTALL : STATE_INSTALL,
- TS_OBSOLETED: STATE_OBSOLETE,
- TS_OBSOLETING: STATE_INSTALL,
- TS_UPDATED: STATE_CLEANUP}
+ self.state_actions = { TS_UPDATE : STATUS_UPDATE,
+ TS_ERASE: STATUS_REMOVE,
+ TS_INSTALL: STATUS_INSTALL,
+ TS_TRUEINSTALL : STATUS_INSTALL,
+ TS_OBSOLETED: STATUS_OBSOLETE,
+ TS_OBSOLETING: STATUS_INSTALL,
+ TS_UPDATED: STATUS_CLEANUP}
def _calcTotalPct(self,ts_current,ts_total):
bump = float(self.numPct)/ts_total
@@ -1227,7 +1227,7 @@ class ProcessTransPackageKitCallback:
if state == PT_DOWNLOAD: # Start Downloading
self.base.allow_interrupt(True)
self.base.percentage(10)
- self.base.status(STATE_DOWNLOAD)
+ self.base.status(STATUS_DOWNLOAD)
if state == PT_DOWNLOAD_PKGS: # Packages to download
self.base.dnlCallback.setPackages(data,10,30)
elif state == PT_GPGCHECK:
diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index 14de99a..ed35542 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -86,7 +86,7 @@ class PackageKitBaseBackend:
def status(self,state):
'''
send 'status' signal
- @param state: STATE_DOWNLOAD, STATE_INSTALL, STATE_UPDATE, STATE_REMOVE, STATE_WAIT
+ @param state: STATUS_DOWNLOAD, STATUS_INSTALL, STATUS_UPDATE, STATUS_REMOVE, STATUS_WAIT
'''
print >> sys.stderr,"status\t%s" % (state)
commit 7c6636218f78f2a11a934d3fa7de7bf1bdfb289b
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Nov 6 22:33:02 2007 +0000
update gitignore
diff --git a/backends/dummy/.gitignore b/backends/dummy/.gitignore
index c851833..996fb0d 100644
--- a/backends/dummy/.gitignore
+++ b/backends/dummy/.gitignore
@@ -7,4 +7,8 @@ Makefile.in
*.loT
*.o
*~
+*.gcov
+*.gcda
+*.gcno
+*.out
diff --git a/backends/test/.gitignore b/backends/test/.gitignore
index c851833..996fb0d 100644
--- a/backends/test/.gitignore
+++ b/backends/test/.gitignore
@@ -7,4 +7,8 @@ Makefile.in
*.loT
*.o
*~
+*.gcov
+*.gcda
+*.gcno
+*.out
More information about the PackageKit
mailing list