#include <apt-pkg/strutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/configuration.h>
+#include "aptmethod.h"
#include <stddef.h>
#include <iostream>
char *free;
MemBlock *next;
- MemBlock(size_t size) : size(size), next(NULL)
+ explicit MemBlock(size_t size) : size(size), next(NULL)
{
free = start = new char[size];
}
size_t add_len; /* bytes */
char *add;
- Change(size_t off)
+ explicit Change(size_t off)
{
offset = off;
del_cnt = add_cnt = add_len = 0;
}
};
-class RredMethod : public pkgAcqMethod {
+class RredMethod : public aptMethod {
private:
bool Debug;
if (p.Open(patch_name, FileFd::ReadOnly, FileFd::Gzip) == false ||
patch.read_diff(p, &patch_hash) == false)
{
- _error->DumpErrors(std::cerr);
+ _error->DumpErrors(std::cerr, GlobalError::DEBUG, false);
return false;
}
p.Close();
return true;
}
- bool Configuration(std::string Message) APT_OVERRIDE
- {
- if (pkgAcqMethod::Configuration(Message) == false)
- return false;
-
- DropPrivsOrDie();
-
- return true;
- }
-
public:
- RredMethod() : pkgAcqMethod("2.0",SingleInstance | SendConfig), Debug(false) {}
+ RredMethod() : aptMethod("rred", "2.0",SingleInstance | SendConfig), Debug(false) {}
};
int main(int argc, char **argv)