From: Daniel Golle Date: Mon, 2 Nov 2020 22:44:43 +0000 (+0000) Subject: libopkg: work-around yet another dependency checking problem X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=383748952eb927737de89a5791599a0ca8f96c4d;p=project%2Fopkg-lede.git libopkg: work-around yet another dependency checking problem Signed-off-by: Daniel Golle --- diff --git a/libopkg/pkg.h b/libopkg/pkg.h index 21108b3..28998f3 100644 --- a/libopkg/pkg.h +++ b/libopkg/pkg.h @@ -114,6 +114,7 @@ struct abstract_pkg { abstract_pkg_vec_t *replaced_by; int dependencies_checked:2; + int prev_dependencies_checked:2; pkg_state_status_t state_status:4; pkg_state_flag_t state_flag:11; }; diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c index 098206d..6eeedec 100644 --- a/libopkg/pkg_hash.c +++ b/libopkg/pkg_hash.c @@ -283,6 +283,12 @@ pkg_hash_check_unresolved(pkg_t *maybe) int i, res = 0; depends = pkg_vec_alloc(); + all = pkg_vec_alloc(); + pkg_hash_fetch_available(all); + /* backup dependencies_checked marks, they get destroyed by pkg_hash_fetch_unsatisfied_dependencies */ + for (i = 0; i < all->len; i++) + all->pkgs[i]->parent->prev_dependencies_checked = all->pkgs[i]->parent->dependencies_checked; + pkg_hash_fetch_unsatisfied_dependencies(maybe, depends, &unresolved); if (unresolved) { @@ -294,12 +300,10 @@ pkg_hash_check_unresolved(pkg_t *maybe) } pkg_vec_free(depends); - /* clear depenacy checked marks, left by pkg_hash_fetch_unsatisfied_dependencies */ - all = pkg_vec_alloc(); - pkg_hash_fetch_available(all); - for (i = 0; i < all->len; i++) { - all->pkgs[i]->parent->dependencies_checked = 0; - } + /* restore dependencies_checked marks */ + for (i = 0; i < all->len; i++) + all->pkgs[i]->parent->dependencies_checked = all->pkgs[i]->parent->prev_dependencies_checked; + pkg_vec_free(all); return res;