summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-01-17 14:18:10 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-01-17 14:18:10 +0200
commit64b03ab603425560cf752b95350374296729a167 (patch)
treecd5f285d69a72c1d47f9cdcfe0fb4840f95d9d0c /src
parent12183024fd6bce3b06f1fab843dd8781dd35e036 (diff)
downloadapk-tools-64b03ab603425560cf752b95350374296729a167.tar.gz
apk-tools-64b03ab603425560cf752b95350374296729a167.tar.bz2
apk-tools-64b03ab603425560cf752b95350374296729a167.tar.xz
apk-tools-64b03ab603425560cf752b95350374296729a167.zip
solver: fix change ordering of removed pages in relation to installed
Diffstat (limited to 'src')
-rw-r--r--src/solver.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/solver.c b/src/solver.c
index 5f1c635..959e56f 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -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;
}