libopkg: implement lightweight package listing logic
[oweals/opkg-lede.git] / libopkg / pkg_depends.c
index 748b5999393e6627ac5df5b3dcbf5aa2456618d9..3abdcd38c4436468bed71929c7114ceb3dfacdc9 100644 (file)
@@ -37,8 +37,7 @@ static int pkg_installed_and_constraint_satisfied(pkg_t * pkg, void *cdata)
        depend_t *depend = (depend_t *) cdata;
        if ((pkg->state_status == SS_INSTALLED
             || pkg->state_status == SS_UNPACKED)
-           && version_constraints_satisfied(depend, pkg)
-           && !(pkg->state_flag & SF_IGNORE))
+           && version_constraints_satisfied(depend, pkg))
                return 1;
        else
                return 0;
@@ -47,8 +46,7 @@ static int pkg_installed_and_constraint_satisfied(pkg_t * pkg, void *cdata)
 static int pkg_constraint_satisfied(pkg_t * pkg, void *cdata)
 {
        depend_t *depend = (depend_t *) cdata;
-       if (version_constraints_satisfied(depend, pkg)
-           && !(pkg->state_flag & SF_IGNORE))
+       if (version_constraints_satisfied(depend, pkg))
                return 1;
        else
                return 0;
@@ -668,9 +666,8 @@ void parse_replacelist(pkg_t *pkg, char *list)
 
        abstract_pkg_vec_insert(ab_pkg->provided_by, ab_pkg);
 
-       for (count = 1, item = strtok_r(list, ", ", &tok);
-            item;
-            count++, item = strtok_r(NULL, ", ", &tok), count++) {
+       for (count = 1, item = strtok_r(list, ", ", &tok); item;
+            count++, item = strtok_r(NULL, ", ", &tok)) {
                tmp = realloc(replaces, sizeof(abstract_pkg_t *) * (count + 1));
 
                if (!tmp)