diff --git a/qpkg/prereq.c b/qpkg/prereq.c index 1ddc125..cf9c7bd 100644 --- a/qpkg/prereq.c +++ b/qpkg/prereq.c @@ -210,12 +210,11 @@ static void resolve(struct list *next_dep, const struct ref *dep, continue; level++; append_install(pkg); - more_deps.refs = pkg->depends; + more_deps.refs = dep->next; more_deps.next = next_dep; more_conf.refs = pkg->conflicts; more_conf.next = conf; - resolve(&more_deps, dep->next, &more_conf); - next_dep = more_deps.next; + resolve(&more_deps, pkg->depends, &more_conf); backtrack(); level--; } @@ -224,13 +223,8 @@ static void resolve(struct list *next_dep, const struct ref *dep, struct pkg **prereq(struct pkg *pkg) { - struct list deps = { - .refs = pkg->depends, - .next = NULL - }; - /* @@@ make list of pre-existing conflicts */ - resolve(&deps, NULL, NULL); + resolve(NULL, pkg->depends, NULL); free(installs); return best; } diff --git a/qpkg/test/resorder b/qpkg/test/resorder new file mode 100755 index 0000000..7b1c943 --- /dev/null +++ b/qpkg/test/resorder @@ -0,0 +1,40 @@ +#!/bin/sh +. ./Common + +############################################################################### + +qpkg "resolution order" prereq A <