[packagekit] packagekit: Branch 'master' - 7 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Sun Mar 9 11:38:13 PDT 2008
backends/yum2/helpers/testyum2.py | 2 +-
backends/yum2/helpers/yumDBUSBackend.py | 6 ++++--
data/org.freedesktop.PackageKitAptBackend.conf.in | 2 +-
data/org.freedesktop.PackageKitTestBackend.conf.in | 2 +-
data/org.freedesktop.PackageKitYumBackend.conf.in | 2 +-
python/packagekit/daemonBackend.py | 15 ++++++++++-----
python/packagekit/frontend.py | 4 ++--
src/pk-engine.c | 2 +-
8 files changed, 21 insertions(+), 14 deletions(-)
New commits:
commit 97b6bece9382a16539e8539780b6f9d620027eab
Author: Sebastian Heinlein <sebi at glatzor.de>
Date: Sun Mar 9 18:13:32 2008 +0100
Use the backend user in the backends' dbus configuration files
diff --git a/data/org.freedesktop.PackageKitAptBackend.conf.in b/data/org.freedesktop.PackageKitAptBackend.conf.in
index cb28be4..e579501 100644
--- a/data/org.freedesktop.PackageKitAptBackend.conf.in
+++ b/data/org.freedesktop.PackageKitAptBackend.conf.in
@@ -2,7 +2,7 @@
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
- <policy user="@PACKAGEKIT_USER@">
+ <policy user="@PK_BACKEND_USER@">
<allow own="org.freedesktop.PackageKitAptBackend"/>
<allow send_destination="org.freedesktop.PackageKitAptBackend"/>
<allow send_interface="org.freedesktop.PackageKitBackend"/>
diff --git a/data/org.freedesktop.PackageKitTestBackend.conf.in b/data/org.freedesktop.PackageKitTestBackend.conf.in
index fbcfbcf..9047a07 100644
--- a/data/org.freedesktop.PackageKitTestBackend.conf.in
+++ b/data/org.freedesktop.PackageKitTestBackend.conf.in
@@ -2,7 +2,7 @@
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
- <policy user="@PACKAGEKIT_USER@">
+ <policy user="@PK_BACKEND_USER@">
<allow own="org.freedesktop.PackageKitTestBackend"/>
<allow send_destination="org.freedesktop.PackageKitTestBackend"/>
<allow send_interface="org.freedesktop.PackageKitBackend"/>
diff --git a/data/org.freedesktop.PackageKitYumBackend.conf.in b/data/org.freedesktop.PackageKitYumBackend.conf.in
index 9a367f6..6d638c0 100644
--- a/data/org.freedesktop.PackageKitYumBackend.conf.in
+++ b/data/org.freedesktop.PackageKitYumBackend.conf.in
@@ -2,7 +2,7 @@
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
- <policy user="@PACKAGEKIT_USER@">
+ <policy user="@PK_BACKEND_USER@">
<allow own="org.freedesktop.PackageKitYumBackend"/>
<allow send_destination="org.freedesktop.PackageKitYumBackend"/>
<allow send_interface="org.freedesktop.PackageKitBackend"/>
commit ea52aa4b047d18d47a5f2ab94a53f82076e83b32
Author: Sebastian Heinlein <sebi at glatzor.de>
Date: Sun Mar 9 17:25:50 2008 +0100
Fix GetUpdates call in the python frontend
diff --git a/python/packagekit/frontend.py b/python/packagekit/frontend.py
index a094f07..f0e87db 100644
--- a/python/packagekit/frontend.py
+++ b/python/packagekit/frontend.py
@@ -164,12 +164,12 @@ class PackageKit(PackageKitDbusInterface):
@dbusException
@job_id
- def GetUpdates(self):
+ def GetUpdates(self, filter="none"):
"""
Lists packages which could be updated.
Causes 'Package' signals for each available package.
"""
- return self.pk_iface.GetUpdates(self.tid())
+ return self.pk_iface.GetUpdates(self.tid(), filter)
@dbusException
@job_id
commit ac689c1abcfd63de7bfd34a06bf2f4b9a0ff2e9c
Author: Sebastian Heinlein <sebi at glatzor.de>
Date: Sun Mar 9 17:25:24 2008 +0100
Dbus backend logs to syslog by default
diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index 4f3ad1c..4386c23 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -23,6 +23,7 @@
# imports
import logging
+import logging.handlers
import os
import signal
import sys
@@ -42,6 +43,11 @@ logging.basicConfig(format="%(levelname)s:%(message)s")
pklog = logging.getLogger("PackageKitBackend")
pklog.setLevel(logging.DEBUG)
+syslog = logging.handlers.SysLogHandler(facility=logging.handlers.SysLogHandler.LOG_DAEMON, address='/dev/log')
+formatter = logging.Formatter('PackageKit: %(levelname)s: %(message)s')
+syslog.setFormatter(formatter)
+pklog.addHandler(syslog)
+
# Classes
# This is common between backends
commit b5183a425974ab5084fc3547e21332f3d7a627e8
Author: Sebastian Heinlein <sebi at glatzor.de>
Date: Sun Mar 9 15:50:28 2008 +0100
YUM2: Fix the GetUpdates call in testyum
diff --git a/backends/yum2/helpers/testyum2.py b/backends/yum2/helpers/testyum2.py
index 30827cf..23526ef 100755
--- a/backends/yum2/helpers/testyum2.py
+++ b/backends/yum2/helpers/testyum2.py
@@ -43,7 +43,7 @@ try:
iface.Init()
if cmd == 'get-updates' or cmd == 'all':
print "Testing GetUpdate()"
- iface.GetUpdates()
+ iface.GetUpdates(FILTER_NONE)
if cmd == 'search-name' or cmd == 'all':
print "Testing SearchName(FILTER_NONE,'yum')"
iface.SearchName(FILTER_NONE,'yum')
commit 2e225fa3b109427b1d734921448956124e148a25
Author: Sebastian Heinlein <sebi at glatzor.de>
Date: Sun Mar 9 16:14:38 2008 +0100
- Rename INACTIVE_CHECK_TIMEOUT to INACTIVE_CHECK_INTERVAL
- The INACTIVE_TIMEOUT has to specified in seconds
- Raise log level of the "Exiting due to timeout" message to critical
diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index 261de3b..4f3ad1c 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -48,8 +48,8 @@ pklog.setLevel(logging.DEBUG)
PACKAGEKIT_DBUS_INTERFACE = 'org.freedesktop.PackageKitBackend'
PACKAGEKIT_DBUS_PATH = '/org/freedesktop/PackageKitBackend'
-INACTIVE_CHECK_TIMEOUT = 1000 * 60 * 5 # Check every 5 minutes.
-INACTIVE_TIMEOUT = 1000 * 60 * 10 # timeout after 10 minutes of inactivity.
+INACTIVE_CHECK_INTERVAL = 1000 * 60 * 5 # Check every 5 minutes.
+INACTIVE_TIMEOUT = 60 * 10 # timeout after 10 minutes of inactivity.
class PackageKitBaseBackend(dbus.service.Object):
@@ -85,16 +85,15 @@ class PackageKitBaseBackend(dbus.service.Object):
self.loop = gobject.MainLoop()
- gobject.timeout_add(INACTIVE_CHECK_TIMEOUT, self.check_for_inactivity)
+ gobject.timeout_add(INACTIVE_CHECK_INTERVAL, self.check_for_inactivity)
self.last_action_time = time.time()
self.loop.run()
def check_for_inactivity(self):
if time.time() - self.last_action_time > INACTIVE_TIMEOUT:
- pklog.info("Exiting due to timeout.")
+ pklog.critical("Exiting due to timeout.")
self.Exit()
-
return True
def forkme(self):
commit df4498137bff85a1bcd742082f9c96b46383ae7f
Author: Robin Norwood <rnorwood at redhat.com>
Date: Fri Mar 7 12:49:32 2008 -0500
Add new param to log message.
diff --git a/src/pk-engine.c b/src/pk-engine.c
index 6ee8109..be78c8f 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -1700,7 +1700,7 @@ pk_engine_remove_package (PkEngine *engine, const gchar *tid, const gchar *packa
g_return_if_fail (engine != NULL);
g_return_if_fail (PK_IS_ENGINE (engine));
- pk_debug ("RemovePackage method called: %s, %s, %i", tid, package_id, allow_deps);
+ pk_debug ("RemovePackage method called: %s, %s, %i, %i", tid, package_id, allow_deps, autoremove);
/* find pre-requested transaction id */
item = pk_transaction_list_get_from_tid (engine->priv->transaction_list, tid);
commit f37d6eff0912b4daec3bec1d0d6c1dbbe7c71089
Author: Robin Norwood <rnorwood at redhat.com>
Date: Fri Mar 7 12:49:14 2008 -0500
Fix error message, and reattach yumbase to self.yumbase.
diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index b2a15fd..839b687 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -307,7 +307,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
def doInit(self):
print "Now in doInit()"
- self.yumbase = PackageKitYumBase()
+ # yumbase is defined outside of this class so the sigquit handler can close the DB.
+ yumbase = PackageKitYumBase()
+ self.yumbase = yumbase
print "new yumbase object"
self._setup_yum()
print "yum set up"
@@ -1497,7 +1499,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self.Finished(EXIT_FAILED)
return False
except yum.Errors.YumBaseError, ye:
- retmsg = "Error in Transaction Processing\n" + "\n".join(ye.value)
+ retmsg = "Error in Transaction Processing\n" + ye.value
self._unlock_yum()
self.ErrorCode(ERROR_TRANSACTION_ERROR,retmsg)
self.Finished(EXIT_FAILED)
More information about the PackageKit
mailing list