summaryrefslogtreecommitdiff
path: root/apt-pkg/packagemanager.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:52:54 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:52:54 +0000
commit9dbb421ffcf7da89f4010a14e64903189c5e472a (patch)
tree70755a8c46e8d5706bbed1ae297c1083ad1a7e8c /apt-pkg/packagemanager.cc
parent1084d58ae9a56d7d4c8a274112128f56302a3edc (diff)
Fixed weird to-configure inconsitency and added apt-cac...
Author: jgg Date: 1999-02-19 07:56:06 GMT Fixed weird to-configure inconsitency and added apt-cache search
Diffstat (limited to 'apt-pkg/packagemanager.cc')
-rw-r--r--apt-pkg/packagemanager.cc28
1 files changed, 23 insertions, 5 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index 0222b4445..1b58cc25d 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: packagemanager.cc,v 1.12 1999/01/31 06:24:46 jgg Exp $
+// $Id: packagemanager.cc,v 1.13 1999/02/19 07:56:07 jgg Exp $
/* ######################################################################
Package Manager - Abstacts the package manager
@@ -66,7 +66,8 @@ bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
continue;
// Skip Packages that need configure only.
- if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure)
+ if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure &&
+ Cache[Pkg].Keep() == true)
continue;
new pkgAcqArchive(Owner,Sources,Recs,Cache[Pkg].InstVerIter(Cache),
@@ -83,16 +84,33 @@ bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
bool pkgPackageManager::FixMissing()
{
pkgProblemResolver Resolve(Cache);
-
+
+ bool Bad = false;
for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
{
- if (Cache[I].Keep() == true)
+ // These don't need files
+ if (Cache[I].Keep() == true)
+ continue;
+ if (Cache[I].Delete() == true)
+ continue;
+
+ // We have a filename
+ if (FileNames[I->ID].empty() == false)
continue;
- if (FileNames[I->ID].empty() == false || Cache[I].Delete() == true)
+
+ // Skip Packages that need configure only.
+ if (I.State() == pkgCache::PkgIterator::NeedsConfigure &&
+ Cache[I].Keep() == true)
continue;
+
+ // Okay, this file is missing and we need it. Mark it for keep
+ Bad = true;
Cache.MarkKeep(I);
}
+ if (Bad == false)
+ return true;
+
// Now downgrade everything that is broken
return Resolve.ResolveByKeep() == true && Cache.BrokenCount() == 0;
}