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

Richard Hughes hughsient at kemper.freedesktop.org
Thu Nov 1 00:45:23 PDT 2007


 backends/smart/helpers/get-depends.py  |   19 ++++++++++++
 backends/smart/helpers/get-files.py    |   19 ++++++++++++
 backends/smart/helpers/smartBackend.py |   49 +++++++++++++++++++++++++++++++++
 backends/smart/pk-backend-smart.c      |    4 +-
 backends/yum/helpers/yumBackend.py     |    2 -
 backends/yum/pk-backend-yum.c          |    1 
 html/pk-faq.html                       |    4 +-
 7 files changed, 93 insertions(+), 5 deletions(-)

New commits:
commit 25b191618833cac059b25d96e121adecec628bff
Merge: 266c7d0... 8e9d406...
Author: James Bowes <jbowes at dangerouslyinc.com>
Date:   Wed Oct 31 23:30:35 2007 -0400

    Merge branch 'smart'
    
    Conflicts:
    
    	html/pk-faq.html

diff --cc html/pk-faq.html
index 4f79315,14de232..ff4c7b0
--- a/html/pk-faq.html
+++ b/html/pk-faq.html
@@@ -37,10 -37,10 +37,10 @@@ install-package   |   X    |  X  |     
  install-file      |        |  X  |     |  X  |      |       |   X  |
  remove-package    |   X    |  X  |     |  X  |  X   |   X   |   X  |
  update-package    |        |  X  |     |  X  |      |   X   |   X  |
- get-depends       |        |  X  |     |  X  |      |       |   X  |
+ get-depends       |        |  X  |     |  X  |      |   X   |   X  |
  get-requires      |   X    |     |     |  X  |      |       |   X  |
  get-description   |   X    |  X  |  X  |  X  |      |   X   |   X  |
- get-files         |        |  X  |     |  X  |      |       |   X  |
 -get-files         |        |  X  |     |  X  |      |   X   |      |
++get-files         |        |  X  |     |  X  |      |   X   |   X  |
  get-update-detail |        |     |     |     |      |       |      |
  get-repo-list     |        |  X  |     |  X  |  X   |   X   |   X  |
  repo-enable       |        |  X  |     |  X  |      |   X   |      |
commit 8e9d40625090af3470a332b2d9359e070d4025cf
Author: James Bowes <jbowes at dangerouslyinc.com>
Date:   Wed Oct 31 09:16:41 2007 -0400

    smart: If a package is installed, only show it from the system channel

diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 0dac532..fde7f45 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -276,6 +276,8 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
         version, arch = package.version.split('@')
         for loader in package.loaders:
             channel = loader.getChannel()
+            if package.installed and not channel.getType().endswith('-sys'):
+                continue
             info = loader.getInfo(package)
             self.package(self.get_package_id(package.name, version, arch,
                 channel.getAlias()), status, info.getSummary())
commit 06b7fb78c32b1cfd487276732d7964d5e830b922
Author: James Bowes <jbowes at dangerouslyinc.com>
Date:   Tue Oct 30 12:24:40 2007 -0400

    smart: Implement get-depends.

diff --git a/backends/smart/helpers/get-depends.py b/backends/smart/helpers/get-depends.py
new file mode 100755
index 0000000..bba29b7
--- /dev/null
+++ b/backends/smart/helpers/get-depends.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.com>
+#
+# 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 smartBackend import PackageKitSmartBackend
+package = sys.argv[1]
+backend = PackageKitSmartBackend(sys.argv[1:])
+backend.get_depends(package)
+sys.exit(0)
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index b921c7f..0dac532 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -224,6 +224,29 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
 
         self.files(packageid, ";".join(paths))
 
