summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2008-01-03 13:48:03 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2008-01-03 13:48:03 +0100
commitbc87e700890863acd48fd61a5bc8dcc2386afd20 (patch)
tree1296f72efbd86945ce960a8e6e7d260b23e839e3 /cmdline
parente0fe131836913901c8b353e38d74cc1526fcaf78 (diff)
parent3a6d37fdcfbdb152eb00371ff69b8871c9a02527 (diff)
merge from apt--mvo
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc29
-rwxr-xr-xcmdline/apt-key4
2 files changed, 23 insertions, 10 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index b619a45c5..e9902ec89 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++;
@@ -2215,8 +2223,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/cmdline/apt-key b/cmdline/apt-key
index 15cc4427c..d9739461c 100755
--- a/cmdline/apt-key
+++ b/cmdline/apt-key
@@ -5,7 +5,7 @@ set -e
# We don't use a secret keyring, of course, but gpg panics and
# implodes if there isn't one available
-GPG_CMD="gpg --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg"
+GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg"
GPG="$GPG_CMD --keyring /etc/apt/trusted.gpg"
@@ -21,7 +21,7 @@ update() {
fi
# add new keys
- $GPG_CMD --quiet --batch --keyring $ARCHIVE_KEYRING --export | $GPG --ignore-time-conflict --import
+ $GPG_CMD --quiet --batch --keyring $ARCHIVE_KEYRING --export | $GPG --import
# remove no-longer used keys
keys=`$GPG_CMD --keyring $REMOVED_KEYS --with-colons --list-keys | grep ^pub | cut -d: -f5`