]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
Checked the size of partial files #33705
[apt.git] / cmdline / apt-get.cc
index 81c350dfa52dd2dbf5d4f5c095a19f9b3ac12633..73397e8aeab1446f688df3fd0a72cbbaaf4f1254 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-get.cc,v 1.46 1999/03/27 01:30:38 jgg Exp $
+// $Id: apt-get.cc,v 1.47 1999/03/27 03:02:39 jgg Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -543,6 +543,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
 
    // Display statistics
    unsigned long FetchBytes = Fetcher.FetchNeeded();
+   unsigned long FetchPBytes = Fetcher.PartialPresent();
    unsigned long DebBytes = Fetcher.TotalNeeded();
    if (DebBytes != Cache->DebSize())
    {
@@ -556,7 +557,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,bool Saftey =
    if (statfs(OutputDir.c_str(),&Buf) != 0)
       return _error->Errno("statfs","Couldn't determine free space in %s",
                           OutputDir.c_str());
-   if (unsigned(Buf.f_bfree) < FetchBytes/Buf.f_bsize)
+   if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
       return _error->Error("Sorry, you don't have enough free space in %s",
                           OutputDir.c_str());