Hello community,

here is the log from the commit of package PackageKit for openSUSE:11.4
checked in at Mon Nov 14 17:03:15 CET 2011.



--------
--- old-versions/11.4/UPDATES/all/PackageKit/PackageKit.changes 2011-06-01 
15:07:58.000000000 +0200
+++ 11.4/PackageKit/PackageKit.changes  2011-10-19 13:16:27.000000000 +0200
@@ -1,0 +2,7 @@
+Wed Oct 19 11:15:18 UTC 2011 - [email protected]
+
+- backport fix for bnc#679649
+  added workaround for package search functions
+  PackageKit looping initializing repos taking long time
+
+-------------------------------------------------------------------

calling whatdependson for 11.4-i586


Old:
----
  0001-zypp-log-to-ZYpp-s-log-the-start-of-a-PK-backend-fun.patch
  0002-zypp-fix-deletion-of-package-locks-bnc-690038.patch
  PackageKit-sysconfig-cron.patch
  bmc-17596.patch
  fix-plugin.patch

New:
----
  0001-make-debugging-easier.patch
  0002-fix-lost-locks-bnc-690038.patch
  0003-fix-slowness-bnc-679650.patch
  0004-Change-the-configuration-of-the-cron-script-to-a-sys.patch
  0005-fix-build-with-11.4-gtk2-2.21.patch
  0006-dont-call-build-pool-inside-the-loop.patch
  0007-only-load-repositories-once.patch
  0008-bmc-17596-meego-PackageKit-hangs-during-some-transac.patch
  0009-Workaround-Don-t-refresh-repositories-each-time-for-.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ PackageKit.spec ++++++
--- /var/tmp/diff_new_pack.OvWU0C/_old  2011-11-14 17:02:37.000000000 +0100
+++ /var/tmp/diff_new_pack.OvWU0C/_new  2011-11-14 17:02:37.000000000 +0100
@@ -35,7 +35,7 @@
 
 Name:           PackageKit
 Version:        0.6.14
-Release:        0.<RELEASE4>
+Release:        0.<RELEASE6>
 License:        GPLv2+
 BuildRequires:  NetworkManager-devel
 BuildRequires:  dbus-1-glib-devel
@@ -64,16 +64,24 @@
 Summary:        Simple software installation management software
 Url:            http://packagekit.org/
 Source:         %{name}-%{version}.tar.bz2
-# PATCH-FEATURE-OPENSUSE PackageKit-sysconfig-cron.patch [email protected] -- 
Change the configuration of the cron script to a sysconfig-like config
-Patch0:         PackageKit-sysconfig-cron.patch
-# PATCH-FIX-UPSTREAM 
0001-zypp-log-to-ZYpp-s-log-the-start-of-a-PK-backend-fun.patch 
[email protected] -- make debugging easier
-Patch1:         0001-zypp-log-to-ZYpp-s-log-the-start-of-a-PK-backend-fun.patch
+# PATCH-FIX-UPSTREAM 0001-make-debugging-easier.patch [email protected] -- 
make debugging easier
+Patch0:         0001-make-debugging-easier.patch
 # PATCH-FIX-UPSTREAM 0002-zypp-fix-deletion-of-package-locks-bnc-690038.patch 
