solver: fix change ordering of removed pages in relation to installed

cute-signatures
Timo Teräs 2012-01-17 14:18:10 +02:00
parent 12183024fd
commit 64b03ab603
1 changed files with 6 additions and 5 deletions

View File

@ -913,19 +913,20 @@ static int compare_change(const void *p1, const void *p2)
const struct apk_change *c2 = (const struct apk_change *) p2;
if (c1->newpkg == NULL) {
if (c2->newpkg == NULL)
if (c2->newpkg == NULL) {
/* both deleted - reverse topology order */
return c2->oldpkg->topology_hard -
return c2->oldpkg->topology_hard -
c1->oldpkg->topology_hard;
}
/* c1 deleted, c2 installed -> c2 first*/
return -1;
return 1;
}
if (c2->newpkg == NULL)
/* c1 installed, c2 deleted -> c1 first*/
return 1;
return -1;
return c1->newpkg->topology_hard -
return c1->newpkg->topology_hard -
c2->newpkg->topology_hard;
}