summaryrefslogtreecommitdiff
path: root/apt-pkg/orderlist.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:11 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:11 +0000
commit2fd65468b3cb25c725a709f9b470ced0ab4823a6 (patch)
treeca4ae9007380e92eac7b4c9b0ac14f0335413543 /apt-pkg/orderlist.cc
parent29f7b36cd63f16ceab825531b5c131eac4b99f9b (diff)
Fixed handling of missing files
Author: jgg Date: 1999-07-04 23:22:53 GMT Fixed handling of missing files
Diffstat (limited to 'apt-pkg/orderlist.cc')
-rw-r--r--apt-pkg/orderlist.cc27
1 files changed, 23 insertions, 4 deletions
diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc
index c831e9a71..7cdea188e 100644
--- a/apt-pkg/orderlist.cc
+++ b/apt-pkg/orderlist.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: orderlist.cc,v 1.4 1999/07/03 03:10:35 jgg Exp $
+// $Id: orderlist.cc,v 1.5 1999/07/04 23:22:53 jgg Exp $
/* ######################################################################
Order List - Represents and Manipulates an ordered list of packages.
@@ -89,6 +89,25 @@ pkgOrderList::~pkgOrderList()
delete [] Flags;
}
/*}}}*/
+// OrderList::IsMissing - Check if a file is missing /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+bool pkgOrderList::IsMissing(PkgIterator Pkg)
+{
+ // Skip packages to erase
+ if (Cache[Pkg].Delete() == true)
+ return false;
+
+ // Skip Packages that need configure only.
+ if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure &&
+ Cache[Pkg].Keep() == true)
+ return false;
+
+ if (FileList != 0 && FileList[Pkg->ID].empty() == false)
+ return false;
+ return true;
+}
+ /*}}}*/
// OrderList::DoRun - Does an order run /*{{{*/
// ---------------------------------------------------------------------
@@ -299,9 +318,9 @@ int pkgOrderList::OrderCompareA(const void *a, const void *b)
// We order missing files to toward the end
if (Me->FileList != 0)
{
- if ((Res = BoolCompare(Me->FileList[A->ID].empty() && !Me->Cache[A].Delete(),
- Me->FileList[B->ID].empty() && !Me->Cache[B].Delete())) == 0)
- return -1*Res;
+ if ((Res = BoolCompare(Me->IsMissing(A),
+ Me->IsMissing(B))) == 0)
+ return Res;
}
if (A.State() != pkgCache::PkgIterator::NeedsNothing &&