summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libopkg/opkg_install.c13
-rw-r--r--libopkg/opkg_remove.c7
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; i<old_pkg->depends_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; i<count0; i++) {
cd0 = &old_pkg->depends[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; k<pkg->depends_count; k++) {
+ for (k=0; k<count1; k++) {
cd1 = &pkg->depends[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; i<pkg->depends_count; i++) {
+ int count = pkg->pre_depends_count +
+ pkg->depends_count +
+ pkg->recommends_count +
+ pkg->suggests_count;
+
+ for (i=0; i<count; i++) {
cdep = &pkg->depends[i];
if (cdep->type != DEPEND)
continue;