summaryrefslogtreecommitdiff
path: root/apt-pkg/orderlist.cc
diff options
context:
space:
mode:
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 &&