diff options
-rw-r--r-- | apt-pkg/orderlist.cc | 34 | ||||
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | test/integration/test-bug-590438-broken-provides-thanks-to-remove-order | 4 |
3 files changed, 32 insertions, 9 deletions
diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index 602b63d3b..a53854a26 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -967,13 +967,33 @@ bool pkgOrderList::DepRemove(DepIterator D) // start again in the or group and find something which will serve as replacement for (; F.end() == false && F != S; ++F) { - if (F.TargetPkg() == D.TargetPkg() || - IsFlag(F.TargetPkg(), InList) == false || - VisitNode(F.TargetPkg()) == false) - continue; - Flag(F.TargetPkg(), Immediate); - tryFixDeps = false; - break; + if (IsFlag(F.TargetPkg(), InList) == true && + IsFlag(F.TargetPkg(), AddPending) == false && + Cache[F.TargetPkg()].InstallVer != 0 && + VisitNode(F.TargetPkg()) == true) + { + Flag(F.TargetPkg(), Immediate); + tryFixDeps = false; + break; + } + else if (F.TargetPkg()->ProvidesList != 0) + { + pkgCache::PrvIterator Prv = F.TargetPkg().ProvidesList(); + for (; Prv.end() == false; ++Prv) + { + if (IsFlag(Prv.OwnerPkg(), InList) == true && + IsFlag(Prv.OwnerPkg(), AddPending) == false && + Cache[Prv.OwnerPkg()].InstallVer != 0 && + VisitNode(Prv.OwnerPkg()) == true) + { + Flag(Prv.OwnerPkg(), Immediate); + tryFixDeps = false; + break; + } + } + if (Prv.end() == false) + break; + } } if (tryFixDeps == false) break; diff --git a/debian/changelog b/debian/changelog index ae547bcff..510bc453c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ apt (0.8.9) UNRELEASED; urgency=low [ David Kalnischkies ] * apt-pkg/aptconfiguration.cc: - respect the none-force even in LANG=C (Closes: #602573) + * apt-pkg/orderlist.cc: + - try fixing before removing even if the fix is hidden in + a provides, hidden in the #590438 testcase -- David Kalnischkies <kalnischkies@gmail.com> Sat, 06 Nov 2010 12:50:20 +0100 diff --git a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order index 3be0bec48..0f6493948 100755 --- a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order +++ b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order @@ -25,7 +25,7 @@ MD5sum: 8489687ce10e656babd467c9ee389349 Description-de: Verschiedene Dateien für das Basis-System von Debian" predependsgawk() { -# rm rootdir/var/cache/apt/*.bin + rm rootdir/var/cache/apt/*.bin cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status echo "$pkgbasefile Pre-Depends: $1 @@ -57,7 +57,7 @@ predependsgawk "awk | aawk" predependsgawk "awk" predependsgawk2() { -# rm rootdir/var/cache/apt/*.bin + rm rootdir/var/cache/apt/*.bin cp $TESTDIR/$(echo "$(basename $0)" | sed 's/test-/status-/') rootdir/var/lib/dpkg/status echo "$pkgbasefile Pre-Depends: $1 |