diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:53 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:53 +0000 |
commit | 01b64152bafe4df766345faa5b8f1fcc242aaee2 (patch) | |
tree | 5a600f5b7de790376780c1c6088ca2aebeb0a364 /cmdline | |
parent | 0f770a0ce8d5367cd1f026f651a9173ad065cf00 (diff) |
* Space check is supressed if --print-uris is given. Cl...
Author: jgg
Date: 2000-05-10 06:03:01 GMT
* Space check is supressed if --print-uris is given. Closes: #58965
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/apt-get.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 92efd1b1e..4558f7cf3 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.95 2000/01/14 06:26:37 jgg Exp $ +// $Id: apt-get.cc,v 1.96 2000/05/10 06:03:01 jgg Exp $ /* ###################################################################### apt-get - Cover for dpkg @@ -628,16 +628,20 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, if (_error->PendingError() == true) return false; - // Check for enough free space - struct statvfs Buf; - string OutputDir = _config->FindDir("Dir::Cache::Archives"); - if (statvfs(OutputDir.c_str(),&Buf) != 0) - return _error->Errno("statvfs","Couldn't determine free space in %s", - OutputDir.c_str()); - if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize) - return _error->Error("Sorry, you don't have enough free space in %s to hold all the .debs.", - OutputDir.c_str()); - + /* Check for enough free space, but only if we are actually going to + download */ + if (_config->FindB("APT::Get::Print-URIs") == false) + { + struct statvfs Buf; + string OutputDir = _config->FindDir("Dir::Cache::Archives"); + if (statvfs(OutputDir.c_str(),&Buf) != 0) + return _error->Errno("statvfs","Couldn't determine free space in %s", + OutputDir.c_str()); + if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize) + return _error->Error("Sorry, you don't have enough free space in %s to hold all the .debs.", + OutputDir.c_str()); + } + // Fail safe check if (_config->FindI("quiet",0) >= 2 || _config->FindB("APT::Get::Assume-Yes",false) == true) @@ -1739,7 +1743,7 @@ int main(int argc,const char *argv[]) // Deal with stdout not being a tty if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1) _config->Set("quiet","1"); - + // Setup the output streams c0out.rdbuf(cout.rdbuf()); c1out.rdbuf(cout.rdbuf()); |