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

Richard Hughes hughsient at kemper.freedesktop.org
Mon Sep 24 14:34:18 PDT 2007


 .gitignore                               |    1 
 backends/conary/helpers/conaryBackend.py |    4 +--
 backends/conary/helpers/get-requires.py  |    4 +++
 backends/conary/helpers/remove.py        |    5 ++-
 backends/conary/helpers/update-system.py |    3 ++
 backends/conary/pk-backend-conary.c      |   41 +++++++++++++++++++++++++++++--
 python/__init__.py                       |   16 +++++++++---
 7 files changed, 64 insertions(+), 10 deletions(-)

New commits:
diff-tree 3721b8259149185ce3aa54c51af15e2ae75aa017 (from parents)
Merge: 52228bc2040e551ac48bc567deff2729edef100b cef20b30610c8789ac25d5dfd72a2faa1ed0a2be
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Sep 24 22:32:34 2007 +0100

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

diff-tree cef20b30610c8789ac25d5dfd72a2faa1ed0a2be (from 8880c1e410a0ede07e1d1b23cf8b65555431d266)
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Mon Sep 24 16:38:20 2007 -0400

    - Fix some typos - missing 'self' in object methods
    - Add method handler for 'Description'

diff --git a/python/__init__.py b/python/__init__.py
index 28b7359..6c71eb7 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -115,6 +115,8 @@ class PackageKit:
 			self.Package(args[2],args[3])
 		elif kwargs['member'] in ["NoPercentageUpdates","TransactionListChanged"]:
 			pass
+		elif kwargs['member'] == "Description":
+			self.Description(args[1],args[3],args[4],args[5])
 		else:
 			print "Caught signal %s"% kwargs['member']
 			for arg in args:
@@ -128,6 +130,12 @@ class PackageKit:
 	
 	def Finish(self):
 		pass
+
+	def Package(self,package_name,package_summary):
+		pass
+
+	def Description(self,package_name,package_group,package_description,package_url):
+		pass
 	
 	@dbusException
 	@job_id
@@ -136,13 +144,13 @@ class PackageKit:
 
 	@dbusException
 	@job_id
-	def GetDescription(package_id):
-		return pk_iface.GetDescription(package_id)
+	def GetDescription(self,package_id):
+		return self.pk_iface.GetDescription(package_id)
 
 	@dbusException
 	@job_id
-	def RefreshCache(force=False):
-		return pk_iface.RefreshCache(force)
+	def RefreshCache(self,force=False):
+		return self.pk_iface.RefreshCache(force)
 
 # hack to avoid exporting them
 #del job_id
diff-tree 8880c1e410a0ede07e1d1b23cf8b65555431d266 (from 13a361827f24612376cd9aa3867dda987e4dc347)
Author: Elliot Peele <elliot at bentlogic.net>
Date:   Mon Sep 24 16:15:11 2007 -0400

    filter out no arch

