summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-12-19 14:57:39 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-12-19 14:57:39 +0100
commitf00d26304c1febd47d5d9aefdcb9dd7e25f4058c (patch)
tree8c0487dcbdf4563aefe40afc2cc2b71e3a6e7e56 /cmdline/apt-get.cc
parentaff87a762f86ed47f2b81ccbac23faa5d9fddcdb (diff)
parent383594799377d5e628ee84557218f538d7b0bc0a (diff)
merged from bzr.debian.net
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc29
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)