diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:52:55 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:52:55 +0000 |
commit | 138d4b3d84035f2e0547d7de999d7c7ebb6b7adc (patch) | |
tree | 6ffdd48c33e81e682ea19bb1f68012acc92c3c6d /cmdline | |
parent | 7e2e2d5d4bf08549a535a484be9a258b7e9dcc61 (diff) | |
download | apt-138d4b3d84035f2e0547d7de999d7c7ebb6b7adc.tar.gz |
Free space check, fixed parser jump bug, added importat
Author: jgg
Date: 1999-02-21 08:38:53 GMT
Free space check, fixed parser jump bug, added importat
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/apt-get.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 451519c7..da364e03 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: apt-get.cc,v 1.42 1999/02/15 08:23:10 jgg Exp $ +// $Id: apt-get.cc,v 1.43 1999/02/21 08:38:53 jgg Exp $ /* ###################################################################### apt-get - Cover for dpkg @@ -46,6 +46,7 @@ #include <termios.h> #include <sys/ioctl.h> #include <sys/stat.h> +#include <sys/vfs.h> #include <signal.h> #include <unistd.h> #include <stdio.h> @@ -534,7 +535,17 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true) c0out << DebBytes << ',' << Cache->DebSize() << endl; c0out << "How odd.. The sizes didn't match, email apt@packages.debian.org" << endl; } - + + // Check for enough free space + struct statfs Buf; + string OutputDir = _config->FindDir("Dir::Cache::Archives"); + 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) + return _error->Error("Sorry, you don't have enough free space in %s", + OutputDir.c_str()); + // Number of bytes c1out << "Need to get "; if (DebBytes != FetchBytes) |