diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 17:20:58 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 17:20:58 +0100 |
| commit | 628d7caf9ca6ee819398a4b88c23e42094fe2c10 (patch) | |
| tree | 06d0c31214151eadd35a945dc6e063e2e52dd38d /python | |
| parent | 1948d5d03887eb81ea7797c0f23049ef6c3895ce (diff) | |
| download | python-apt-628d7caf9ca6ee819398a4b88c23e42094fe2c10.tar.gz | |
fix build against apt in experimental
Diffstat (limited to 'python')
| -rw-r--r-- | python/apt_pkgmodule.cc | 11 | ||||
| -rw-r--r-- | python/apt_pkgmodule.h | 1 | ||||
| -rw-r--r-- | python/arfile.cc | 8 | ||||
| -rw-r--r-- | python/cdrom.cc | 4 | ||||
| -rw-r--r-- | python/configuration.cc | 2 | ||||
| -rw-r--r-- | python/depcache.cc | 1 | ||||
| -rw-r--r-- | python/lock.cc | 2 | ||||
| -rw-r--r-- | python/metaindex.cc | 4 | ||||
| -rw-r--r-- | python/progress.cc | 14 | ||||
| -rw-r--r-- | python/progress.h | 6 | ||||
| -rw-r--r-- | python/tag.cc | 1 | ||||
| -rw-r--r-- | python/tarfile.cc | 2 |
12 files changed, 31 insertions, 25 deletions
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index 8532b1e3..acfdf019 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -26,6 +26,7 @@ #include <apt-pkg/pkgsystem.h> #include <apt-pkg/orderlist.h> #include <apt-pkg/aptconfiguration.h> +#include <apt-pkg/fileutl.h> #include <sys/stat.h> #include <libintl.h> @@ -185,11 +186,11 @@ static const char *parse_src_depends_doc = "only contains those dependencies for the architecture set in the\n" "configuration variable APT::Architecture"; static PyObject *RealParseDepends(PyObject *Self,PyObject *Args, - bool ParseArchFlags, string name, + bool ParseArchFlags, std::string name, bool debStyle=false) { - string Package; - string Version; + std::string Package; + std::string Version; unsigned int Op; bool StripMultiArch=true; @@ -408,8 +409,8 @@ static PyObject *GetArchitectures(PyObject *Self,PyObject *Args) return 0; PyObject *List = PyList_New(0); - vector<string> arches = APT::Configuration::getArchitectures(); - vector<string>::const_iterator I; + std::vector<std::string> arches = APT::Configuration::getArchitectures(); + std::vector<std::string>::const_iterator I; for (I = arches.begin(); I != arches.end(); I++) { PyList_Append(List, CppPyString(*I)); diff --git a/python/apt_pkgmodule.h b/python/apt_pkgmodule.h index b3534a30..85c34130 100644 --- a/python/apt_pkgmodule.h +++ b/python/apt_pkgmodule.h @@ -24,6 +24,7 @@ #include <apt-pkg/pkgsystem.h> #include <apt-pkg/cdrom.h> #include <apt-pkg/algorithms.h> +#include <apt-pkg/metaindex.h> #include "generic.h" // Configuration Stuff diff --git a/python/arfile.cc b/python/arfile.cc index c31ea35e..44cd3c82 100644 --- a/python/arfile.cc +++ b/python/arfile.cc @@ -204,7 +204,7 @@ static PyObject *_extract(FileFd &Fd, const ARArchive::Member *member, if (!Fd.Seek(member->Start)) return HandleErrors(); - string outfile_str = flCombine(dir,member->Name); + std::string outfile_str = flCombine(dir,member->Name); char *outfile = (char*)outfile_str.c_str(); // We are not using FileFd here, because we want to raise OSErrror with @@ -539,8 +539,8 @@ static PyObject *debfile_new(PyTypeObject *type, PyObject *args, PyObject *kwds) for (std::vector<std::string>::const_iterator t = types.begin(); t != types.end(); ++t) { - string member = string("data.tar.").append(*t); - string comp = _config->Find(string("Acquire::CompressionTypes::").append(*t)); + std::string member = std::string("data.tar.").append(*t); + std::string comp = _config->Find(std::string("Acquire::CompressionTypes::").append(*t)); self->data = _gettar(self, self->Object->FindMember(member.c_str()), comp.c_str()); if (self->data) @@ -548,7 +548,7 @@ static PyObject *debfile_new(PyTypeObject *type, PyObject *args, PyObject *kwds) } // no data found, we need to if (!self->data) { - string error; + std::string error; for (std::vector<std::string>::const_iterator t = types.begin(); t != types.end(); ++t) error.append(*t + ","); diff --git a/python/cdrom.cc b/python/cdrom.cc index 6ac16d59..46bb769c 100644 --- a/python/cdrom.cc +++ b/python/cdrom.cc @@ -67,7 +67,7 @@ static PyObject *cdrom_ident(PyObject *Self,PyObject *Args) PyCdromProgress progress; progress.setCallbackInst(pyCdromProgressInst); - string ident; + std::string ident; bool res = Cdrom.Ident(ident, &progress); if (res) @@ -94,7 +94,7 @@ static PyObject *cdrom_ident_old(PyObject *Self,PyObject *Args) PyCdromProgress progress; progress.setCallbackInst(pyCdromProgressInst); - string ident; + std::string ident; bool res = Cdrom.Ident(ident, &progress); PyObject *boolres = PyBool_FromLong(res); diff --git a/python/configuration.cc b/python/configuration.cc index 9000f71f..3e634901 100644 --- a/python/configuration.cc +++ b/python/configuration.cc @@ -262,7 +262,7 @@ static PyObject *CnfDump(PyObject *Self,PyObject *Args) if (PyArg_ParseTuple(Args,"") == 0) return 0; - stringstream ss; + std::stringstream ss; GetSelf(Self).Dump(ss); return CppPyString(ss.str()); } diff --git a/python/depcache.cc b/python/depcache.cc index e6113429..73993c82 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -22,6 +22,7 @@ #include <apt-pkg/sourcelist.h> #include <apt-pkg/pkgrecords.h> #include <apt-pkg/acquire-item.h> +#include <apt-pkg/fileutl.h> #include <Python.h> #include <iostream> diff --git a/python/lock.cc b/python/lock.cc index 2c957df1..38a2bc74 100644 --- a/python/lock.cc +++ b/python/lock.cc @@ -21,6 +21,8 @@ #include <Python.h> #include <apt-pkg/init.h> #include <apt-pkg/error.h> +#include <apt-pkg/fileutl.h> +#include <apt-pkg/pkgsystem.h> #include "generic.h" static PyObject *systemlock_exit(PyObject *self, PyObject *args) diff --git a/python/metaindex.cc b/python/metaindex.cc index a00cf04e..9e330d3d 100644 --- a/python/metaindex.cc +++ b/python/metaindex.cc @@ -33,8 +33,8 @@ static PyObject *MetaIndexGetIsTrusted(PyObject *Self,void*) { static PyObject *MetaIndexGetIndexFiles(PyObject *Self,void*) { metaIndex *meta = GetCpp<metaIndex*>(Self); PyObject *List = PyList_New(0); - vector<pkgIndexFile *> *indexFiles = meta->GetIndexFiles(); - for (vector<pkgIndexFile *>::const_iterator I = indexFiles->begin(); + std::vector<pkgIndexFile *> *indexFiles = meta->GetIndexFiles(); + for (std::vector<pkgIndexFile *>::const_iterator I = indexFiles->begin(); I != indexFiles->end(); I++) { CppPyObject<pkgIndexFile*> *Obj; diff --git a/python/progress.cc b/python/progress.cc index bd3c2ad6..a7fd7ae1 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -127,7 +127,7 @@ PyObject *PyFetchProgress::GetDesc(pkgAcquire::ItemDesc *item) { return pyDesc; } -bool PyFetchProgress::MediaChange(string Media, string Drive) +bool PyFetchProgress::MediaChange(std::string Media, std::string Drive) { PyCbObj_END_ALLOW_THREADS //std::cout << "MediaChange" << std::endl; @@ -485,7 +485,7 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm) PyObject *v = PyObject_GetAttrString(callbackInst, "writefd"); if(v) { int fd = PyObject_AsFileDescriptor(v); - cout << "got fd: " << fd << endl; + std::cout << "got fd: " << fd << std::endl; res = pm->DoInstall(fd); } else { res = pm->DoInstall(); @@ -542,7 +542,7 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm) //----------------------------------------------------------------------------- // apt-cdrom interface -void PyCdromProgress::Update(string text, int current) +void PyCdromProgress::Update(std::string text, int current) { PyObject *arglist = Py_BuildValue("(si)", text.c_str(), current); setattr(callbackInst, "total_steps", "i", totalSteps); @@ -569,7 +569,7 @@ bool PyCdromProgress::ChangeCdrom() } -bool PyCdromProgress::AskCdromName(string &Name) +bool PyCdromProgress::AskCdromName(std::string &Name) { PyObject *arglist = Py_BuildValue("()"); const char *new_name; @@ -582,7 +582,7 @@ bool PyCdromProgress::AskCdromName(string &Name) if(!PyArg_Parse(result, "(bs)", &res, &new_name)) std::cerr << "AskCdromName: result could not be parsed" << std::endl; // set the new name - Name = string(new_name); + Name =std:: string(new_name); return res; } // New style: String on success, None on failure. @@ -593,7 +593,7 @@ bool PyCdromProgress::AskCdromName(string &Name) if(!PyArg_Parse(result, "s", &new_name)) std::cerr << "ask_cdrom_name: result could not be parsed" << std::endl; else - Name = string(new_name); - return true; + Name = std::string(new_name); + return true; } } diff --git a/python/progress.h b/python/progress.h index 4e66c771..af8e3acc 100644 --- a/python/progress.h +++ b/python/progress.h @@ -72,7 +72,7 @@ struct PyFetchProgress : public pkgAcquireStatus, public PyCallbackObj void UpdateStatus(pkgAcquire::ItemDesc & Itm, int status); - virtual bool MediaChange(string Media, string Drive); + virtual bool MediaChange(std::string Media, std::string Drive); void setPyAcquire(PyObject *o) { Py_CLEAR(pyAcquire); @@ -107,11 +107,11 @@ struct PyInstallProgress : public PyCallbackObj struct PyCdromProgress : public pkgCdromStatus, public PyCallbackObj { // update steps, will be called regularly as a "pulse" - virtual void Update(string text="", int current=0); + virtual void Update(std::string text="", int current=0); // ask for cdrom insert virtual bool ChangeCdrom(); // ask for cdrom name - virtual bool AskCdromName(string &Name); + virtual bool AskCdromName(std::string &Name); PyCdromProgress() : PyCallbackObj() {}; }; diff --git a/python/tag.cc b/python/tag.cc index 94554400..3996af8e 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -26,6 +26,7 @@ #include "apt_pkgmodule.h" #include <apt-pkg/tagfile.h> +#include <apt-pkg/fileutl.h> #include <stdio.h> #include <iostream> diff --git a/python/tarfile.cc b/python/tarfile.cc index cdfe0a7c..bd903b57 100644 --- a/python/tarfile.cc +++ b/python/tarfile.cc @@ -348,7 +348,7 @@ static const char *tarfile_extractall_doc = "can be used to change the target directory."; static PyObject *tarfile_extractall(PyObject *self, PyObject *args) { - string cwd = SafeGetCWD(); + std::string cwd = SafeGetCWD(); char *rootdir = 0; if (PyArg_ParseTuple(args,"|s:extractall",&rootdir) == 0) return 0; |
