diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 16:32:52 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 16:32:52 +0100 |
commit | 71ecaad29d8066a494f516efc5efd80860653fe2 (patch) | |
tree | b0769df88e2b6496f23e3d899aeb1c240a3488d9 /methods/rred.cc | |
parent | a865ed25fa54514224cf4d6f83dd9cf48b7ed02b (diff) | |
parent | 37adedc9d0b66eeae7efb88aebd08dfbc6e06f77 (diff) |
merged from http://bzr.debian.org/bzr/apt/apt/debian-experimental2
Diffstat (limited to 'methods/rred.cc')
-rw-r--r-- | methods/rred.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/methods/rred.cc b/methods/rred.cc index 849973e1a..ef00fcaa3 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -1,10 +1,13 @@ // Includes /*{{{*/ +#include <config.h> + #include <apt-pkg/fileutl.h> #include <apt-pkg/mmap.h> #include <apt-pkg/error.h> #include <apt-pkg/acquire-method.h> #include <apt-pkg/strutl.h> #include <apt-pkg/hashes.h> +#include <apt-pkg/configuration.h> #include <sys/stat.h> #include <sys/uio.h> @@ -51,7 +54,7 @@ protected: virtual bool Fetch(FetchItem *Itm); public: - RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig) {}; + RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig), Debug(false) {}; }; /*}}}*/ /** \brief applyFile - in reverse order with a tail recursion {{{ @@ -239,7 +242,9 @@ RredMethod::State RredMethod::patchFile(FileFd &Patch, FileFd &From, /*{{{*/ return result; } /*}}}*/ -struct EdCommand { /*{{{*/ +/* struct EdCommand {{{*/ +#ifdef _POSIX_MAPPED_FILES +struct EdCommand { size_t data_start; size_t data_end; size_t data_lines; @@ -248,13 +253,14 @@ struct EdCommand { /*{{{*/ char type; }; #define IOV_COUNT 1024 /* Don't really want IOV_MAX since it can be arbitrarily large */ +#endif /*}}}*/ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/ FileFd &out_file, Hashes *hash) const { #ifdef _POSIX_MAPPED_FILES MMap ed_cmds(MMap::ReadOnly); if (Patch.gzFd() != NULL) { - unsigned long mapSize = Patch.Size(); + unsigned long long mapSize = Patch.Size(); DynamicMMap* dyn = new DynamicMMap(0, mapSize, 0); if (dyn->validData() == false) { delete dyn; @@ -467,7 +473,7 @@ bool RredMethod::Fetch(FetchItem *Itm) /*{{{*/ { Debug = _config->FindB("Debug::pkgAcquire::RRed", false); URI Get = Itm->Uri; - string Path = Get.Host + Get.Path; // To account for relative paths + std::string Path = Get.Host + Get.Path; // To account for relative paths FetchResult Res; Res.Filename = Itm->DestFile; @@ -520,7 +526,7 @@ bool RredMethod::Fetch(FetchItem *Itm) /*{{{*/ and use the access time from the "old" file */ struct stat BufBase, BufPatch; if (stat(Path.c_str(),&BufBase) != 0 || - stat(string(Path+".ed").c_str(),&BufPatch) != 0) + stat(std::string(Path+".ed").c_str(),&BufPatch) != 0) return _error->Errno("stat",_("Failed to stat")); struct utimbuf TimeBuf; |