[email protected] -- fix lost locks (bnc#690038)
-Patch2:         0002-zypp-fix-deletion-of-package-locks-bnc-690038.patch
-# PATCH-FIX-OPENSUSE fix-plugin.patch [email protected] -- fix build with 11.4 
gtk2 2.21.
-Patch3:         fix-plugin.patch
-# PATCH-FIX-OPENSUSE bmc-17596.patch 
https://bugs.meego.com/show_bug.cgi?id=17596 fixes overflow
-Patch4:         bmc-17596.patch
+Patch1:         0002-fix-lost-locks-bnc-690038.patch
+Patch2:         0003-fix-slowness-bnc-679650.patch
+# PATCH-FEATURE-OPENSUSE PackageKit-sysconfig-cron.patch [email protected] -- 
Change the configuration of the cron script to a sysconfig-like config
+Patch3:         0004-Change-the-configuration-of-the-cron-script-to-a-sys.patch
+# PATCH-FIX-OPENSUSE 0005-fix-build-with-11.4-gtk2-2.21.patch [email protected] 
-- fix build with 11.4 gtk2 2.21.
+Patch4:         0005-fix-build-with-11.4-gtk2-2.21.patch
+# PATCH-FIX-OPENSUSE 0006-dont-call-build-pool-inside-the-loop.patch backport 
fix for bnc#679650
+Patch5:         0006-dont-call-build-pool-inside-the-loop.patch
+# PATCH-FIX-OPENSUSE 0007-only-load-repositories-once.patch backport fix for 
bnc#679650
+Patch6:         0007-only-load-repositories-once.patch
+# PATCH-FIX-UPSTREAM 
0008-bmc-17596-meego-PackageKit-hangs-during-some-transac.patch fixes overflow
+Patch7:         0008-bmc-17596-meego-PackageKit-hangs-during-some-transac.patch
+# PATCH-FIX-UPSTREAM 
0009-Workaround-Don-t-refresh-repositories-each-time-for-.patch fix #2 for 
bnc#679650
+Patch8:         0009-Workaround-Don-t-refresh-repositories-each-time-for-.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Requires:       %{name}-branding = %{version}
 Recommends:     %{name}-lang
@@ -293,6 +301,10 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
 
 %build
 %configure \

++++++ 0001-make-debugging-easier.patch ++++++
>From 4d5c6b804241c32ecbc0a82208d3f92da2cbf075 Mon Sep 17 00:00:00 2001
From: Duncan Mac-Vicar P <[email protected]>
Date: Tue, 26 Jul 2011 11:31:08 +0200
Subject: [PATCH 1/8] make debugging easier

---
 backends/zypp/pk-backend-zypp.cpp |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/backends/zypp/pk-backend-zypp.cpp 
b/backends/zypp/pk-backend-zypp.cpp
index 3968f01..51bb3e4 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -29,6 +29,7 @@
 #include <glib/gi18n.h>
 #include <sys/vfs.h>
 
+#include <zypp/base/Logger.h>
 #include <zypp/ZYppFactory.h>
 #include <zypp/ResObject.h>
 #include <zypp/ResPoolProxy.h>
@@ -145,6 +146,7 @@ pk_backend_destroy (PkBackend *backend)
 static gboolean
 backend_get_requires_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **package_ids;
        PkBitfield _filters = (PkBitfield) pk_backend_get_uint (backend, 
"filters");
        ZYpp::Ptr zypp;
@@ -307,6 +309,7 @@ zypp_is_no_solvable (const sat::Solvable &solv)
 static gboolean
 backend_get_depends_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **package_ids;
        PkBitfield _filters = (PkBitfield) pk_backend_get_uint (backend, 
"filters");
 
@@ -481,6 +484,7 @@ pk_backend_get_depends (PkBackend *backend, PkBitfield 
filters, gchar **package_
 static gboolean
 backend_get_details_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **package_ids;
        ZYpp::Ptr zypp;
 
@@ -587,6 +591,7 @@ pk_backend_get_details (PkBackend *backend, gchar 
**package_ids)
 static gboolean
 backend_get_distro_upgrades_thread(PkBackend *backend)
 {
+       MIL << endl;
        ZYpp::Ptr zypp;
 
        zypp = get_zypp (backend);
@@ -642,6 +647,7 @@ pk_backend_get_distro_upgrades (PkBackend *backend)
 static gboolean
 backend_refresh_cache_thread (PkBackend *backend)
 {
+       MIL << endl;
        gboolean force = pk_backend_get_bool(backend, "force");
        zypp_refresh_cache (backend, force);
        pk_backend_finished (backend);
@@ -654,6 +660,7 @@ backend_refresh_cache_thread (PkBackend *backend)
 void
 pk_backend_refresh_cache (PkBackend *backend, gboolean force)
 {
+       MIL << endl;
        pk_backend_thread_create (backend, backend_refresh_cache_thread);
 }
 
@@ -686,6 +693,7 @@ check_for_self_update (PkBackend *backend, set<PoolItem> 
*candidates)
 static gboolean
 backend_get_updates_thread (PkBackend *backend)
 {
+       MIL << endl;
        PkBitfield _filters = (PkBitfield) pk_backend_get_uint (backend, 
"filters");
        ZYpp::Ptr zypp;
 
@@ -765,6 +773,7 @@ pk_backend_get_updates (PkBackend *backend, PkBitfield 
filters)
 static gboolean
 backend_install_files_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **full_paths;
        ZYpp::Ptr zypp;
 
@@ -903,6 +912,7 @@ pk_backend_simulate_install_files (PkBackend *backend, 
gchar **full_paths)
 static gboolean
 backend_get_update_detail_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **package_ids;
        ZYpp::Ptr zypp;
 
@@ -1001,6 +1011,7 @@ pk_backend_get_update_detail (PkBackend *backend, gchar 
**package_ids)
 static gboolean
 backend_update_system_thread (PkBackend *backend)
 {
+       MIL << endl;
        ZYpp::Ptr zypp;
 
        zypp = get_zypp (backend);
@@ -1313,6 +1324,7 @@ pk_backend_simulate_remove_packages (PkBackend *backend, 
gchar **packages, gbool
 static gboolean
 backend_resolve_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **package_ids = pk_backend_get_strv (backend, "package_ids");
        PkBitfield _filters = (PkBitfield) pk_backend_get_uint (backend, 
"filters");
        ZYpp::Ptr zypp;
@@ -1396,6 +1408,7 @@ pk_backend_resolve (PkBackend *backend, PkBitfield 
filters, gchar **package_ids)
 static gboolean
 backend_find_packages_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **values;
        const gchar *search;
        guint mode;
@@ -1490,6 +1503,7 @@ pk_backend_search_details (PkBackend *backend, PkBitfield 
filters, gchar **value
 static gboolean
 backend_search_group_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **values;
        const gchar *group;
        ZYpp::Ptr zypp;
@@ -1560,6 +1574,7 @@ pk_backend_search_files (PkBackend *backend, PkBitfield 
filters, gchar **values)
 void
 pk_backend_get_repo_list (PkBackend *backend, PkBitfield filters)
 {
+       MIL << endl;
        ZYpp::Ptr zypp;
 
        zypp = get_zypp (backend);
@@ -1606,6 +1621,7 @@ pk_backend_get_repo_list (PkBackend *backend, PkBitfield 
filters)
 void
 pk_backend_repo_enable (PkBackend *backend, const gchar *rid, gboolean enabled)
 {
+       MIL << endl;
        ZYpp::Ptr zypp;
 
        zypp = get_zypp (backend);
@@ -1647,6 +1663,7 @@ pk_backend_repo_enable (PkBackend *backend, const gchar 
*rid, gboolean enabled)
 static gboolean
 backend_get_files_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **package_ids;
        ZYpp::Ptr zypp;
 
@@ -1731,6 +1748,7 @@ pk_backend_get_files(PkBackend *backend, gchar 
**package_ids)
 static gboolean
 backend_get_packages_thread (PkBackend *backend)
 {
+       MIL << endl;
        ZYpp::Ptr zypp;
 
        zypp = get_zypp (backend);
@@ -1835,6 +1853,7 @@ pk_backend_simulate_update_packages (PkBackend *backend, 
gchar **package_ids)
 static gboolean
 backend_repo_set_data_thread (PkBackend *backend)
 {
+       MIL << endl;
        const gchar *repo_id;
        const gchar *parameter;
        const gchar *value;
@@ -1977,6 +1996,7 @@ pk_backend_repo_set_data (PkBackend *backend, const gchar 
*repo_id, const gchar
 static gboolean
 backend_what_provides_thread (PkBackend *backend)
 {
+       MIL << endl;
        ZYpp::Ptr zypp;
 
        zypp = get_zypp (backend);
@@ -2060,6 +2080,7 @@ pk_backend_get_mime_types (PkBackend *backend)
 static gboolean
 backend_download_packages_thread (PkBackend *backend)
 {
+       MIL << endl;
        gchar **package_ids;
        gulong size = 0;
 
-- 
1.7.6.4

++++++ 0002-fix-lost-locks-bnc-690038.patch ++++++
>From 3c2a8d2078036307aa594cf7bf699383e7584cf3 Mon Sep 17 00:00:00 2001
From: Duncan Mac-Vicar P <[email protected]>
Date: Tue, 26 Jul 2011 11:31:48 +0200
Subject: [PATCH 2/8] fix lost locks (bnc#690038)

---
 backends/zypp/pk-backend-zypp.cpp |   79 +++++++++++++++++--------------------
 1 files changed, 36 insertions(+), 43 deletions(-)

diff --git a/backends/zypp/pk-backend-zypp.cpp 
b/backends/zypp/pk-backend-zypp.cpp
index 51bb3e4..85b7cbb 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -84,6 +84,22 @@ static map<PkBackend *, EventDirector *> _eventDirectors;
 
 map<PkBackend *, vector<string> *> _signatures;
 
+// helper function to restore the pool status
+// after doing operations on it
+class PoolStatusSaver : private base::NonCopyable
+{
+public:
+    PoolStatusSaver()
+    {
+           ResPool::instance().proxy().saveState();
+    }
+
+    ~PoolStatusSaver()
+    {
+           ResPool::instance().proxy().restoreState();
+    }
+};
+
 /**
  * pk_backend_get_description:
  */
@@ -168,6 +184,7 @@ backend_get_requires_thread (PkBackend *backend)
        //TODO repair percentages
        //pk_backend_set_percentage (backend, 0);
 
+       PoolStatusSaver saver;
        for (uint i = 0; package_ids[i]; i++) {
                sat::Solvable solvable = zypp_get_package_by_id (backend, 
package_ids[i]);
                PoolItem package;
@@ -231,12 +248,8 @@ backend_get_requires_thread (PkBackend *backend)
 
                        if (!error && !zypp_filter_solvable (_filters, 
it->resolvable()->satSolvable()))
                                error = !zypp_backend_pool_item_notify 
(backend, *it);
-
-                       it->statusReset ();
                }
 
-               // undo the status-change of the package and disable 
forceResolve
-               package.statusReset ();
                solver.setForceResolve (false);
        }
 
@@ -775,6 +788,7 @@ backend_install_files_thread (PkBackend *backend)
 {
        MIL << endl;
        gchar **full_paths;
+       RepoManager manager;
        ZYpp::Ptr zypp;
 
        zypp = get_zypp (backend);
@@ -825,63 +839,36 @@ backend_install_files_thread (PkBackend *backend)
                tmpRepo.setAutorefresh (true);
                tmpRepo.setAlias ("PK_TMP_DIR");
                tmpRepo.setName ("PK_TMP_DIR");
-               zypp_build_pool (backend, true);
 
                // add Repo to pool
-
-               RepoManager manager;
                manager.addRepository (tmpRepo);
 
-               if (!zypp_refresh_meta_and_cache (manager, tmpRepo))
-                       return FALSE;
+               if (!zypp_refresh_meta_and_cache (manager, tmpRepo)) {
+                       return zypp_backend_finished_error (
+                         backend, PK_ERROR_ENUM_INTERNAL_ERROR, "Can't refresh 
repositories");
+               }
+               zypp_build_pool (backend, true);
 
-       } catch (const url::UrlException &ex) {
-               return zypp_backend_finished_error (
-                       backend, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString 
().c_str ());
        } catch (const Exception &ex) {
                return zypp_backend_finished_error (
                        backend, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString 
().c_str ());
        }
 
        bool error = false;
-       for (guint i = 0; full_paths[i]; i++) {
-
-               Pathname rpmPath (full_paths[i]);
-               target::rpm::RpmHeader::constPtr rpmHeader = 
target::rpm::RpmHeader::readPackage (rpmPath, 
target::rpm::RpmHeader::NOSIGNATURE);
 
-               // look for the packages and set them to toBeInstalled
-               vector<sat::Solvable> solvables;
-               zypp_get_packages_by_name (backend, rpmHeader->tag_name 
().c_str (), ResKind::package, solvables, TRUE);
-               PoolItem *item = NULL;
-
-               gboolean found = FALSE;
-
-               for (vector<sat::Solvable>::iterator it = solvables.begin (); 
it != solvables.end (); it ++) {
-                      if (it->repository ().alias () == "PK_TMP_DIR") {
-                              item = new PoolItem(*it);
-                              found = TRUE;
-                              break;
-                      }
-               }
+       Repository repo = ResPool::instance().reposFind("PK_TMP_DIR");
 
-               if (!found) {
-                       error = true;
-                       pk_backend_error_code (backend, 
PK_ERROR_ENUM_INTERNAL_ERROR, "Could not find the rpm-Package in Pool");
-               } else if (!error) {
-                       ResStatus status = item->status ().setToBeInstalled 
(ResStatus::USER);
-               }
-               if (!error && !zypp_perform_execution (backend, INSTALL, 
FALSE)) {
-                       error = true;
-                       pk_backend_error_code (backend, 
PK_ERROR_ENUM_LOCAL_INSTALL_FAILED, "Could not install the rpm-file.");
-               }
+       for_(it, repo.solvablesBegin(), repo.solvablesEnd()){
+               MIL << "Setting " << *it << " for installation" << endl;
+               PoolItem(*it).status().setToBeInstalled(ResStatus::USER);
+       }
 
-               item->statusReset ();
-               delete (item);
+       if (!zypp_perform_execution (backend, INSTALL, FALSE)) {
+               pk_backend_error_code (backend, 
PK_ERROR_ENUM_LOCAL_INSTALL_FAILED, "Could not install the rpm-file.");
        }
 
        // remove tmp-dir and the tmp-repo
        try {
-               RepoManager manager;
                manager.removeRepository (tmpRepo);
        } catch (const repo::RepoNotFoundException &ex) {
                pk_backend_error_code (backend, PK_ERROR_ENUM_REPO_NOT_FOUND, 
ex.asUserString().c_str() );
@@ -1070,6 +1057,8 @@ pk_backend_update_system (PkBackend *backend, gboolean 
only_trusted)
 static gboolean
 backend_install_packages_thread (PkBackend *backend)
 {
+       MIL << endl;
+       PoolStatusSaver saver;
        gchar **package_ids;
 
        // refresh the repos before installing packages
@@ -1230,6 +1219,8 @@ pk_backend_install_signature (PkBackend *backend, 
PkSigTypeEnum type, const gcha
 static gboolean
 backend_remove_packages_thread (PkBackend *backend)
 {
+       MIL << endl;
+       PoolStatusSaver saver;
        gboolean autoremove;
        gchar **package_ids;
        vector<PoolItem> *items = new vector<PoolItem> ();
@@ -1783,6 +1774,8 @@ pk_backend_get_packages (PkBackend *backend, PkBitfield 
filter)
 static gboolean
 backend_update_packages_thread (PkBackend *backend)
 {
+       MIL << endl;
+       PoolStatusSaver saver;
        gboolean retval;
        gchar **package_ids;
        ZYpp::Ptr zypp;
-- 
1.7.6.4

++++++ 0003-fix-slowness-bnc-679650.patch ++++++
>From 5f1d1aeb570c5b4a711ec82447975e66a3443fca Mon Sep 17 00:00:00 2001
From: Duncan Mac-Vicar P <[email protected]>
Date: Tue, 26 Jul 2011 11:32:59 +0200
Subject: [PATCH 3/8] fix slowness (bnc#679650)

---
 backends/zypp/zypp-utils.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp
index 68d59da..8fc69bd 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -352,7 +352,7 @@ zypp_get_packages_by_name (PkBackend *backend,
                           vector<sat::Solvable> &result,
                           gboolean include_local)
 {
-       ResPool pool = zypp_build_pool (backend, include_local);
+       ResPool pool(ResPool::instance());
 
         for (ResPool::byIdent_iterator it = pool.byIdentBegin (kind, 
package_name);
                         it != pool.byIdentEnd (kind, package_name); it++) {
-- 
1.7.6.4

++++++ 0004-Change-the-configuration-of-the-cron-script-to-a-sys.patch ++++++
>From 0762e3890582a3374eea794a2e1ca12c2bcdac43 Mon Sep 17 00:00:00 2001
From: Vincent Untz <[email protected]>
Date: Tue, 26 Jul 2011 11:34:22 +0200
Subject: [PATCH 4/8] Change the configuration of the cron script to a
 sysconfig-like config

---
 contrib/cron/packagekit-background |   43 +++++++++++++++++++++++++++--------
 1 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/contrib/cron/packagekit-background 
b/contrib/cron/packagekit-background
index e5b5c9b..783e2df 100644
--- a/contrib/cron/packagekit-background
+++ b/contrib/cron/packagekit-background
@@ -1,18 +1,41 @@
-# should we attempt to do this? (valid: yes|no)
+## Path:       System/Cron/PackageKit
+## Description: Cron job to update the system daily with PackageKit
+
+## Type:       yesno
+## Default:    no
+#
+# Run the cron job.
+#
 ENABLED=no
 
-# don't install, just check (valid: yes|no)
+## Type:       yesno
+## Default:    no
+#
+# Check if updates are available, instead of installing.
+#
 CHECK_ONLY=no
 
-# if MAILTO is set, the mail command is used to deliver PackageKit output
-# by default MAILTO is unset, so crond mails the output by itself
-#MAILTO=root
+## Type:       string
+## Default:    ""
+#
+# If MAILTO is set, the mail command is used to deliver PackageKit output.
+# By default MAILTO is unset, so crond mails the output by itself.
+#
+MAILTO=""
 
-# you may set SYSTEM_NAME if you want your PackageKit emails tagged 
-# differently default is output of hostname command
-#SYSTEM_NAME=""
+## Type:       string
+## Default:    ""
+#
+# You may set SYSTEM_NAME if you want your PackageKit emails tagged 
differently.
+# Default is output of hostname command.
+#
+SYSTEM_NAME=""
 
-# update checks will sleep random time before contacting the servers to
+## Type:       integer
+## Default:    3600
+#
+# Update checks will sleep random time before contacting the servers to
 # avoid hammering them with thousands of request at the same time - this
-# is the maximum sleep time (in seconds) for the random wait period
+# is the maximum sleep time (in seconds) for the random wait period.
+#
 SLEEP_MAX=3600
-- 
1.7.6.4

++++++ 0005-fix-build-with-11.4-gtk2-2.21.patch ++++++
>From dd0fc72535c813d3ab43f5081aa814a479c9da7e Mon Sep 17 00:00:00 2001
From: Marcus Meissner <[email protected]>
Date: Tue, 26 Jul 2011 11:35:18 +0200
Subject: [PATCH 5/8] fix build with 11.4 gtk2 2.21

---
 contrib/browser-plugin/pk-main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/browser-plugin/pk-main.c b/contrib/browser-plugin/pk-main.c
index b9378cb..62914e0 100644
--- a/contrib/browser-plugin/pk-main.c
+++ b/contrib/browser-plugin/pk-main.c
@@ -219,7 +219,7 @@ pk_main_create_window (PkPlugin *plugin)
                }
 
                /* get parent */
-               parent = gdk_x11_window_foreign_new_for_display (gdk_display, 
xwindow);
+               parent = gdk_window_foreign_new_for_display (gdk_display, 
xwindow);
                if (parent == NULL) {
                        pk_debug ("invalid window given for setup (id %lu)\n", 
xwindow);
                        return;
-- 
1.7.6.4

++++++ 0006-dont-call-build-pool-inside-the-loop.patch ++++++
>From 8d0be51e6a5380cbf1dc373eb7bd5d98db04e518 Mon Sep 17 00:00:00 2001
From: Duncan Mac-Vicar P <[email protected]>
Date: Tue, 26 Jul 2011 11:21:37 +0200
Subject: [PATCH 6/8] dont call build pool inside the loop

---
 backends/zypp/pk-backend-zypp.cpp |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/backends/zypp/pk-backend-zypp.cpp 
b/backends/zypp/pk-backend-zypp.cpp
index 85b7cbb..e885cb0 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -185,13 +185,12 @@ backend_get_requires_thread (PkBackend *backend)
        //pk_backend_set_percentage (backend, 0);
 
        PoolStatusSaver saver;
+       ResPool pool = zypp_build_pool (backend, true);
        for (uint i = 0; package_ids[i]; i++) {
                sat::Solvable solvable = zypp_get_package_by_id (backend, 
package_ids[i]);
                PoolItem package;
 
                if (solvable.isSystem ()) {
-                       ResPool pool = zypp_build_pool (backend, true);
-
                        gboolean found = FALSE;
                        gchar **id_parts = pk_package_id_split (package_ids[i]);
 
-- 
1.7.6.4

++++++ 0007-only-load-repositories-once.patch ++++++
>From 724c2bf491a34a800604b2ac333906e656c46a2e Mon Sep 17 00:00:00 2001
From: Duncan Mac-Vicar P <[email protected]>
Date: Tue, 26 Jul 2011 11:20:51 +0200
Subject: [PATCH 7/8] only load repositories once

---
 backends/zypp/zypp-utils.cpp |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp
index 8fc69bd..4b84300 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -192,8 +192,11 @@ zypp_is_valid_repo (PkBackend *backend, RepoInfo repo)
 ResPool
 zypp_build_pool (PkBackend *backend, gboolean include_local)
 {
+       static gboolean repos_loaded = FALSE;
+
        ZYpp::Ptr zypp = get_zypp (backend);
 
+       // the target is loaded or unloaded on request
        if (include_local) {
                // FIXME have to wait for fix in zypp (repeated loading of 
target)
                if (sat::Pool::instance().reposFind( 
sat::Pool::systemRepoAlias() ).solvablesEmpty ())
@@ -211,6 +214,10 @@ zypp_build_pool (PkBackend *backend, gboolean 
include_local)
                }
        }
 
+       // we only load repositories once.
+       if (repos_loaded)
+               return zypp->pool();
+
        // Add resolvables from enabled repos
        RepoManager manager;
        list<RepoInfo> repos;
@@ -230,7 +237,9 @@ zypp_build_pool (PkBackend *backend, gboolean include_local)
                         //FIXME see above, skip already cached repos
                         if (sat::Pool::instance().reposFind( repo.alias ()) == 
Repository::noRepository)
                                 manager.loadFromCache (repo);
+
                }
+               repos_loaded = true;
        } catch (const repo::RepoNoAliasException &ex) {
                 g_error ("Can't figure an alias to look in cache");
         } catch (const repo::RepoNotCachedException &ex) {
-- 
1.7.6.4

++++++ 0008-bmc-17596-meego-PackageKit-hangs-during-some-transac.patch ++++++
>From b8d9fec8c8951f2b1da53c40db9d00e500388474 Mon Sep 17 00:00:00 2001
From: Duncan Mac-Vicar P <[email protected]>
Date: Mon, 10 Oct 2011 13:58:55 +0200
Subject: [PATCH 8/8] bmc#17596 (meego) - PackageKit hangs during some
 transactions (edit)

---
 backends/zypp/zypp-events.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/backends/zypp/zypp-events.h b/backends/zypp/zypp-events.h
index 5877f8d..0ea0dd6 100644
--- a/backends/zypp/zypp-events.h
+++ b/backends/zypp/zypp-events.h
@@ -303,7 +303,7 @@ struct DownloadProgressReportReceiver : public 
zypp::callback::ReceiveReport<zyp
        virtual void start (const zypp::Url &file, zypp::Pathname localfile)
        {
                clear_package_id ();
-               _package_id = build_package_id_from_url (&file);
+    _package_id = g_strdup (zypp::Pathname (file.getPathName ()).basename 
().c_str());
 
                //g_debug ("DownloadProgressReportReceiver::start():%s --%s\n",
                //              g_strdup (file.asString().c_str()),     
g_strdup (localfile.asString().c_str()) );
-- 
1.7.6.4

++++++ 0009-Workaround-Don-t-refresh-repositories-each-time-for-.patch ++++++
>From 9a704288d7e68cf4a8cbc6203616fdd5b62691be Mon Sep 17 00:00:00 2001
From: Duncan Mac-Vicar P <[email protected]>
Date: Wed, 19 Oct 2011 12:53:07 +0200
Subject: [PATCH] Workaround: Don't refresh repositories each time for
 operations called in batches like package search.

---
 backends/zypp/pk-backend-zypp.cpp |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/backends/zypp/pk-backend-zypp.cpp 
b/backends/zypp/pk-backend-zypp.cpp
index e885cb0..a893977 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -1398,6 +1398,8 @@ pk_backend_resolve (PkBackend *backend, PkBitfield 
filters, gchar **package_ids)
 static gboolean
 backend_find_packages_thread (PkBackend *backend)
 {
+       static bool refreshed = false;
+
        MIL << endl;
        gchar **values;
        const gchar *search;
@@ -1411,9 +1413,13 @@ backend_find_packages_thread (PkBackend *backend)
        }
 
        // refresh the repos before searching
-       if (!zypp_refresh_cache (backend, FALSE)) {
-               pk_backend_finished (backend);
-               return FALSE;
+       if (!refreshed) {
+               if (!zypp_refresh_cache (backend, FALSE)) {
+                       pk_backend_finished (backend);
+                       return FALSE;
+               }
+               else
+                       refreshed = true;
        }
 
        values = pk_backend_get_strv (backend, "search");
@@ -2075,10 +2081,15 @@ backend_download_packages_thread (PkBackend *backend)
        MIL << endl;
        gchar **package_ids;
        gulong size = 0;
+       static bool refreshed = false;
 
-       if (!zypp_refresh_cache (backend, FALSE)) {
-               pk_backend_finished (backend);
-               return FALSE;
+       if (! refreshed) {
+               if (!zypp_refresh_cache (backend, FALSE)) {
+                       pk_backend_finished (backend);
+                       return FALSE;
+               }
+               else
+                       refreshed = true;
        }
 
        ZYpp::Ptr zypp;
-- 
1.7.6.4

continue with "q"...



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to