/* find dependancies and download them */
deps = pkg_vec_alloc();
/* this function does not return the original package, so we insert it later */
- pkg_hash_fetch_unsatisfied_dependencies(new, deps, &unresolved);
+ pkg_hash_fetch_unsatisfied_dependencies(new, deps, &unresolved, 0);
if (unresolved) {
char **tmp = unresolved;
opkg_msg(ERROR, "Couldn't satisfy the following dependencies"
int ndepends;
ndepends = pkg_hash_fetch_unsatisfied_dependencies(pkg, depends,
- &unresolved);
+ &unresolved, 0);
if (unresolved) {
opkg_msg(ERROR,
abstract_pkg_vec_t *provided_by;
abstract_pkg_vec_t *replaced_by;
- int dependencies_checked:2;
- int prev_dependencies_checked:2;
+ char dependencies_checked;
+ char pre_dependencies_checked;
pkg_state_status_t state_status:4;
pkg_state_flag_t state_flag:11;
};
/* returns ndependencies or negative error value */
int
pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t * unsatisfied,
- char ***unresolved)
+ char ***unresolved, int pre_check)
{
pkg_t *satisfier_entry_pkg;
int i, j, k;
char **the_lost;
abstract_pkg_t *ab_pkg;
compound_depend_t *compound_depend;
+ char *check;
/*
* this is a setup to check for redundant/cyclic dependency checks,
*unresolved = NULL;
return 0;
}
- if (ab_pkg->dependencies_checked) { /* avoid duplicate or cyclic checks */
+
+ if(pre_check) {
+ check = &ab_pkg->pre_dependencies_checked;
+ } else {
+ check = &ab_pkg->dependencies_checked;
+ }
+
+ if (*check) { /* avoid duplicate or cyclic checks */
*unresolved = NULL;
return 0;
} else {
- ab_pkg->dependencies_checked = 1; /* mark it for subsequent visits */
+ /* mark it for subsequent visits */
+ *check = 1;
}
compound_depend = pkg_get_ptr(pkg, PKG_DEPENDS);
pkg_t *pkg_scout = test_vec->pkgs[k];
/* not installed, and not already known about? */
if ((pkg_scout->state_want != SW_INSTALL)
- && !pkg_scout->parent->dependencies_checked
+ && !(pre_check ? pkg_scout->parent->pre_dependencies_checked : pkg_scout->parent->dependencies_checked)
&& !is_pkg_in_pkg_vec(unsatisfied, pkg_scout)) {
char **newstuff = NULL;
int rc;
pkg_vec_t *tmp_vec = pkg_vec_alloc();
/* check for not-already-installed dependencies */
rc = pkg_hash_fetch_unsatisfied_dependencies(
- pkg_scout, tmp_vec, &newstuff);
+ pkg_scout, tmp_vec, &newstuff, pre_check);
if (newstuff == NULL) {
int m;
int ok = 1;
!is_pkg_in_pkg_vec(unsatisfied, satisfier_entry_pkg))
{
pkg_hash_fetch_unsatisfied_dependencies(
- satisfier_entry_pkg, unsatisfied, &newstuff);
+ satisfier_entry_pkg, unsatisfied, &newstuff, pre_check);
pkg_vec_insert(unsatisfied, satisfier_entry_pkg);
the_lost = merge_unresolved(the_lost, newstuff);
if (newstuff)
void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg);
int version_constraints_satisfied(depend_t * depends, pkg_t * pkg);
int pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t * depends,
- char ***unresolved);
+ char ***unresolved, int pre_check);
pkg_vec_t *pkg_hash_fetch_conflicts(pkg_t * pkg);
int pkg_dependence_satisfiable(depend_t * depend);
const char *constraint_to_str(enum version_constraint c);
{
char **unresolved = NULL;
char **tmp;
- pkg_vec_t *depends, *all;
- int i, res = 0;
+ pkg_vec_t *depends;
+ int 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);
+ pkg_hash_fetch_unsatisfied_dependencies(maybe, depends, &unresolved, 1);
if (unresolved) {
res = 1;
}
pkg_vec_free(depends);
- /* 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;
}
they show up twice sometimes. */
if ((arch_priority > 0)
&&
- (!pkg_vec_contains(matching_pkgs, maybe))
- &&
- (!pkg_hash_check_unresolved(maybe))) {
- max_count++;
- abstract_pkg_vec_insert(matching_apkgs,
- maybe->parent);
- pkg_vec_insert(matching_pkgs, maybe);
+ (!pkg_vec_contains(matching_pkgs, maybe))) {
+ if (!pkg_hash_check_unresolved(maybe)) {
+ max_count++;
+ abstract_pkg_vec_insert(matching_apkgs,
+ maybe->parent);
+ pkg_vec_insert(matching_pkgs, maybe);
+ }
}
}