[PackageKit-commit] packagekit: Branch 'master' - 11 commits

Richard Hughes hughsient at kemper.freedesktop.org
Wed Aug 4 03:41:35 PDT 2010


 NEWS                                 |   47 ++++++++++++
 backends/apt/20packagekit            |   13 +++
 backends/aptcc/20packagekit          |   12 +++
 backends/aptcc/Makefile.am           |   12 ++-
 backends/aptcc/get-distro-upgrade.py |  136 +++++++++++++++++++++++++++++++----
 backends/aptcc/pk-backend-aptcc.cpp  |   52 ++-----------
 backends/entropy/entropyBackend.py   |   12 +--
 backends/pisi/pisiBackend.py         |   54 +++++++------
 backends/pisi/pk-backend-pisi.c      |   32 +++++---
 configure.ac                         |    2 
 docs/html/pk-download.html           |    1 
 src/pk-engine.c                      |    3 
 12 files changed, 269 insertions(+), 107 deletions(-)

New commits:
commit 54b63ab87db3963cb7e7b8e268f971e4da701d85
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Aug 4 11:41:12 2010 +0100

    Release version 0.6.7

diff --git a/NEWS b/NEWS
index 15f1381..0af8a36 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,50 @@
+Version 0.6.7
+~~~~~~~~~~~~~
+Released: 2010-08-04
+
+Translations:
+ - Updates to Chinese translation (chenh)
+ - Updates to Dutch translation (warrink)
+ - Updates to Japanese translation (makoto)
+ - Updates to Polish translation (raven)
+ - Updates to Spanish translation (logan)
+ - Updates to Ukrainian translation (yurchor)
+
+Libraries:
+ - glib: Add an 'interactive' property to PkTask so that we  can use it to do '-y' in pkcon properly (Richard Hughes)
+
+Backends:
+ - alpm: Do not fail on unrecognized config directives (Valeriy Lyasotskiy)
+ - alpm: fixed compilation with ALPM 5 (Valeriy Lyasotskiy)
+ - apt: Adapt latest Python backend API changes (Sebastian Heinlein)
+ - apt: Add a hook script that pokes packagekitd when cmd line tools are used (Daniel Nicoletti)
+ - apt: Added support for distro upgrades
+ - apt, aptcc: Fix apt errors when the the packagekit package is removed. (Daniel Nicoletti)
+ - apt, aptcc: start packagekitd before asking it to emit cache-update (Daniel Nicoletti)
+ - entropy: add forward compatibility with upcoming UrlFetcher changes (Fabio Erculiani)
+ - entropy: improve Entropy backward compatibility (Fabio Erculiani)
+ - opkg: fix status type in get_updates (Sebastian Krzyszkowiak)
+ - pacman: add support for versioned provides field (Jonathan Conder)
+ - pisi: Adapt backend for the recent API changes (Fatih Aşıcı)
+ - portage: port to new API, make backend working again (Fabio Erculiani)
+ - yum: add gnome-packagekit and kpackagekit to the list of infrastructure packages (Richard Hughes)
+ - yum: do not issue RepoListChanged when we disable or enable the media repo automatically (Richard Hughes)
+ - yum: ensure we call _check_init when we do GetCategories (Richard Hughes)
+ - yum: Ensure we disable the MediaRepo when the PackageKit backend has finished (Richard Hughes)
+ - yum: wrap _getEVR in a try,catch block to deal with invalid version numbers. Fixes rh#612360 (Richard Hughes)
+
+New Features:
+ - Add a long document explaining the media-repo functionality (Richard Hughes)
+ - If either of ProxyHTTP are set in PackageKit.conf then ignore the user proxy setting. Fixes rh#604317 (Richard Hughes)
+
+Bugfixes:
+ - Add 0install to the user list (Carlo Marcelo Arenas Belon)
+ - cron: Do not exit with 1 if the cron script is disabled in the config (Vincent Untz)
+ - Don't ship README AUTHORS NEWS COPYING in all subpackages. Fixes rh#612332 (Richard Hughes)
+ - Make the PkBackend always start with the WAIT state, but do not proxy this onto the bus (Richard Hughes)
+ - Recognise bluetooth connections as mobile networks. Fixes rh#609827 (Richard Hughes)
+ - Unbreak CNF after the daemon moved to libexec. Fixes rh#613514 (Richard Hughes)
+
 Version 0.6.6
 ~~~~~~~~~~~~~
 Released: 2010-07-01