diff --git a/backends/conary/helpers/conaryBackend.py b/backends/conary/helpers/conaryBackend.py
index 42ebbdd..363dcdc 100644
--- a/backends/conary/helpers/conaryBackend.py
+++ b/backends/conary/helpers/conaryBackend.py
@@ -37,7 +37,7 @@ class PackageKitConaryBackend(PackageKit
     def get_package_id(self, name, versionObj, flavor=None):
         version = versionObj.trailingRevision()
         fullVersion = versionObj.asString()
-        if flavor is not None:
+        if flavor is not None and flavor != 'noarch':
             arch = self._get_arch(flavor)
         else:
             arch = ""
diff-tree 13a361827f24612376cd9aa3867dda987e4dc347 (from 79bdb58d7bed6518314251a0297ac9ce93bac6bb)
Author: Ken VanDine <ken at vandine.org>
Date:   Mon Sep 24 16:07:59 2007 -0400

    Whoops, fix the function name

diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index 0dc4ba4..fbacfd0 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -172,8 +172,8 @@ backend_update_system (PkBackend *backen
 }
 
 /**
-   * backend_get_requires:
-    */
+ * backend_get_requires:
+ */
 static void
 backend_get_requires (PkBackend *backend, const gchar *package_id)
 {
@@ -193,7 +193,7 @@ PK_BACKEND_OPTIONS (
 	NULL,					/* cancel */
 	NULL,					/* get_depends */
 	backend_get_description,		/* get_description */
-	get_requires,				/* get_requires */
+	backend_get_requires,				/* get_requires */
 	NULL,					/* get_update_detail */
 	backend_get_updates,			/* get_updates */
 	backend_install_package,		/* install_package */
diff-tree 79bdb58d7bed6518314251a0297ac9ce93bac6bb (from 472caf96c6fd8a7e775f985e2f9bc55a32d55abc)
Author: Ken VanDine <ken at vandine.org>
Date:   Mon Sep 24 15:51:29 2007 -0400

    Added get_requires

diff --git a/backends/conary/helpers/get-requires.py b/backends/conary/helpers/get-requires.py
index 339fca9..ad425f2 100755
--- a/backends/conary/helpers/get-requires.py
+++ b/backends/conary/helpers/get-requires.py
@@ -10,5 +10,9 @@
 # (at your option) any later version.
 
 import sys
+from conaryBackend import PackageKitConaryBackend
 
+package = sys.argv[1]
+backend = PackageKitConaryBackend(sys.argv[1:])
+backend.get_requires(package)
 sys.exit(0)
diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index 1b7b4eb..0dc4ba4 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -171,6 +171,17 @@ backend_update_system (PkBackend *backen
 	pk_backend_spawn_helper (backend, "update-system.py", NULL);
 }
 
+/**
+   * backend_get_requires:
+    */
+static void
+backend_get_requires (PkBackend *backend, const gchar *package_id)
+{
+	g_return_if_fail (backend != NULL);
+	pk_backend_allow_interrupt (backend, TRUE);
+	pk_backend_spawn_helper (backend, "get-requires.py", package_id, NULL);
+}
+
 PK_BACKEND_OPTIONS (
 	"Conary",				/* description */
 	"0.0.1",				/* version */
@@ -182,7 +193,7 @@ PK_BACKEND_OPTIONS (
 	NULL,					/* cancel */
 	NULL,					/* get_depends */
 	backend_get_description,		/* get_description */
-	NULL,					/* get_requires */
+	get_requires,				/* get_requires */
 	NULL,					/* get_update_detail */
 	backend_get_updates,			/* get_updates */
 	backend_install_package,		/* install_package */
diff-tree 472caf96c6fd8a7e775f985e2f9bc55a32d55abc (from 92677ced07b18891ebb447fa03fe5e3b9deffebd)
Author: Ken VanDine <ken at vandine.org>
Date:   Mon Sep 24 15:28:01 2007 -0400

    Enable update_package and update_system

diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index ea06109..1b7b4eb 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -145,6 +145,32 @@ backend_search_name (PkBackend *backend,
 	pk_backend_spawn_helper (backend, "search-name.py", filter, search, NULL);
 }
 
+/**
+  * backend_update_package:
+ */
+static void
+backend_update_package (PkBackend *backend, const gchar *package_id)
+{
+	g_return_if_fail (backend != NULL);
+	/* check network state */
+	if (pk_backend_network_is_online (backend) == FALSE) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot update when offline");
+		pk_backend_finished (backend);
+		return;
+	}
+	pk_backend_spawn_helper (backend, "update.py", package_id, NULL);
+}
+
+/**
+ * backend_update_system:
+ */
+static void
+backend_update_system (PkBackend *backend)
+{
+	g_return_if_fail (backend != NULL);
+	pk_backend_spawn_helper (backend, "update-system.py", NULL);
+}
+
 PK_BACKEND_OPTIONS (
 	"Conary",				/* description */
 	"0.0.1",				/* version */
@@ -168,7 +194,7 @@ PK_BACKEND_OPTIONS (
 	NULL,					/* search_file */
 	NULL,					/* search_group */
 	backend_search_name,			/* search_name */
-	NULL,					/* update_package */
+	backend_update_package,			/* update_package */
 	backend_update_system			/* update_system */
 );
 
diff-tree 92677ced07b18891ebb447fa03fe5e3b9deffebd (from 05cdba0459399ae41da4631f654e1c1c9aee3015)
Author: Ken VanDine <ken at vandine.org>
Date:   Mon Sep 24 15:27:16 2007 -0400

    Deal with allowDeps in remove

diff --git a/backends/conary/helpers/remove.py b/backends/conary/helpers/remove.py
index e935597..0dcef0f 100755
--- a/backends/conary/helpers/remove.py
+++ b/backends/conary/helpers/remove.py
@@ -12,7 +12,8 @@
 import sys
 from conaryBackend import PackageKitConaryBackend
 
-package = sys.argv[1]
+allowDeps = sys.argv[1]
+package = sys.argv[2]
 backend = PackageKitConaryBackend(sys.argv[1:])
-backend.remove(package)
+backend.remove(allowDeps, package)
 sys.exit(0)
diff-tree 05cdba0459399ae41da4631f654e1c1c9aee3015 (from 19fcb6c4309f873a38122f70788ac3369cd9b5d6)
Author: Ken VanDine <ken at vandine.org>
Date:   Mon Sep 24 15:26:50 2007 -0400

    Deal with allowDeps in remove

diff --git a/backends/conary/helpers/conaryBackend.py b/backends/conary/helpers/conaryBackend.py
index df6773a..42ebbdd 100644
--- a/backends/conary/helpers/conaryBackend.py
+++ b/backends/conary/helpers/conaryBackend.py
@@ -248,7 +248,7 @@ class PackageKitConaryBackend(PackageKit
             self.error(ERROR_PACKAGE_ALREADY_INSTALLED,
                 'Package was not found')
 
-    def remove(self, package_id):
+    def remove(self, allowDeps, package_id):
         '''
         Implement the {backend}-remove functionality
         '''
diff-tree 19fcb6c4309f873a38122f70788ac3369cd9b5d6 (from 9e250c0dbbda2083c0a98656bc5e4320d17b1a06)
Author: Ken VanDine <ken at vandine.org>
Date:   Mon Sep 24 15:26:19 2007 -0400

    Actually call update_system

diff --git a/backends/conary/helpers/update-system.py b/backends/conary/helpers/update-system.py
index 339fca9..7407180 100755
--- a/backends/conary/helpers/update-system.py
+++ b/backends/conary/helpers/update-system.py
@@ -10,5 +10,8 @@
 # (at your option) any later version.
 
 import sys
+from conaryBackend import PackageKitConaryBackend
 
+backend = PackageKitConaryBackend(sys.argv[1:])
+backend.update_system()
 sys.exit(0)
diff-tree 52228bc2040e551ac48bc567deff2729edef100b (from 9e250c0dbbda2083c0a98656bc5e4320d17b1a06)
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Sep 24 18:47:47 2007 +0100

    add to .gitignore

diff --git a/.gitignore b/.gitignore
index f8d51fc..c8a84df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,4 +46,5 @@ omf.make
 gtk-doc.make
 *~
 *.pc
+py-compile
 



More information about the PackageKit mailing list