diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2007-12-21 13:26:33 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2007-12-21 13:26:33 +0100 |
commit | 6ad4feb6e2c4dc7badfdfd57c0110d58567d7a7a (patch) | |
tree | 8c0487dcbdf4563aefe40afc2cc2b71e3a6e7e56 /cmdline/apt-get.cc | |
parent | 8076139ead08124e86be5f993baa8a43c22b0137 (diff) | |
parent | f00d26304c1febd47d5d9aefdcb9dd7e25f4058c (diff) |
merged with mvo branch
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r-- | cmdline/apt-get.cc | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index efb618cb0..53c657e8a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -53,6 +53,7 @@ #include <termios.h> #include <sys/ioctl.h> #include <sys/stat.h> +#include <sys/statfs.h> #include <sys/statvfs.h> #include <signal.h> #include <unistd.h> @@ -63,6 +64,8 @@ #include <sstream> /*}}}*/ +#define RAMFS_MAGIC 0x858458f6 + using namespace std; ostream c0out(0); @@ -835,16 +838,16 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, if (DebBytes != FetchBytes) ioprintf(c1out,_("Need to get %sB/%sB of archives.\n"), SizeToStr(FetchBytes).c_str(),SizeToStr(DebBytes).c_str()); - else + else if (DebBytes != 0) ioprintf(c1out,_("Need to get %sB of archives.\n"), SizeToStr(DebBytes).c_str()); // Size delta if (Cache->UsrSize() >= 0) - ioprintf(c1out,_("After unpacking %sB of additional disk space will be used.\n"), + ioprintf(c1out,_("After this operation, %sB of additional disk space will be used.\n"), SizeToStr(Cache->UsrSize()).c_str()); else - ioprintf(c1out,_("After unpacking %sB disk space will be freed.\n"), + ioprintf(c1out,_("After this operation, %sB disk space will be freed.\n"), SizeToStr(-1*Cache->UsrSize()).c_str()); if (_error->PendingError() == true) @@ -861,8 +864,13 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, 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(_("You don't have enough free space in %s."), - OutputDir.c_str()); + { + struct statfs Stat; + if (statfs(OutputDir.c_str(),&Stat) != 0 || + unsigned(Stat.f_type) != RAMFS_MAGIC) + return _error->Error(_("You don't have enough free space in %s."), + OutputDir.c_str()); + } } // Fail safe check @@ -1711,7 +1719,7 @@ bool DoInstall(CommandLine &CmdL) (Cache[Pkg].Flags & pkgCache::Flag::Auto) && _config->FindB("APT::Get::ReInstall",false) == false) { - ioprintf(c1out,_("%s set to manual installed.\n"), + ioprintf(c1out,_("%s set to manually installed.\n"), Pkg.Name()); Cache->MarkAuto(Pkg,false); AutoMarkChanged++; @@ -2188,8 +2196,13 @@ bool DoSource(CommandLine &CmdL) 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(_("You don't have enough free space in %s"), - OutputDir.c_str()); + { + struct statfs Stat; + if (statfs(OutputDir.c_str(),&Stat) != 0 || + unsigned(Stat.f_type) != RAMFS_MAGIC) + return _error->Error(_("You don't have enough free space in %s"), + OutputDir.c_str()); + } // Number of bytes if (DebBytes != FetchBytes) |