state: bugfix in the package version selector

cute-signatures
Natanael Copa 2009-06-16 09:55:45 +00:00
parent 49c904c993
commit 0dfc53b0c3
1 changed files with 5 additions and 2 deletions

View File

@ -201,11 +201,14 @@ int apk_state_lock_dependency(struct apk_state *state,
/* Multiple candidates: prune incompatible versions. */
c = ns_to_choices(state->name[name->id]);
for (i = 0; i < c->num; i++) {
i = 0;
while (i < c->num) {
if (apk_version_compare(APK_BLOB_STR(c->pkgs[i]->version),
APK_BLOB_STR(dep->version))
& dep->result_mask)
& dep->result_mask) {
i++;
continue;
}
c = name_choices_writable(c);
c->pkgs[i] = c->pkgs[c->num - 1];