summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2013-05-08 17:48:31 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2013-05-08 17:48:31 +0200
commit597341fe0f0a87c3888a62ce02631db8b25aeb4b (patch)
tree6565f0a8cca0cd8fe7be4bb4149edfbfb62c7ce2 /apt-pkg/algorithms.cc
parentb5595da902e62af7c295f1603ae5b43ba4cef281 (diff)
parentdec5b117052b77e4366efd8234e0cec09989b700 (diff)
merged from the debian-wheezy branch
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r--apt-pkg/algorithms.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 7fcd9f0db..6cde4d6cc 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -648,7 +648,10 @@ void pkgProblemResolver::MakeScores()
D->Type != pkgCache::Dep::Recommends))
continue;
- Scores[I->ID] += abs(OldScores[D.ParentPkg()->ID]);
+ // Do not propagate negative scores otherwise
+ // an extra (-2) package might score better than an optional (-1)
+ if (OldScores[D.ParentPkg()->ID] > 0)
+ Scores[I->ID] += OldScores[D.ParentPkg()->ID];
}
}