From da516f8c8ef6bc6275216eb256afa5ab5b94b688 Mon Sep 17 00:00:00 2001 From: "graham.gower" Date: Fri, 20 Nov 2009 03:35:47 +0000 Subject: [PATCH] Iterate the whole depends array, in the unlikely event that pre_depends_count!=0 git-svn-id: http://opkg.googlecode.com/svn/trunk@343 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- libopkg/opkg_install.c | 13 +++++++++++-- libopkg/opkg_remove.c | 7 ++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c index e28f6b4..f9245ca 100644 --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c @@ -586,7 +586,16 @@ pkg_remove_orphan_dependent(opkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg) struct compound_depend *cd0, *cd1; abstract_pkg_t **dependents; - for (i=0; idepends_count; i++) { + int count0 = old_pkg->pre_depends_count + + old_pkg->depends_count + + old_pkg->recommends_count + + old_pkg->suggests_count; + int count1 = pkg->pre_depends_count + + pkg->depends_count + + pkg->recommends_count + + pkg->suggests_count; + + for (i=0; idepends[i]; if (cd0->type != DEPEND) continue; @@ -594,7 +603,7 @@ pkg_remove_orphan_dependent(opkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg) found = 0; - for (k=0; kdepends_count; k++) { + for (k=0; kdepends[i]; if (cd1->type != DEPEND) continue; diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c index 3e90836..aba3512 100644 --- a/libopkg/opkg_remove.c +++ b/libopkg/opkg_remove.c @@ -176,7 +176,12 @@ remove_autoinstalled(opkg_conf_t *conf, pkg_t *pkg) struct compound_depend *cdep; abstract_pkg_t **dependents; - for (i=0; idepends_count; i++) { + int count = pkg->pre_depends_count + + pkg->depends_count + + pkg->recommends_count + + pkg->suggests_count; + + for (i=0; idepends[i]; if (cdep->type != DEPEND) continue; -- 2.25.1