diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-09-14 13:22:19 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-09-14 13:22:19 +0200 |
commit | a0e07f3ec885c12c733c12805391646c202f3f31 (patch) | |
tree | faa658f29d7dff42c6ed475037dd462384eab46e /cmdline/apt-get.cc | |
parent | b11fe392b2245354591296df88c3be2e6218af12 (diff) | |
parent | afd7b358f94efddb83a2911ec1a21e7280074b1e (diff) |
merged from lp:~donkult/apt/experimental
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r-- | cmdline/apt-get.cc | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 4a05648fa..d8f207f0a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -25,8 +25,7 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE +#include <config.h> #include <apt-pkg/aptconfiguration.h> #include <apt-pkg/error.h> @@ -46,9 +45,6 @@ #include <apt-pkg/md5.h> #include <apt-pkg/versionmatch.h> -#include <config.h> -#include <apti18n.h> - #include "acqprogress.h" #include <set> @@ -68,8 +64,7 @@ #include <sys/wait.h> #include <sstream> -#define statfs statfs64 -#define statvfs statvfs64 +#include <apti18n.h> /*}}}*/ #define RAMFS_MAGIC 0x858458f6 @@ -1630,7 +1625,8 @@ bool DoUpdate(CommandLine &CmdL) if (_config->FindB("APT::Get::Download",true) == true) ListUpdate(Stat, *List); - // Rebuild the cache. + // Rebuild the cache. + pkgCacheFile::RemoveCaches(); if (Cache.BuildCaches() == false) return false; @@ -2210,10 +2206,14 @@ bool DoDSelectUpgrade(CommandLine &CmdL) /* */ bool DoClean(CommandLine &CmdL) { + std::string const archivedir = _config->FindDir("Dir::Cache::archives"); + std::string const pkgcache = _config->FindFile("Dir::cache::pkgcache"); + std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache"); + if (_config->FindB("APT::Get::Simulate") == true) { - cout << "Del " << _config->FindDir("Dir::Cache::archives") << "* " << - _config->FindDir("Dir::Cache::archives") << "partial/*" << endl; + cout << "Del " << archivedir << "* " << archivedir << "partial/*"<< endl + << "Del " << pkgcache << " " << srcpkgcache << endl; return true; } @@ -2221,14 +2221,17 @@ bool DoClean(CommandLine &CmdL) FileFd Lock; if (_config->FindB("Debug::NoLocking",false) == false) { - Lock.Fd(GetLock(_config->FindDir("Dir::Cache::Archives") + "lock")); + Lock.Fd(GetLock(archivedir + "lock")); if (_error->PendingError() == true) return _error->Error(_("Unable to lock the download directory")); } pkgAcquire Fetcher; - Fetcher.Clean(_config->FindDir("Dir::Cache::archives")); - Fetcher.Clean(_config->FindDir("Dir::Cache::archives") + "partial/"); + Fetcher.Clean(archivedir); + Fetcher.Clean(archivedir + "partial/"); + + pkgCacheFile::RemoveCaches(); + return true; } /*}}}*/ |