[packagekit] packagekit: Branch 'master' - 12 commits

Richard Hughes hughsient at kemper.freedesktop.org
Mon Nov 12 00:02:44 PST 2007


 .gitignore                               |    5 +--
 backends/conary/helpers/conaryBackend.py |   37 +++++++++++++++++++++-
 backends/conary/helpers/get-files.py     |   18 +++++++++++
 backends/conary/helpers/resolve.py       |   19 +++++++++++
 backends/conary/pk-backend-conary.c      |    6 +--
 configure.ac                             |    2 +
 libpackagekit/wscript_build              |   10 ++++--
 src/Makefile.am                          |    1 
 src/pk-security-polkit.c                 |    2 -
 src/pk-transaction-db.c                  |    2 -
 src/wscript_build                        |   50 +++++++++++++++----------------
 tools/create-coverage-report.sh          |    4 ++
 wscript                                  |   35 +++++++++++++++++++--
 13 files changed, 150 insertions(+), 41 deletions(-)

New commits:
commit 5a82e87a50fdbe6a340bb125df04e5af03953de7
Merge: 68c4eb5... 063d0f8...
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Nov 12 07:53:11 2007 +0000

    Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit

commit 063d0f8ea78c0b8b5d106b11c81478cfa0bf293d
Author: Ken VanDine <ken at vandine.org>
Date:   Sun Nov 11 22:47:31 2007 -0500

    s/client./self.client./g

diff --git a/backends/conary/helpers/conaryBackend.py b/backends/conary/helpers/conaryBackend.py
index 2df4375..c5e2fa3 100644
--- a/backends/conary/helpers/conaryBackend.py
+++ b/backends/conary/helpers/conaryBackend.py
@@ -181,7 +181,7 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
                                 if troveSource.hasTrove(*x)])
             for n, v, f in troves:
                 for (pathId, path, fileId, version, file) in \