diff --git a/configure.ac b/configure.ac
index b49fd14..c9b3ddc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,7 @@ AC_SUBST(PK_VERSION)
 # AGE		If libpackagekit can be linked into executables which can be
 # 		built with previous versions of this library. Don't use.
 LT_CURRENT=14
-LT_REVISION=2
+LT_REVISION=3
 LT_AGE=0
 AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index 4e5adba..b4844e0 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -68,6 +68,7 @@ Releases are normally on the first working Monday of each month.
 </p>
 <table>
 <tr><td><b>Version</b></td><td>&nbsp;&nbsp;</td><td><b>Date</b></td></tr>
+<tr><td>0.6.7</td><td></td><td>2010-08-04</td></tr>
 <tr><td>0.6.6</td><td></td><td>2010-07-01</td></tr>
 <tr><td>0.6.5</td><td></td><td>2010-06-02</td></tr>
 <tr><td>0.6.4</td><td></td><td>2010-05-06</td></tr>
diff --git a/src/pk-engine.c b/src/pk-engine.c
index a22a7a9..1beac89 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -601,7 +601,8 @@ pk_engine_state_has_changed (PkEngine *engine, const gchar *reason, GError **err
 	if (is_priority && engine->priv->timeout_normal_id != 0) {
 		/* clear normal, as we are about to schedule a priority */
 		g_source_remove (engine->priv->timeout_normal_id);
-		engine->priv->timeout_normal_id = 0;	}
+		engine->priv->timeout_normal_id = 0;
+	}
 
 	/* wait a little delay in case we get multiple requests */
 	if (is_priority) {
commit 9c8f8838d72fc9cea91b81c3a1e72fc0da4744a4
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Aug 4 11:40:25 2010 +0100

    trivial: fix up the self check program

diff --git a/data/tests/pk-spawn-test-sigquit.py b/data/tests/pk-spawn-test-sigquit.py
old mode 100644
new mode 100755
commit 0437be5bffac3847641441493031ecada2214029
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Aug 4 11:40:07 2010 +0100

    trivial: remove localised output from the entropy backend

diff --git a/backends/entropy/entropyBackend.py b/backends/entropy/entropyBackend.py
index 42d315e..f410b73 100755
--- a/backends/entropy/entropyBackend.py
+++ b/backends/entropy/entropyBackend.py
@@ -365,7 +365,7 @@ class PackageKitEntropyMixin(object):
         """
         Return translated Entropy packages category description.
         """
-        cat_desc = _("No description")
+        cat_desc = "No description"
         cat_desc_data = self._entropy.get_category_description(category)
         if _LOCALE in cat_desc_data:
             cat_desc = cat_desc_data[_LOCALE]
@@ -1189,7 +1189,7 @@ class PackageKitEntropyBackend(PackageKitBaseBackend, PackageKitEntropyMixin):
                 updated = self._convert_date_to_iso8601(
                     i_repo.retrieveCreationDate(c_id))
 
-            update_message = _("Update")
+            update_message = "Update"
             state = UPDATE_STATE_STABLE
             if repo_name != default_repo:
                 state = UPDATE_STATE_TESTING
commit 8aa909f9b72ad6b75be900dcf8ca44506a3f2e96
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date:   Tue Aug 3 12:21:15 2010 -0300

    apt, aptcc: When the packagekit package is removed
                the 20packagekit file is not removed
                so apt-get update & friends starts to
                print errors, this change makes it not
                exit without success.

diff --git a/backends/apt/20packagekit b/backends/apt/20packagekit
index 91549f1..0c6bfb7 100644
--- a/backends/apt/20packagekit
+++ b/backends/apt/20packagekit
@@ -3,10 +3,10 @@
 // Whenever the dpkg is called we might have different updates
 // i.e. a user removes a package that had an update
 DPkg::Post-Invoke {
-"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null";
+"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null; /bin/echo > /dev/null";
 };
 
 // When the apt cache is updated (i.e. apt-cache update)
 APT::Update::Post-Invoke-Success {
-"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null";
+"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null; /bin/echo > /dev/null";
 };
diff --git a/backends/aptcc/20packagekit b/backends/aptcc/20packagekit
index 91549f1..0c6bfb7 100644
--- a/backends/aptcc/20packagekit
+++ b/backends/aptcc/20packagekit
@@ -3,10 +3,10 @@
 // Whenever the dpkg is called we might have different updates
 // i.e. a user removes a package that had an update
 DPkg::Post-Invoke {
-"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null";
+"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null; /bin/echo > /dev/null";
 };
 
 // When the apt cache is updated (i.e. apt-cache update)
 APT::Update::Post-Invoke-Success {
-"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null";
+"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null; /bin/echo > /dev/null";
 };
commit a18c437ca5d2e270ddea58d1cb400bae19dce644
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date:   Mon Aug 2 17:37:23 2010 -0300

    apt, aptcc: Then real problem with the notifications is that
                the caller does not block and wait fot the answer,
                with --print-reply the man page says it will block
                for the reply. With this argument the UpdatesChanged
                signal is emmited, sounds like a DBus bug.

diff --git a/backends/apt/20packagekit b/backends/apt/20packagekit
index 03c19a0..91549f1 100644
--- a/backends/apt/20packagekit
+++ b/backends/apt/20packagekit
@@ -2,7 +2,11 @@
 // THAT THE UPDATES MIGHT HAVE CHANGED
 // Whenever the dpkg is called we might have different updates
 // i.e. a user removes a package that had an update
-DPkg::Post-Invoke { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.freedesktop.PackageKit uint32:0 && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+DPkg::Post-Invoke {
+"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null";
+};
 
 // When the apt cache is updated (i.e. apt-cache update)
-APT::Update::Post-Invoke-Success { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.freedesktop.PackageKit uint32:0 && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+APT::Update::Post-Invoke-Success {
+"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null";
+};
diff --git a/backends/aptcc/20packagekit b/backends/aptcc/20packagekit
index 03c19a0..91549f1 100644
--- a/backends/aptcc/20packagekit
+++ b/backends/aptcc/20packagekit
@@ -2,7 +2,11 @@
 // THAT THE UPDATES MIGHT HAVE CHANGED
 // Whenever the dpkg is called we might have different updates
 // i.e. a user removes a package that had an update
-DPkg::Post-Invoke { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.freedesktop.PackageKit uint32:0 && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+DPkg::Post-Invoke {
+"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null";
+};
 
 // When the apt cache is updated (i.e. apt-cache update)
-APT::Update::Post-Invoke-Success { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.freedesktop.PackageKit uint32:0 && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+APT::Update::Post-Invoke-Success {
+"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --print-reply --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update' > /dev/null";
+};
commit ea67d7641d0dd1a2ce62fba56da685993b5bb7c4
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date:   Mon Aug 2 13:41:17 2010 -0300

    apt, aptcc: start packagekitd before asking it to emit cache-update

diff --git a/backends/apt/20packagekit b/backends/apt/20packagekit
index f845572..03c19a0 100644
--- a/backends/apt/20packagekit
+++ b/backends/apt/20packagekit
@@ -2,7 +2,7 @@
 // THAT THE UPDATES MIGHT HAVE CHANGED
 // Whenever the dpkg is called we might have different updates
 // i.e. a user removes a package that had an update
-DPkg::Post-Invoke {"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+DPkg::Post-Invoke { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.freedesktop.PackageKit uint32:0 && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
 
 // When the apt cache is updated (i.e. apt-cache update)
-APT::Update::Post-Invoke-Success { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+APT::Update::Post-Invoke-Success { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.freedesktop.PackageKit uint32:0 && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
diff --git a/backends/aptcc/20packagekit b/backends/aptcc/20packagekit
index f845572..03c19a0 100644
--- a/backends/aptcc/20packagekit
+++ b/backends/aptcc/20packagekit
@@ -2,7 +2,7 @@
 // THAT THE UPDATES MIGHT HAVE CHANGED
 // Whenever the dpkg is called we might have different updates
 // i.e. a user removes a package that had an update
-DPkg::Post-Invoke {"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+DPkg::Post-Invoke { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.freedesktop.PackageKit uint32:0 && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
 
 // When the apt cache is updated (i.e. apt-cache update)
-APT::Update::Post-Invoke-Success { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+APT::Update::Post-Invoke-Success { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.StartServiceByName string:org.freedesktop.PackageKit uint32:0 && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
commit d141d960c6c57aab18dca61bbc942bc5e8896699
Author: Fatih Aşıcı <fatih at pardus.org.tr>
Date:   Sun Aug 1 19:24:20 2010 +0300

    pisi: Adapt backend for the recent API changes

diff --git a/backends/pisi/pisiBackend.py b/backends/pisi/pisiBackend.py
index bf4c3fb..843ae7d 100755
--- a/backends/pisi/pisiBackend.py
+++ b/backends/pisi/pisiBackend.py
@@ -122,7 +122,7 @@ class PackageKitPisiBackend(PackageKitBaseBackend, PackagekitPackage):
             version = "%s-%s" % (package.version, package.release)
         return version
 
-    def __get_package(self, package, filters = None):
+    def __get_package(self, package, filters=None):
         """ Returns package object suitable for other methods """
         if self.installdb.has_package(package):
             status = INFO_INSTALLED
@@ -135,15 +135,13 @@ class PackageKitPisiBackend(PackageKitBaseBackend, PackagekitPackage):
 
         if filters:
             if "none" not in filters:
-                filterlist = filters.split(';')
-
-                if FILTER_INSTALLED in filterlist and status != INFO_INSTALLED:
+                if FILTER_INSTALLED in filters and status != INFO_INSTALLED:
                     return
-                if FILTER_NOT_INSTALLED in filterlist and status == INFO_INSTALLED:
+                if FILTER_NOT_INSTALLED in filters and status == INFO_INSTALLED:
                     return
-                if FILTER_GUI in filterlist and "app:gui" not in pkg.isA:
+                if FILTER_GUI in filters and "app:gui" not in pkg.isA:
                     return
-                if FILTER_NOT_GUI in filterlist and "app:gui" in pkg.isA:
+                if FILTER_NOT_GUI in filters and "app:gui" in pkg.isA:
                     return
 
         version = self.__get_package_version(pkg)
@@ -347,50 +345,54 @@ class PackageKitPisiBackend(PackageKitBaseBackend, PackagekitPackage):
 
         self.__get_package(package[0], filters)
 
-    def search_details(self, filters, key):
+    def search_details(self, filters, values):
         """ Prints a detailed list of packages contains search term """
         self.allow_cancel(True)
         self.percentage(None)
         self.status(STATUS_INFO)
 
         # Internal FIXME: Use search_details instead of _package when API gains that ability :)
-        for pkg in pisi.api.search_package([key]):
+        for pkg in pisi.api.search_package(values):
             self.__get_package(pkg, filters)
 
-    def search_file(self, filters, key):
+    def search_file(self, filters, values):
         """ Prints the installed package which contains the specified file """
         self.allow_cancel(True)
         self.percentage(None)
         self.status(STATUS_INFO)
 
-        # Internal FIXME: Why it is needed?
-        key = key.lstrip("/")
+        for value in values:
+            # Internal FIXME: Why it is needed?
+            value = value.lstrip("/")
 
-        for pkg, files in pisi.api.search_file(key):
-            self.__get_package(pkg)
+            for pkg, files in pisi.api.search_file(value):
+                self.__get_package(pkg)
 
-    def search_group(self, filters, group):
+    def search_group(self, filters, values):
         """ Prints a list of packages belongs to searched group """
         self.allow_cancel(True)
         self.percentage(None)
         self.status(STATUS_INFO)
 
-        try:
-            for key in self.groups.keys():
-                if self.groups[key] == group:
-                    for pkg in self.componentdb.get_packages(key, walk = True):
-                        self.__get_package(pkg, filters)
-        except:
-            self.error(ERROR_GROUP_NOT_FOUND, "Component %s was not found" % group)
-
-    def search_name(self, filters, package):
+        for value in values:
+            try:
+                packages = self.componentdb.get_packages(value, walk=True)
+            except:
+                self.error(ERROR_GROUP_NOT_FOUND,
+                           "Component %s was not found" % value)
+
+            for pkg in packages:
+                self.__get_package(pkg, filters)
+
+    def search_name(self, filters, values):
         """ Prints a list of packages contains search term in its name """
         self.allow_cancel(True)
         self.percentage(None)
         self.status(STATUS_INFO)
 
-        for pkg in pisi.api.search_package([package]):
-            self.__get_package(pkg, filters)
+        for value in values:
+            for pkg in pisi.api.search_package([value]):
+                self.__get_package(pkg, filters)
 
     def update_packages(self, only_trusted, package_ids):
         """ Updates given package to its latest version """
diff --git a/backends/pisi/pk-backend-pisi.c b/backends/pisi/pk-backend-pisi.c
index 5d861d7..89e5ff2 100644
--- a/backends/pisi/pk-backend-pisi.c
+++ b/backends/pisi/pk-backend-pisi.c
@@ -235,47 +235,59 @@ backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow
  * pk_backend_search_details:
  */
 static void
-backend_search_details (PkBackend *backend, PkBitfield filters, const gchar *search)
+backend_search_details (PkBackend *backend, PkBitfield filters, gchar **values)
 {
 	gchar *filters_text;
+	gchar *search;
 	filters_text = pk_filter_bitfield_to_string (filters);
+	search = g_strjoinv ("&", values);
 	pk_backend_spawn_helper (spawn, "pisiBackend.py", "search-details", filters_text, search, NULL);
+	g_free (search);
 	g_free (filters_text);
 }
 
 /**
- * pk_backend_search_file:
+ * pk_backend_search_files:
  */
 static void
-backend_search_file (PkBackend *backend, PkBitfield filters, const gchar *search)
+backend_search_files (PkBackend *backend, PkBitfield filters, gchar **values)
 {
 	gchar *filters_text;
+	gchar *search;
 	filters_text = pk_filter_bitfield_to_string (filters);
+	search = g_strjoinv ("&", values);
 	pk_backend_spawn_helper (spawn, "pisiBackend.py", "search-file", filters_text, search, NULL);
+	g_free (search);
 	g_free (filters_text);
 }
 
 /**
- * pk_backend_search_group:
+ * pk_backend_search_groups:
  */
 static void
-backend_search_group (PkBackend *backend, PkBitfield filters, const gchar *search)
+backend_search_groups (PkBackend *backend, PkBitfield filters, gchar **values)
 {
 	gchar *filters_text;
+	gchar *search;
 	filters_text = pk_filter_bitfield_to_string (filters);
+	search = g_strjoinv ("&", values);
 	pk_backend_spawn_helper (spawn, "pisiBackend.py", "search-group", filters_text, search, NULL);
+	g_free (search);
 	g_free (filters_text);
 }
 
 /**
- * pk_backend_search_name:
+ * pk_backend_search_names:
  */
 static void
-backend_search_name (PkBackend *backend, PkBitfield filters, const gchar *search)
+backend_search_names (PkBackend *backend, PkBitfield filters, gchar **values)
 {
 	gchar *filters_text;
+	gchar *search;
 	filters_text = pk_filter_bitfield_to_string (filters);
+	search = g_strjoinv ("&", values);
 	pk_backend_spawn_helper (spawn, "pisiBackend.py", "search-name", filters_text, search, NULL);
+	g_free (search);
 	g_free (filters_text);
 }
 
@@ -376,9 +388,9 @@ PK_BACKEND_OPTIONS (
 	backend_resolve,			/* resolve */
 	NULL,					/* rollback */
 	backend_search_details,			/* search_details */
-	backend_search_file,			/* search_file */
-	backend_search_group,			/* search_group */
-	backend_search_name,			/* search_name */
+	backend_search_files,			/* search_files */
+	backend_search_groups,			/* search_groups */
+	backend_search_names,			/* search_names */
 	backend_update_packages,		/* update_packages */
 	backend_update_system,			/* update_system */
 	NULL,					/* what_provides */
commit d2e586cc5fc59ce6149abaa49d6a3d95d0e88426
Author: Fabio Erculiani <lxnay at sabayon.org>
Date:   Fri Jul 30 22:33:02 2010 +0200

    entropy: add forward compatibility with upcoming UrlFetcher changes

diff --git a/backends/entropy/entropyBackend.py b/backends/entropy/entropyBackend.py
index 5f6d2e0..42d315e 100755
--- a/backends/entropy/entropyBackend.py
+++ b/backends/entropy/entropyBackend.py
@@ -727,8 +727,7 @@ class PkUrlFetcher(UrlFetcher):
         self.__remotesize = total_size
         self.__datatransfer = data_transfer
 
-    def output(self):
-
+    def update(self):
         if PkUrlFetcher._pk_progress is None:
             return
 
@@ -737,8 +736,11 @@ class PkUrlFetcher(UrlFetcher):
             myavg = abs(int(round(float(self.__average), 1)))
             cur_prog = int(float(self.__average)/100)
             PkUrlFetcher._pk_progress(cur_prog)
-            PkUrlFetcher._last_t = time.time()
+            PkUrlFetcher._last_t = time.time()    
 
+    def output(self):
+        """ backward compatibility """
+        return self.update()
 
 class PackageKitEntropyBackend(PackageKitBaseBackend, PackageKitEntropyMixin):
 
commit cf545ffd78ebb08e89c14e8cca13db22345330cf
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date:   Fri Jul 30 16:05:18 2010 -0300

    Fix an import

diff --git a/backends/aptcc/get-distro-upgrade.py b/backends/aptcc/get-distro-upgrade.py
index b1502e5..370a304 100755
--- a/backends/aptcc/get-distro-upgrade.py
+++ b/backends/aptcc/get-distro-upgrade.py
@@ -21,6 +21,7 @@ __author__  = "Sebastian Heinlein <devel at glatzor.de>"
 import locale
 import logging
 import optparse
+import time
 
 from packagekit.backend import *
 
@@ -71,9 +72,6 @@ class PackageKitAptccBackend(PackageKitBaseBackend):
         self.percentage(None)
 
         if META_RELEASE_SUPPORT == False:
-            #self.distro_upgrade("stable",
-                                #"Maverick 10.10",
-                                #"The future stable release")
             return
 
         #FIXME Evil to start the download during init
@@ -83,7 +81,7 @@ class PackageKitAptccBackend(PackageKitBaseBackend):
             time.sleep(1)
         #FIXME: Add support for description
         if meta_release.new_dist != None:
-            self.distro_upgrade("stable",
+            self.distro_upgrade(DISTRO_UPGRADE_STABLE,
                                 "%s %s" % (meta_release.new_dist.name,
                                            meta_release.new_dist.version),
                                 "The latest stable release")
commit beeecf48a164722edb0c821dbabde153cfcfa8cd
Merge: 7af058a... 36333a4...
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date:   Tue Jul 27 13:55:05 2010 -0300

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

commit 7af058a1c947a77e341bf3e2c12d3611961b8684
Author: Daniel Nicoletti <dantti85-pk at yahoo.com.br>
Date:   Tue Jul 27 13:53:23 2010 -0300

    Added support to get distro upgrades and also fixed a hook script that pokes packagekitd when cmd line tools are used

diff --git a/backends/apt/20packagekit b/backends/apt/20packagekit
index bca50ae..f845572 100644
--- a/backends/apt/20packagekit
+++ b/backends/apt/20packagekit
@@ -1 +1,8 @@
-APT::Update::Post-Invoke-Success { "[ ! -f /var/run/dbus/system_bus_socket ] || /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+// THIS FILE IS USED TO INFORM PACKAGEKIT
+// THAT THE UPDATES MIGHT HAVE CHANGED
+// Whenever the dpkg is called we might have different updates
+// i.e. a user removes a package that had an update
+DPkg::Post-Invoke {"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+
+// When the apt cache is updated (i.e. apt-cache update)
+APT::Update::Post-Invoke-Success { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
diff --git a/backends/aptcc/20packagekit b/backends/aptcc/20packagekit
new file mode 100644
index 0000000..f845572
--- /dev/null
+++ b/backends/aptcc/20packagekit
@@ -0,0 +1,8 @@
+// THIS FILE IS USED TO INFORM PACKAGEKIT
+// THAT THE UPDATES MIGHT HAVE CHANGED
+// Whenever the dpkg is called we might have different updates
+// i.e. a user removes a package that had an update
+DPkg::Post-Invoke {"/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
+
+// When the apt cache is updated (i.e. apt-cache update)
+APT::Update::Post-Invoke-Success { "/usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call /org/freedesktop/PackageKit org.freedesktop.PackageKit.StateHasChanged string:'cache-update'"; };
diff --git a/backends/aptcc/Makefile.am b/backends/aptcc/Makefile.am
index 72a0809..235b430 100644
--- a/backends/aptcc/Makefile.am
+++ b/backends/aptcc/Makefile.am
@@ -13,11 +13,28 @@ libpk_backend_aptcc_la_LIBADD = -lcrypt $(PK_PLUGIN_LIBS)
 libpk_backend_aptcc_la_LDFLAGS = -module -avoid-version $(APTCC_LIBS) $(GST_LIBS)
 libpk_backend_aptcc_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
 libpk_backend_aptcc_la_CPPFLAGS = $(PK_PLUGIN_CFLAGS) $(APTCC_CFLAGS)
-EXTRA_DIST = apt.h \
-             apt-utils.h \
-             matcher.h \
+
+aptconfdir = ${SYSCONFDIR}/apt/apt.conf.d
+aptconf_DATA = 20packagekit
+
+EXTRA_DIST = 20packagekit \
+	     apt.h \
+	     apt-utils.h \
+	     matcher.h \
 	     aptcc_show_broken.h \
 	     acqprogress.h \
 	     aptcc_show_error.h \
 	     pkg_acqfile.h \
-	     rsources.h
\ No newline at end of file
+	     rsources.h
+
+helperdir = $(datadir)/PackageKit/helpers/aptcc
+dist_helper_DATA =					\
+	get-distro-upgrade.py				\
+	$(NULL)
+
+install-data-hook:
+	chmod +x $(DESTDIR)$(helperdir)/*.py
+
+clean-local :
+	rm -f *~
+	rm -f *.pyc
\ No newline at end of file
diff --git a/backends/aptcc/get-distro-upgrade.py b/backends/aptcc/get-distro-upgrade.py
index 1cda1a9..b1502e5 100755
--- a/backends/aptcc/get-distro-upgrade.py
+++ b/backends/aptcc/get-distro-upgrade.py
@@ -16,10 +16,20 @@ the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 """
 
-# TODO get rid of this python file
-import sys;
-import time;
+__author__  = "Sebastian Heinlein <devel at glatzor.de>"
 
+import locale
+import logging
+import optparse
+
+from packagekit.backend import *
+
+logging.basicConfig(format="%(levelname)s:%(message)s")
+pklog = logging.getLogger("PackageKitBackend")
+pklog.setLevel(logging.NOTSET)
+
+# Check if update-manager-core is installed to get aware of the
+# latest distro releases
 try:
     from UpdateManager.Core.MetaRelease import MetaReleaseCore
 except ImportError:
@@ -27,18 +37,116 @@ except ImportError:
 else:
     META_RELEASE_SUPPORT = True
 
-# Could not load the UpdateManager
-if META_RELEASE_SUPPORT == False:
-    sys.exit(1);
 
-#FIXME Evil to start the download during init
-meta_release = MetaReleaseCore(False, False)
+DEFAULT_ENCODING = "UTF-8"
+
+# Required to get translated descriptions
+try:
+    locale.setlocale(locale.LC_ALL, "")
+except locale.Error:
+    pklog.debug("Failed to unset LC_ALL")
+
+# Allows to write unicode to stdout
+import codecs
+sys.stdout = codecs.getwriter(DEFAULT_ENCODING)(sys.stdout)
+
+# Required to parse RFC822 time stamps
+try:
+    locale.setlocale(locale.LC_TIME, "C")
+except locale.Error:
+    pklog.debug("Failed to unset LC_TIME")
+
+class PackageKitAptccBackend(PackageKitBaseBackend):
+    """
+    PackageKit backend for aptcc
+    """
+    # Methods ( client -> engine -> backend )
+    def get_distro_upgrades(self):
+        """
+        Implement the {backend}-get-distro-upgrades functionality
+        """
+        pklog.info("Get distro upgrades")
+        self.status(STATUS_INFO)
+        self.allow_cancel(False)
+        self.percentage(None)
+
+        if META_RELEASE_SUPPORT == False:
+            #self.distro_upgrade("stable",
+                                #"Maverick 10.10",
+                                #"The future stable release")
+            return
+
+        #FIXME Evil to start the download during init
+        meta_release = MetaReleaseCore(False, False)
+        #FIXME: should use a lock
+        while meta_release.downloading:
+            time.sleep(1)
+        #FIXME: Add support for description
+        if meta_release.new_dist != None:
+            self.distro_upgrade("stable",
+                                "%s %s" % (meta_release.new_dist.name,
+                                           meta_release.new_dist.version),
+                                "The latest stable release")
+
+
+
+    def _sigquit(self, signum, frame):
+        self._unlock_cache()
+        sys.exit(1)
+
+def debug_exception(type, value, tb):
+    """
+    Provides an interactive debugging session on unhandled exceptions
+    See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65287
+    """
+    if hasattr(sys, 'ps1') or not sys.stderr.isatty() or \
+       not sys.stdin.isatty() or not sys.stdout.isatty() or type==SyntaxError:
+        # Calls the default handler in interactive mode, if output is·
+        # redirected or on syntax errors
+        sys.__excepthook__(type, value, tb)
+    else:
+        import traceback, pdb
+        traceback.print_exception(type, value, tb)
+        print
+        pdb.pm()
+
+def run(args, single=False):
+    """
+    Start the apt backend
+    """
+    backend = PackageKitAptccBackend("")
+    if single == True:
+        backend.dispatch_command(args[0], args[1:])
+    else:
+        backend.dispatcher(args)
+
+def main():
+    parser = optparse.OptionParser(description="APT backend for PackageKit")
+    parser.add_option("-r", "--root",
+                      action="store", type="string", dest="root",
+                      help="Use the given directory as the system root "
+                           "(Only needed by developers)")
+    parser.add_option("-p", "--profile",
+                      action="store", type="string", dest="profile",
+                      help="Store profiling stats in the given file "
+                           "(Only needed by developers)")
+    parser.add_option("-d", "--debug",
+                      action="store_true", dest="debug",
+                      help="Show a lot of additional information and drop to "
+                           "a debugging console on unhandled exceptions "
+                           "(Only needed by developers)")
+    parser.add_option("-s", "--single",
+                      action="store_true", dest="single",
+                      help="Only perform one command and don't listen on stdin "
+                           "(Only needed by developers)")
+    (options, args) = parser.parse_args()
+    if options.debug:
+        pklog.setLevel(logging.DEBUG)
+        sys.excepthook = debug_exception
+
+    run(args, options.single)
 
-#FIXME: should use a lock
-while meta_release.downloading:
-    time.sleep(1)
+if __name__ == '__main__':
+    main()
 
-#FIXME: Add support for description
-if meta_release.new_dist != None:
-    print meta_release.new_dist.name;
-    print meta_release.new_dist.version;
+# vim: ts=4 et sts=4
diff --git a/backends/aptcc/pk-backend-aptcc.cpp b/backends/aptcc/pk-backend-aptcc.cpp
index 5bf9ac5..7fa8264 100644
--- a/backends/aptcc/pk-backend-aptcc.cpp
+++ b/backends/aptcc/pk-backend-aptcc.cpp
@@ -34,9 +34,12 @@
 #include "rsources.h"
 
 #include <config.h>
+#include <pk-backend.h>
+#include <pk-backend-spawn.h>
 
 /* static bodges */
 static bool _cancel = false;
+static PkBackendSpawn *spawn;
 
 /**
  * backend_initialize:
@@ -46,15 +49,14 @@ backend_initialize (PkBackend *backend)
 {
 	egg_debug ("APTcc Initializing");
 
-	// make sure we do not get a graphical debconf
-	setenv("DEBIAN_FRONTEND", "noninteractive", 1);
-	setenv("APT_LISTCHANGES_FRONTEND", "none", 1);
-
 	if (pkgInitConfig(*_config) == false ||
 	    pkgInitSystem(*_config, _system) == false)
 	{
 		egg_debug ("ERROR initializing backend");
 	}
+
+	spawn = pk_backend_spawn_new ();
+	pk_backend_spawn_set_name (spawn, "aptcc");
 }
 
 /**
@@ -221,49 +223,13 @@ backend_get_requires (PkBackend *backend, PkBitfield filters, gchar **package_id
 	pk_backend_thread_create (backend, backend_get_depends_or_requires_thread);
 }
 
-
-static gboolean
-backend_get_distro_upgrades_thread (PkBackend *backend)
-{
-	FILE *fpipe;
-	char releaseName[256];
-	char releaseVersion[256];
-
-	pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
-
-	if (!(fpipe = (FILE*)popen("./get-distro-upgrade.py", "r"))) {
-	    goto out;
-	}
-
-	if (fgets(releaseName, sizeof releaseName, fpipe)) {
-	    goto out;
-	}
-
-	if (fgets(releaseVersion, sizeof releaseVersion, fpipe)) {
-	    goto out;
-	}
-	pclose(fpipe);
-
-	pk_backend_distro_upgrade (backend,
-				   PK_DISTRO_UPGRADE_ENUM_STABLE,
-				   g_strdup_printf("%s %s", releaseName, releaseVersion),
-				   "The latest stable release");
-
-	pk_backend_finished (backend);
-	return true;
-
-out:
-	pk_backend_finished (backend);
-	return false;
-}
-
 /**
  * backend_get_distro_upgrades:
  */
 static void
 backend_get_distro_upgrades (PkBackend *backend)
 {
-	pk_backend_thread_create (backend, backend_get_distro_upgrades_thread);
+	pk_backend_spawn_helper (spawn, "get-distro-upgrade.py", "get-distro-upgrades", NULL);
 }
 
 static gboolean
@@ -775,9 +741,7 @@ backend_refresh_cache_thread (PkBackend *backend)
 	AcqPackageKitStatus Stat(m_apt, backend, _cancel);
 
 	// do the work
-	if (_config->FindB("APT::Get::Download",true) == true) {
-		ListUpdate(Stat, *m_apt->packageSourceList);
-	}
+	ListUpdate(Stat, *m_apt->packageSourceList);
 
 	// Rebuild the cache.
 	pkgCacheFile Cache;


More information about the PackageKit-commit mailing list