[gnome-packagekit/gnome-2-28] Remove the original package from the dep-confirmation screen
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-packagekit/gnome-2-28] Remove the original package from the dep-confirmation screen
- Date: Tue, 27 Oct 2009 10:37:57 +0000 (UTC)
commit 0594707ff7af9d26e25d6f99f1761e39f7282e2e
Author: Richard Hughes <richard hughsie com>
Date: Tue Oct 27 10:36:58 2009 +0000
Remove the original package from the dep-confirmation screen
src/gpk-helper-deps-install.c | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/src/gpk-helper-deps-install.c b/src/gpk-helper-deps-install.c
index 73076ef..32b0b69 100644
--- a/src/gpk-helper-deps-install.c
+++ b/src/gpk-helper-deps-install.c
@@ -69,17 +69,37 @@ gpk_helper_deps_install_show (GpkHelperDepsInstall *helper, PkPackageList *packa
GtkResponseType response;
gchar *package_id;
const PkPackageObj *obj;
- guint i;
+ const PkPackageObj *obj_tmp;
+ guint i = 0, j;
/* remove cleanup packages */
- for (i=0; i<pk_package_list_get_size (deps_list); i++) {
+ while (i<pk_package_list_get_size (deps_list)) {
obj = pk_package_list_get_obj (deps_list, i);
if (obj->info == PK_INFO_ENUM_CLEANUP ||
obj->info == PK_INFO_ENUM_FINISHED) {
package_id = pk_package_id_to_string (obj->id);
pk_package_list_remove (deps_list, package_id);
g_free (package_id);
+ continue;
}
+
+ /* remove original packages */
+ ret = FALSE;
+ length = pk_package_list_get_size (packages);
+ for (j=0; j<length; j++) {
+ obj_tmp = pk_package_list_get_obj (packages, j);
+ if (pk_package_id_equal (obj_tmp->id, obj->id)) {
+ package_id = pk_package_id_to_string (obj->id);
+ pk_package_list_remove (deps_list, package_id);
+ g_free (package_id);
+ ret = TRUE;
+ }
+ }
+ if (ret)
+ continue;
+
+ /* only increment if we didn't remove a package */
+ i++;
}
/* empty list */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]