-                    client.db.iterFilesInTrove(n, v, f, sortByPath = True,
+                    self.client.db.iterFilesInTrove(n, v, f, sortByPath = True,
                                                         withFiles = True):
                     files.append(path)
             return files
@@ -189,9 +189,9 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         name, version, flavor, installed = self._findPackage(package_id)
 
         if installed == INFO_INSTALLED:
-            files = _get_files(client.db, name, version, flavor)
+            files = _get_files(self.client.db, name, version, flavor)
         else:
-            files = _get_files(client.repos, name, version, flavor)
+            files = _get_files(self.client.repos, name, version, flavor)
 
         self.files(package_id, ';'.join(files))
 
commit 68c4eb5fd9e6fc9774f63094ce010a6f9adec866
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Nov 11 22:56:47 2007 +0000

    update gitignore

diff --git a/.gitignore b/.gitignore
index 541e2d3..2fe6525 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,7 +27,7 @@ version.h
 intl
 macros
 INSTALL
-PackageKit-*.tar.gz
+PackageKit-*.tar.*
 org.freedesktop.PackageKit.conf
 xml-i18n-extract.in
 xml-i18n-extract
@@ -54,6 +54,7 @@ NEWS.new
 *.txt
 .lock-wscript
 .waf-*
-build
+_build_
 waf-lightc
+wafadmin
 
commit d81126f026fe3dc757a9afca600b906571c52338
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Nov 11 22:44:39 2007 +0000

    fix make check

diff --git a/src/pk-security-polkit.c b/src/pk-security-polkit.c
index 507a75b..971e43c 100644
--- a/src/pk-security-polkit.c
+++ b/src/pk-security-polkit.c
@@ -281,7 +281,7 @@ libst_security (LibSelfTest *test)
 	/************************************************************/
 	libst_title (test, "map valid role to action");
 	action = pk_security_role_to_action (security, PK_ROLE_ENUM_UPDATE_PACKAGE);
-	if (pk_strequal (action, "org.freedesktop.packagekit.update") == TRUE) {
+	if (pk_strequal (action, "org.freedesktop.packagekit.update-package") == TRUE) {
 		libst_success (test, NULL, error);
 	} else {
 		libst_failed (test, "did not get correct action '%s'", action);
commit daa680370fa2e7467d97d7a3dc9a1fe58a0b7329
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Nov 11 22:39:57 2007 +0000

    add the start of the selftest code into the waf build

diff --git a/libpackagekit/wscript_build b/libpackagekit/wscript_build
index 44e7f2e..4564fb5 100644
--- a/libpackagekit/wscript_build
+++ b/libpackagekit/wscript_build
@@ -69,6 +69,12 @@ install_files('PREFIX', 'include/packagekit',"""
 	pk-polkit-client.h
 """)
 
-
-#TODO: if Params.g_options.tests then add the self test program: pk-self-test.c and all the libs above and execute the pk-self-test application
+#TODO: do not install this file!!!
+if Params.g_options.tests:
+	obj = bld.create_obj('cc', 'program')
+	obj.source = libpackagekit.source + ' pk-self-test.c'
+	obj.uselib = 'GLIB GOBJECT DBUS_GLIB POLKIT_DBUS GTHREAD'
+	obj.uselib_local = 'libpackagekit'
+	obj.target = 'pk-self-test'
+	obj.includes = '. ../libselftest ../libgbus'
 
diff --git a/src/wscript_build b/src/wscript_build
index d7e65ca..1f25162 100644
--- a/src/wscript_build
+++ b/src/wscript_build
@@ -9,15 +9,12 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 
-#create the daemon
-obj = bld.create_obj('gnome', 'program')
-obj.source='''
+common_source='''
 pk-backend.c
 pk-backend-python.c
 pk-conf.c
 pk-engine.c
 pk-inhibit.c
-pk-main.c
 pk-spawn.c
 pk-thread-list.c
 pk-time.c
@@ -26,6 +23,21 @@ pk-transaction-id.c
 pk-transaction-list.c
 '''
 
+if defines.get('SECURITY_TYPE_POLKIT', False):
+    common_source += '''
+	pk-security-polkit.c
+'''
+
+if defines.get('SECURITY_TYPE_DUMMY', False):
+    common_source += '''
+	pk-security-dummy.c
+'''
+
+#create the daemon
+obj = bld.create_obj('gnome', 'program')
+obj.source = common_source + ' pk-main.c'
+#TODO: needs to be installed in /usr/sbin/packagekitd not /usr/bin/packagekitd
+
 defines = bld.env()['defines']
 
 obj.includes='. ../libpackagekit ../libselftest'
@@ -37,18 +49,9 @@ obj.add_dbus_file('pk-interface.xml', 'pk_engine', 'glib-server')
 obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--header')
 obj.add_marshal_file('pk-marshal.list', 'pk_marshal', '--body')
 #obj.env.append_value('CCDEFINES', 'LOCALSTATEDIR="%s"' % obj.env['LOCALSTATEDIR'])
-obj.env.append_value('CCDEFINES', 'DATABASEDIR=PK_DB_DIR')
 
 if defines.get('SECURITY_TYPE_POLKIT', False):
     obj.uselib += ' POLKIT_DBUS'
-    obj.source += '''
-	pk-security-polkit.c
-'''
-
-if defines.get('SECURITY_TYPE_DUMMY', False):
-    obj.source += '''
-	pk-security-dummy.c
-'''
 
 # install backend headers to /usr/include/packagekit-backends/
 install_files('PREFIX', 'include/packagekit-backends', '''
@@ -56,17 +59,14 @@ install_files('PREFIX', 'include/packagekit-backends', '''
 	pk-backend-python.h
 ''')
 
-import Runner, Common
-
-#create and process the gcov output, TODO: pipe to a file
-if Params.g_options.gcov:
-	command = '../tools/create-coverage-report.sh packagekit %s' % obj.source
-	ret = Runner.exec_command(command)
-
-#create gprof output, TODO: pipe to a file
-if Params.g_options.gprof:
-	command = 'gprof .libs/pk-self-test'
-	ret = Runner.exec_command(command)
+#TODO: do not install this file!!!
+if Params.g_options.tests:
+	selftest = bld.create_obj('cc', 'program')
+	selftest.source = common_source + ' pk-self-test.c'
+	selftest.uselib = 'DBUS_GLIB GMODULE SQLITE GTHREAD GOBJECT POLKIT_DBUS'
+	selftest.uselib_local = 'libpackagekit'
+	selftest.target = 'pk-self-test'
+	selftest.includes = '. ../libselftest ../libpackagekit'
 
-#TODO: if Params.g_options.tests then add the self test program: pk-self-test.c and all the libs above and execute the pk-self-test application
+#TODO: we really want a /src shutdown() method....
 
diff --git a/wscript b/wscript
index a9e9390..9d68a56 100644
--- a/wscript
+++ b/wscript
@@ -86,7 +86,6 @@ def configure(conf):
 
         assert conf.env['SYSCONFDIR'], "You have too old WAF; please update to trunk"
 
-	conf.add_define('PK_CONF_DIR', os.path.join(conf.env['SYSCONFDIR'], 'PackageKit'))
 	conf.add_define('PK_DB_DIR', os.path.join(conf.env['DATADIR'], 'lib', 'PackageKit'))
 	conf.add_define('PK_PLUGIN_DIR', os.path.join(conf.env['LIBDIR'], 'packagekit-backend'))
 
@@ -144,13 +143,13 @@ def gcov_report():
 	os.chdir(blddir)
 	try:
 		#from http://code.nsnam.org/ns-3-dev/file/c21093326f8d/wscript
-		command = "rm -f gcov.txt"
+		command = 'rm -f gcov.txt'
 		if subprocess.Popen(command, shell=True).wait():
 			raise SystemExit(1)
-		command = "../src/pk-self-test'
+		command = '../src/pk-self-test'
 		if subprocess.Popen(command, shell=True).wait():
 			raise SystemExit(1)
-		command = "../tools/create-coverage-report.sh packagekit src/*.c'
+		command = '../tools/create-coverage-report.sh packagekit src/*.c'
 		if subprocess.Popen(command, shell=True).wait():
 			raise SystemExit(1)
 	finally:
commit 5f64e69ab844303af9ff19f25978b205af04dfdb
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Nov 11 22:31:17 2007 +0000

    use the AC constant directly in the C file

diff --git a/configure.ac b/configure.ac
index e507913..75c2e85 100755
--- a/configure.ac
+++ b/configure.ac
@@ -429,6 +429,8 @@ AC_SUBST(PK_PLUGIN_DIR, "\$(libdir)/packagekit-backend")
 AC_SUBST(PK_PLUGIN_CFLAGS, "-I\$(top_srcdir)/src -I\$(top_srcdir)/libpackagekit $GLIB_CFLAGS $DBUS_CFLAGS $GMODULE_CFLAGS")
 AC_SUBST(PK_PLUGIN_LIBS, "$GLIB_LIBS $DBUS_LIBS $GMODULE_LIBS")
 
+AC_DEFINE(PK_DB_DIR, "$(localstatedir)/lib/PackageKit", [database dir])
+
 AM_CONDITIONAL(BACKEND_TYPE_DUMMY, [test x$with_default_backend = xdummy], [using dummy backend])
 AM_CONDITIONAL(BACKEND_TYPE_APT, [test x$with_default_backend = xapt], [using APT backend])
 AM_CONDITIONAL(BACKEND_TYPE_YUM, [test x$with_default_backend = xyum], [using YUM backend])
diff --git a/src/Makefile.am b/src/Makefile.am
index c4dbfc1..a9629d8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,7 +24,6 @@ INCLUDES =						\
 	-DVERSION="\"$(VERSION)\"" 			\
 	-DPK_DATA=\"$(pkgdatadir)\"			\
 	-DLOCALSTATEDIR=\""$(localstatedir)"\" 		\
-	-DDATABASEDIR=\""$(PK_DB_DIR)"\"		\
 	-I$(top_srcdir)/libpackagekit			\
 	-I$(top_srcdir)/libselftest			\
 	$(NULL)
diff --git a/src/pk-transaction-db.c b/src/pk-transaction-db.c
index aeb8902..af3633d 100644
--- a/src/pk-transaction-db.c
+++ b/src/pk-transaction-db.c
@@ -46,7 +46,7 @@ static void     pk_transaction_db_init		(PkTransactionDb      *tdb);
 static void     pk_transaction_db_finalize	(GObject        *object);
 
 #define PK_TRANSACTION_DB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_TRANSACTION_DB, PkTransactionDbPrivate))
-#define PK_TRANSACTION_DB_FILE		DATABASEDIR "/transactions.db"
+#define PK_TRANSACTION_DB_FILE		PK_DB_DIR "/transactions.db"
 
 struct PkTransactionDbPrivate
 {
commit bd45f881ff67ed12e2352044be89f52418c3854a
Merge: 1df0fed... 22aff76...
Author: Elliot Peele <elliot at bentlogic.net>
Date:   Sun Nov 11 17:12:50 2007 -0500

    Merge branch 'master' of git+ssh://git.packagekit.org/srv/git/PackageKit

commit 1df0fed5024c9ae2e91233f08afcf32cf6448eac
Author: Elliot Peele <elliot at bentlogic.net>
Date:   Sun Nov 11 16:58:54 2007 -0500

    add support for get_files

diff --git a/backends/conary/helpers/conaryBackend.py b/backends/conary/helpers/conaryBackend.py
index faf72bf..2df4375 100644
--- a/backends/conary/helpers/conaryBackend.py
+++ b/backends/conary/helpers/conaryBackend.py
@@ -172,6 +172,29 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
             self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
                 'Package was not found')
 
+    def get_files(self, package_id):
+        def _get_files(troveSource, n, v, f):
+            files = []
+            troves = [(n, v, f)]
+            trv = troveSource.getTrove(n, v, f)
+            troves.extend([ x for x in trv.iterTroveList(strongRefs=True)
+                                if troveSource.hasTrove(*x)])
+            for n, v, f in troves:
+                for (pathId, path, fileId, version, file) in \
+                    client.db.iterFilesInTrove(n, v, f, sortByPath = True,
+                                                        withFiles = True):
+                    files.append(path)
+            return files
+
+        name, version, flavor, installed = self._findPackage(package_id)
+
+        if installed == INFO_INSTALLED:
+            files = _get_files(client.db, name, version, flavor)
+        else:
+            files = _get_files(client.repos, name, version, flavor)
+
+        self.files(package_id, ';'.join(files))
+
     def update_system(self):
         self.allow_interrupt(True)
         updateItems = self.client.fullUpdateItemList()
diff --git a/backends/conary/helpers/get-files.py b/backends/conary/helpers/get-files.py
new file mode 100755
index 0000000..fe99262
--- /dev/null
+++ b/backends/conary/helpers/get-files.py
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Elliot Peele <elliot at bentlogic.net>
+#
+# Licensed under the GNU General Public License Version 2
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+import sys
+from conaryBackend import PackageKitConaryBackend
+
+package_id = sys.argv[1]
+backend = PackageKitConaryBackend(sys.argv[1:])
+backend.get_files(package_id)
+sys.exit(0)
diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index 98e3a48..f0e9e68 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -70,7 +70,7 @@ PK_BACKEND_OPTIONS (
 	pk_backend_python_cancel,		/* cancel */
 	NULL,					/* get_depends */
 	pk_backend_python_get_description,	/* get_description */
-	NULL,					/* get_files */
+	pk_backend_python_get_files,		/* get_files */
 	NULL,					/* get_requires */
 	NULL,					/* get_update_detail */
 	pk_backend_python_get_updates,		/* get_updates */
commit 22aff7646e60f7a6f20fbdde8876bc36a15715a0
Author: Richard Hughes <richard at hughsie.com>
Date:   Sun Nov 11 21:50:26 2007 +0000

    add some more waf stuff - try to get gcov to work - no luck

diff --git a/tools/create-coverage-report.sh b/tools/create-coverage-report.sh
index c25626e..095ca48 100755
--- a/tools/create-coverage-report.sh
+++ b/tools/create-coverage-report.sh
@@ -13,8 +13,12 @@ process ()
 {
 	if [ -e ".libs/packagekitd" ]; then
 		gcov $1 &> /dev/null
+	elif [ -e "src/.libs/packagekitd" ]; then
+		gcov $1 &> /dev/null
 	elif [ -e ".libs/libpackagekit.la" ]; then
 		gcov $1 -o .libs &> /dev/null
+	elif [ -e "libpackagekit/.libs/libpackagekit.la" ]; then
+		gcov $1 -o .libs &> /dev/null
 	else
 		return
 	fi
diff --git a/wscript b/wscript
index 8b65503..a9e9390 100644
--- a/wscript
+++ b/wscript
@@ -12,6 +12,7 @@
 import os
 import Params
 import misc
+import shutil
 
 # the following two variables are used by the target "waf dist"
 VERSION='0.1.4'
@@ -21,6 +22,11 @@ APPNAME='PackageKit'
 srcdir = '.'
 blddir = '_build_'
 
+def dist_hook():
+	shutil.rmtree("wafadmin", True)
+	#TODO: why doesn't this delete?
+	shutil.rmtree("waf-lightc", True)
+
 def set_options(opt):
 	opt.add_option('--wall', action="store_true", help="stop on compile warnings", dest="wall", default=True)
 	opt.add_option('--packagekit-user', type='string', help="User for running the PackageKit daemon", dest="user", default='root')
@@ -92,7 +98,12 @@ def configure(conf):
 	if Params.g_options.wall:
 		conf.env.append_value('CPPFLAGS', '-Wall -Werror -Wcast-align -Wno-uninitialized')
 	if Params.g_options.gcov:
-		conf.env.append_value('CFLAGS', '-fprofile-arcs -ftest-coverage')
+		conf.env.append_value('CFLAGS', '-fprofile-arcs')
+		conf.env.append_value('CFLAGS', '-ftest-coverage')
+		conf.env.append_value('CXXFLAGS', '-fprofile-arcs')
+		conf.env.append_value('CXXFLAGS', '-ftest-coverage')
+		conf.env.append_value('LINKFLAGS', '-fprofile-arcs')
+
 	if Params.g_options.gprof:
 		conf.env.append_value('CFLAGS', '-fprofile-arcs -ftest-coverage')
 
@@ -123,6 +134,25 @@ def build(bld):
 	obj.install_subdir = 'etc/dbus-1/system.d'
 
 def shutdown():
-	# this piece of code may be move right after the pixmap or documentation installation
+	#TODO: why ohh why doesn't this work?
+	if Params.g_options.gcov:
+		gcov_report()
 	pass
 
+def gcov_report():
+	env = Params.g_build.env_of_name('default')
+	os.chdir(blddir)
+	try:
+		#from http://code.nsnam.org/ns-3-dev/file/c21093326f8d/wscript
+		command = "rm -f gcov.txt"
+		if subprocess.Popen(command, shell=True).wait():
+			raise SystemExit(1)
+		command = "../src/pk-self-test'
+		if subprocess.Popen(command, shell=True).wait():
+			raise SystemExit(1)
+		command = "../tools/create-coverage-report.sh packagekit src/*.c'
+		if subprocess.Popen(command, shell=True).wait():
+			raise SystemExit(1)
+	finally:
+		os.chdir("..")
+
commit c9877abfc786204e27157cfbf2773c5551079c20
Author: Elliot Peele <elliot at bentlogic.net>
Date:   Sat Nov 10 21:57:18 2007 -0500

    actual enable the correct method

diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index 46b4d37..98e3a48 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -67,7 +67,7 @@ PK_BACKEND_OPTIONS (
 	NULL,					/* destroy */
 	backend_get_groups,			/* get_groups */
 	backend_get_filters,			/* get_filters */
-	NULL,					/* cancel */
+	pk_backend_python_cancel,		/* cancel */
 	NULL,					/* get_depends */
 	pk_backend_python_get_description,	/* get_description */
 	NULL,					/* get_files */
@@ -81,7 +81,7 @@ PK_BACKEND_OPTIONS (
 	pk_backend_python_resolve,		/* resolve */
 	NULL,					/* search_details */
 	NULL,					/* rollback */
-	pk_backend_python_cancel,		/* search_file */
+	NULL,					/* search_file */
 	NULL,					/* search_group */
 	pk_backend_python_search_name,		/* search_name */
 	pk_backend_python_update_package,	/* update_package */
commit ab2c03dbf555ccb5b9c221e152089e86b944a7cd
Author: Elliot Peele <elliot at bentlogic.net>
Date:   Sat Nov 10 21:53:59 2007 -0500

    enable backend cancel now that more allow_interrupt calls are in place

diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index 4a71e90..46b4d37 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -78,10 +78,10 @@ PK_BACKEND_OPTIONS (
 	NULL,					/* install_file */
 	pk_backend_python_refresh_cache,	/* refresh_cache */
 	pk_backend_python_remove_package,	/* remove_package */
-	pk_backend_python_resolve,	/* resolve */
+	pk_backend_python_resolve,		/* resolve */
 	NULL,					/* search_details */
 	NULL,					/* rollback */
-	NULL,					/* search_file */
+	pk_backend_python_cancel,		/* search_file */
 	NULL,					/* search_group */
 	pk_backend_python_search_name,		/* search_name */
 	pk_backend_python_update_package,	/* update_package */
commit b605a0ac49b276d419a92d484a639394a038473a
Author: Elliot Peele <elliot at bentlogic.net>
Date:   Sat Nov 10 21:48:25 2007 -0500

    add resolve support
    a few cleanups

diff --git a/backends/conary/helpers/conaryBackend.py b/backends/conary/helpers/conaryBackend.py
index 69bae50..faf72bf 100644
--- a/backends/conary/helpers/conaryBackend.py
+++ b/backends/conary/helpers/conaryBackend.py
@@ -107,6 +107,7 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         suggMap = self.client.prepareUpdateJob(updJob, applyList)
 
         if apply:
+            self.allow_interrupt(False)
             restartDir = self.client.applyUpdateJob(updJob)
 
         return updJob, suggMap
@@ -119,6 +120,10 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         updJob, suggMap = self._do_update(applyList, apply=apply)
         return updJob, suggMap
 
+    def resolve(self, filter, package):
+        self.allow_interrupt(True)
+        self._do_search(package, filter)
+
     def check_installed(self, troveTuple):
         db = conaryclient.ConaryClient(self.cfg).db
         try:
@@ -168,6 +173,7 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
                 'Package was not found')
 
     def update_system(self):
+        self.allow_interrupt(True)
         updateItems = self.client.fullUpdateItemList()
         applyList = [ (x[0], (None, None), x[1:], True) for x in updateItems ]
         updJob, suggMap = self._do_update(applyList, apply=True)
@@ -183,6 +189,8 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         '''
         name, version, flavor, installed = self._findPackage(package_id)
 
+        self.allow_interrupt(True)
+
         if name:
             if installed == INFO_INSTALLED:
                 self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
@@ -202,6 +210,8 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         '''
         name, version, flavor, installed = self._findPackage(package_id)
 
+        self.allow_interrupt(True)
+
         if name:
             if not installed == INFO_INSTALLED:
                 self.error(ERROR_PACKAGE_NOT_INSTALLED,
@@ -247,8 +257,6 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         '''
         name, version, flavor, installed = self._findPackage(id)
 
-
-
         if name:
             shortDesc = self._get_metadata(id, 'shortDesc') or name
             longDesc = self._get_metadata(id, 'longDesc') or ""
@@ -266,7 +274,7 @@ class PackageKitConaryBackend(PackageKitBaseBackend):
         summary = ""
         self.package(id, status, summary)
 
-    def _get_status(self,notice):
+    def _get_status(self, notice):
         # We need to figure out how to get this info, this is a place holder
         #ut = notice['type']
         # TODO : Add more types to check
diff --git a/backends/conary/helpers/resolve.py b/backends/conary/helpers/resolve.py
new file mode 100755
index 0000000..4de412f
--- /dev/null
+++ b/backends/conary/helpers/resolve.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Elliot Peele <elliot at bentlogic.net>
+#
+# Licensed under the GNU General Public License Version 2
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+import sys
+from conaryBackend import PackageKitConaryBackend
+
+filter = sys.argv[1]
+package = sys.argv[2]
+backend = PackageKitConaryBackend(sys.argv[1:])
+backend.resolve(filter, package)
+sys.exit(0)
diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index 0558e24..4a71e90 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -78,7 +78,7 @@ PK_BACKEND_OPTIONS (
 	NULL,					/* install_file */
 	pk_backend_python_refresh_cache,	/* refresh_cache */
 	pk_backend_python_remove_package,	/* remove_package */
-	NULL,					/* resolve */
+	pk_backend_python_resolve,	/* resolve */
 	NULL,					/* search_details */
 	NULL,					/* rollback */
 	NULL,					/* search_file */



More information about the PackageKit mailing list