diff options
author | Christopher Baines <cbaines8@gmail.com> | 2011-08-07 16:35:36 +0100 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2011-08-07 16:35:36 +0100 |
commit | b9f668796339b7581f49ee6d42c53dc10049e5c2 (patch) | |
tree | fc01f0cf2aee15afff333947c0e1a2be928d830b | |
parent | 11b87a08ee6952c5b66b14842283df3ea26b90ac (diff) |
Fixed a bug on line 623, I picked this up after seeing SmartUnpack trying to remove packages once they were confiured to solve Conflicts with the previous version!
Luckily EarlyRemove is sane, and properly checks, so I think this was just cosmetic.
Also fixed a bug on line 374 with SmartUnpack not checking if a dependancy has been removed, this bug was definately harmful.
-rw-r--r-- | apt-pkg/packagemanager.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 324b7ffba..b3c3d2591 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -344,7 +344,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg) InstallVer = VerIterator(Cache,Cache[DepPkg].InstallVer); //VerIterator CandVer(Cache,Cache[DepPkg].CandidateVer); - if (Debug && false) { + if (Debug) { if (Ver==0) { cout << " Checking if " << Ver << " of " << DepPkg.Name() << " satisfies this dependancy" << endl; } else { @@ -365,13 +365,13 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg) //if (CandVer != 0) // cout << " CandVer " << CandVer.VerStr() << endl; - cout << " Keep " << Cache[DepPkg].Keep() << " Unpacked " << List->IsFlag(DepPkg,pkgOrderList::UnPacked) << " Configured " << List->IsFlag(DepPkg,pkgOrderList::Configured) << endl; + cout << " Keep " << Cache[DepPkg].Keep() << " Unpacked " << List->IsFlag(DepPkg,pkgOrderList::UnPacked) << " Configured " << List->IsFlag(DepPkg,pkgOrderList::Configured) << " Removed " << List->IsFlag(DepPkg,pkgOrderList::Removed) << endl; } // Check if it satisfies this dependancy if (DepPkg.CurrentVer() == Ver && List->IsNow(DepPkg) == true && - DepPkg.State() == PkgIterator::NeedsNothing) + !List->IsFlag(DepPkg,pkgOrderList::Removed) && DepPkg.State() == PkgIterator::NeedsNothing) { Bad = false; continue; @@ -623,7 +623,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate) VerIterator InstallVer(Cache,Cache[ConflictPkg].InstallVer); // See if the current version is conflicting - if (ConflictPkg.CurrentVer() == Ver && !List->IsFlag(ConflictPkg,pkgOrderList::UnPacked)) + if (ConflictPkg.CurrentVer() == Ver && List->IsNow(ConflictPkg)) { if (Debug && false) cout << " " << Pkg.Name() << " conflicts with " << ConflictPkg.Name() << endl; @@ -653,7 +653,8 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate) if (!List->IsFlag(ConflictPkg,pkgOrderList::Loop)) { if (Cache[ConflictPkg].Keep() == 0 && Cache[ConflictPkg].InstallVer != 0) { - cout << "Unpacking " << ConflictPkg.Name() << " to prevent conflict" << endl; + if (Debug) + cout << "Unpacking " << ConflictPkg.Name() << " to prevent conflict" << endl; List->Flag(Pkg,pkgOrderList::Loop); SmartUnPack(ConflictPkg,false); } else { @@ -662,7 +663,8 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate) } } else { if (!List->IsFlag(ConflictPkg,pkgOrderList::Removed)) { - cout << "Because of conficts knot, removing " << ConflictPkg.Name() << " to conflict violation" << endl; + if (Debug) + cout << "Because of conficts knot, removing " << ConflictPkg.Name() << " to conflict violation" << endl; if (EarlyRemove(ConflictPkg) == false) return _error->Error("Internal Error, Could not early remove %s",ConflictPkg.Name()); } |