+    @needs_cache
+    def get_depends(self, packageid):
+        idparts = packageid.split(';')
+        packagestring = "%s-%s@%s" % (idparts[0], idparts[1], idparts[2])
+        ratio, results, suggestions = self.ctrl.search(packagestring)
+
+        packages = self._process_search_results(results)
+
+        if len(packages) != 1:
+            return
+
+        package = packages[0]
+
+        providers = {}
+        for required in package.requires:
+            for provider in self.ctrl.getCache().getProvides(str(required)):
+                for package in provider.packages:
+                    if not providers.has_key(package):
+                        providers[package] = True
+
+        for package in providers.keys():
+            self._show_package(package)
+
     def get_repo_list(self):
         channels = smart.sysconf.get("channels", ())
         for alias in channels:
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 107c9ac..6736589 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -33,7 +33,7 @@ PK_BACKEND_OPTIONS (
 	NULL,						/* get_groups */
 	NULL,						/* get_filters */
 	NULL,						/* cancel */
-	NULL,						/* get_depends */
+	pk_backend_python_get_depends,			/* get_depends */
 	pk_backend_python_get_description,		/* get_description */
 	pk_backend_python_get_files,			/* get_files */
 	NULL,						/* get_requires */
diff --git a/html/pk-faq.html b/html/pk-faq.html
index aa1ab62..14de232 100644
--- a/html/pk-faq.html
+++ b/html/pk-faq.html
@@ -37,7 +37,7 @@ install-package   |   X    |  X  |     |  X  |  X   |   X   |   X  |
 install-file      |        |  X  |     |  X  |      |       |   X  |
 remove-package    |   X    |  X  |     |  X  |  X   |   X   |   X  |
 update-package    |        |  X  |     |  X  |      |   X   |   X  |
-get-depends       |        |  X  |     |  X  |      |       |   X  |
+get-depends       |        |  X  |     |  X  |      |   X   |   X  |
 get-requires      |   X    |     |     |  X  |      |       |   X  |
 get-description   |   X    |  X  |  X  |  X  |      |   X   |   X  |
 get-files         |        |  X  |     |  X  |      |   X   |      |
commit 834cefed5b815e767613b12a259ad95d7f531017
Author: James Bowes <jbowes at dangerouslyinc.com>
Date:   Tue Oct 30 09:10:24 2007 -0400

    smart: Use the base interface class to silence output

diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index ade3ee2..b921c7f 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -41,6 +41,8 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
         self.percentage(None)
 
         self.ctrl = smart.init()
+        # Use the dummy interface to quiet output.
+        smart.iface.object = smart.interface.Interface(self.ctrl)
         smart.initPlugins()
         smart.initPsyco()
 
commit 6f735fc35f0580aa026deefadfd332e22a3155b6
Author: James Bowes <jbowes at dangerouslyinc.com>
Date:   Tue Oct 30 08:59:52 2007 -0400

    smart: Implement get-files.

diff --git a/backends/smart/helpers/get-files.py b/backends/smart/helpers/get-files.py
new file mode 100755
index 0000000..b4d2d26
--- /dev/null
+++ b/backends/smart/helpers/get-files.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.com>
+#
+# 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 smartBackend import PackageKitSmartBackend
+package = sys.argv[1]
+backend = PackageKitSmartBackend(sys.argv[1:])
+backend.get_files(package)
+sys.exit(0)
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 255bbf3..ade3ee2 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -200,6 +200,28 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
         self.description(packageid, "unknown", "unknown", description, url,
                 pkgsize, ";".join(info.getPathList()))
 
+    @needs_cache
+    def get_files(self, packageid):
+        idparts = packageid.split(';')
+        packagestring = "%s-%s@%s" % (idparts[0], idparts[1], idparts[2])
+        ratio, results, suggestions = self.ctrl.search(packagestring)
+
+        packages = self._process_search_results(results)
+
+        if len(packages) != 1:
+            return
+
+        package = packages[0]
+        # FIXME: Only installed packages have path lists.
+        paths = []
+        for loader in package.loaders:
+            info = loader.getInfo(package)
+            paths = info.getPathList()
+            if len(paths) > 0:
+                break
+
+        self.files(packageid, ";".join(paths))
+
     def get_repo_list(self):
         channels = smart.sysconf.get("channels", ())
         for alias in channels:
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index d2b8345..107c9ac 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -35,7 +35,7 @@ PK_BACKEND_OPTIONS (
 	NULL,						/* 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 */
diff --git a/html/pk-faq.html b/html/pk-faq.html
index e1f733c..aa1ab62 100644
--- a/html/pk-faq.html
+++ b/html/pk-faq.html
@@ -40,7 +40,7 @@ update-package    |        |  X  |     |  X  |      |   X   |   X  |
 get-depends       |        |  X  |     |  X  |      |       |   X  |
 get-requires      |   X    |     |     |  X  |      |       |   X  |
 get-description   |   X    |  X  |  X  |  X  |      |   X   |   X  |
-get-files         |        |  X  |     |  X  |      |       |      |
+get-files         |        |  X  |     |  X  |      |   X   |      |
 get-update-detail |        |     |     |     |      |       |      |
 get-repo-list     |        |  X  |     |  X  |  X   |   X   |   X  |
 repo-enable       |        |  X  |     |  X  |      |   X   |      |
commit 266c7d02c008bf051e38f918217f40091ebfd052
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Oct 31 22:42:53 2007 +0000

    use one of the new groups

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index b0e0b7a..04939cf 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -91,7 +91,7 @@ groupMap = {
 'base-system;admin-tools'                     : GROUP_ADMIN_TOOLS,
 'base-system;legacy-software-support'         : GROUP_LEGACY,
 'base-system;base'                            : GROUP_SYSTEM,
-'base-system;virtualization'                  : GROUP_SYSTEM,
+'base-system;virtualization'                  : GROUP_VIRTUALIZATION,
 'base-system;legacy-fonts'                    : GROUP_FONTS,
 'language-support;khmer-support'              : GROUP_LOCALIZATION,
 'language-support;persian-support'            : GROUP_LOCALIZATION,
diff --git a/backends/yum/pk-backend-yum.c b/backends/yum/pk-backend-yum.c
index 3de3fee..fea483e 100644
--- a/backends/yum/pk-backend-yum.c
+++ b/backends/yum/pk-backend-yum.c
@@ -46,6 +46,7 @@ backend_get_groups (PkBackend *backend, PkEnumList *elist)
 				      PK_GROUP_ENUM_PUBLISHING,
 				      PK_GROUP_ENUM_SERVERS,
 				      PK_GROUP_ENUM_SYSTEM,
+				      PK_GROUP_ENUM_VIRTUALIZATION,
 				      -1);
 }
 



More information about the PackageKit mailing list