From 885d204bd354739187413005874797504f3b95f3 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sun, 16 Dec 2007 18:22:24 -0200 Subject: * Applied patch from Amos Waterland to allow apt to work properly in initramfs, closes: #448316. --- cmdline/apt-get.cc | 21 +++++++++++++++++---- debian/changelog | 4 +++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index efb618cb0..3bcacb293 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -63,6 +64,8 @@ #include /*}}}*/ +#define RAMFS_MAGIC 0x858458f6 + using namespace std; ostream c0out(0); @@ -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 @@ -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) diff --git a/debian/changelog b/debian/changelog index 2d267a66b..aa324144e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ apt (0.7.10) UNRELEASED; urgency=low closes: #452862. * Applied patch from Alexander Winston to use 'min' as symbol for minute, closes: #219034. + * Applied patch from Amos Waterland to allow apt to + work properly in initramfs, closes: #448316. [ Program translations ] - Basque updated. Closes: #453088 @@ -39,7 +41,7 @@ apt (0.7.10) UNRELEASED; urgency=low * ftparchive/multicompress.cc: - support lzma output - -- Otavio Salvador Sat, 08 Dec 2007 12:13:58 -0200 + -- Otavio Salvador Sun, 16 Dec 2007 18:21:14 -0200 apt (0.7.9) unstable; urgency=low -- cgit v1.2.3