]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire.cc
Source record file list parsing
[apt.git] / apt-pkg / acquire.cc
index 80624f9d3341bbc209123b8ca9b94cecc10490ff..2e8a05e2cec6965de074691acb89011bab1c9479 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acquire.cc,v 1.29 1999/03/16 00:43:55 jgg Exp $
+// $Id: acquire.cc,v 1.31 1999/03/27 03:02:38 jgg Exp $
 /* ######################################################################
 
    Acquire - File Acquiration
@@ -25,6 +25,7 @@
 
 #include <dirent.h>
 #include <sys/time.h>
+#include <errno.h>
                                                                        /*}}}*/
 
 // Acquire::pkgAcquire - Constructor                                   /*{{{*/
@@ -419,6 +420,18 @@ unsigned long pkgAcquire::FetchNeeded()
    return Total;
 }
                                                                        /*}}}*/
+// Acquire::PartialPresent - Number of partial bytes we already have   /*{{{*/
+// ---------------------------------------------------------------------
+/* This is the number of bytes that is not local */
+unsigned long pkgAcquire::PartialPresent()
+{
+   unsigned long Total = 0;
+   for (pkgAcquire::Item **I = ItemsBegin(); I != ItemsEnd(); I++)
+      if ((*I)->Local == false)
+        Total += (*I)->PartialSize;
+   return Total;
+}
+                                                                       /*}}}*/
 // pkgAcquire::UriBegin - Start iterator for the uri list              /*{{{*/
 // ---------------------------------------------------------------------
 /* */