diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/acquire.cc | 4 | ||||
| -rw-r--r-- | python/cache.cc | 9 | ||||
| -rw-r--r-- | python/depcache.cc | 3 | ||||
| -rw-r--r-- | python/indexfile.cc | 2 | ||||
| -rw-r--r-- | python/pkgsrcrecords.cc | 1 | ||||
| -rw-r--r-- | python/progress.cc | 2 | ||||
| -rw-r--r-- | python/tar.cc | 4 |
7 files changed, 11 insertions, 14 deletions
diff --git a/python/acquire.cc b/python/acquire.cc index e13e47d6..a36012bc 100644 --- a/python/acquire.cc +++ b/python/acquire.cc @@ -93,8 +93,8 @@ static PyObject *AcquireItemRepr(PyObject *Self) char S[300]; snprintf(S,sizeof(S),"<%s object: " "Status: %i Complete: %i Local: %i IsTrusted: %i " - "FileSize: %i DestFile:'%s' " - "DescURI: '%s' ID:%i ErrorText: '%s'>", + "FileSize: %lu DestFile:'%s' " + "DescURI: '%s' ID:%lu ErrorText: '%s'>", Self->ob_type->tp_name, Itm->Status, Itm->Complete, Itm->Local, Itm->IsTrusted(), Itm->FileSize, Itm->DestFile.c_str(), Itm->DescURI().c_str(), diff --git a/python/cache.cc b/python/cache.cc index 2de9c76a..0f5e27eb 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -76,9 +76,6 @@ static PyObject *CreateProvides(PyObject *Owner,pkgCache::PrvIterator I) // --------------------------------------------------------------------- static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args) { - PyObject *CacheFilePy = GetOwner<pkgCache*>(Self); - pkgCacheFile *Cache = GetCpp<pkgCacheFile*>(CacheFilePy); - PyObject *pyFetchProgressInst = 0; PyObject *pySourcesList = 0; if (PyArg_ParseTuple(Args, "OO", &pyFetchProgressInst,&pySourcesList) == 0) @@ -93,6 +90,7 @@ static PyObject *PkgCacheUpdate(PyObject *Self,PyObject *Args) return HandleErrors(PyRes); } +#ifdef COMPAT_0_7 static PyObject *PkgCacheClose(PyObject *Self,PyObject *Args) { PyErr_WarnEx(PyExc_DeprecationWarning, "Cache.Close() is deprecated, " @@ -137,7 +135,7 @@ static PyObject *PkgCacheOpen(PyObject *Self,PyObject *Args) Py_INCREF(Py_None); return HandleErrors(Py_None); } - +#endif static PyMethodDef PkgCacheMethods[] = { @@ -456,10 +454,10 @@ PyTypeObject PkgListType = CppOwnedClear<PkgListStruct>, // tp_clear }; +#define Owner (GetOwner<pkgCache::PkgIterator>(Self)) #define MkGet(PyFunc,Ret) static PyObject *PyFunc(PyObject *Self,void*) \ { \ pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(Self); \ - PyObject *Owner = GetOwner<pkgCache::PkgIterator>(Self); \ return Ret; \ } @@ -477,6 +475,7 @@ MkGet(PackageGetAuto,Py_BuildValue("i",(Pkg->Flags & pkgCache::Flag::Auto) != 0) MkGet(PackageGetEssential,Py_BuildValue("i",(Pkg->Flags & pkgCache::Flag::Essential) != 0)); MkGet(PackageGetImportant,Py_BuildValue("i",(Pkg->Flags & pkgCache::Flag::Important) != 0)); #undef MkGet +#undef Owner static PyObject *PackageGetVersionList(PyObject *Self,void*) { diff --git a/python/depcache.cc b/python/depcache.cc index e1514300..9c0c9a6f 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -62,8 +62,6 @@ static PyObject *PkgDepCacheInit(PyObject *Self,PyObject *Args) static PyObject *PkgDepCacheCommit(PyObject *Self,PyObject *Args) { - PyObject *result; - pkgDepCache *depcache = GetCpp<pkgDepCache *>(Self); PyObject *pyInstallProgressInst = 0; @@ -196,7 +194,6 @@ static PyObject *PkgDepCacheSetCandidateVer(PyObject *Self,PyObject *Args) &VersionType, &VersionObj) == 0) return 0; - pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(PackageObj); pkgCache::VerIterator &I = GetCpp<pkgCache::VerIterator>(VersionObj); if(I.end()) { return HandleErrors(Py_BuildValue("b",false)); diff --git a/python/indexfile.cc b/python/indexfile.cc index ef88c2f0..73f76ce6 100644 --- a/python/indexfile.cc +++ b/python/indexfile.cc @@ -62,7 +62,7 @@ static PyObject *PackageIndexFileRepr(PyObject *Self) char S[1024]; snprintf(S,sizeof(S),"<pkIndexFile object: " "Label:'%s' Describe='%s' Exists='%i' " - "HasPackages='%i' Size='%i' " + "HasPackages='%i' Size='%lu' " "IsTrusted='%i' ArchiveURI='%s'>", File->GetType()->Label, File->Describe().c_str(), File->Exists(), File->HasPackages(), File->Size(), diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc index f75934f9..9707dce2 100644 --- a/python/pkgsrcrecords.cc +++ b/python/pkgsrcrecords.cc @@ -58,7 +58,6 @@ static PyObject *PkgSrcRecordsRestart(PyObject *Self,PyObject *Args) { PkgSrcRecordsStruct &Struct = GetCpp<PkgSrcRecordsStruct>(Self); - char *Name = 0; if (PyArg_ParseTuple(Args,"") == 0) return 0; diff --git a/python/progress.cc b/python/progress.cc index c5035e62..44f27b0c 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -354,7 +354,6 @@ void PyInstallProgress::FinishUpdate() pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm) { - void *dummy; pkgPackageManager::OrderResult res; int ret; pid_t child_id; @@ -426,7 +425,6 @@ pkgPackageManager::OrderResult PyInstallProgress::Run(pkgPackageManager *pm) PyErr_Print(); return pkgPackageManager::Failed; } - int child_res; if(!PyArg_Parse(result, "i", &res) ) { std::cerr << "custom waitChild() result could not be parsed?"<< std::endl; return pkgPackageManager::Failed; diff --git a/python/tar.cc b/python/tar.cc index 217554c2..b93ba31a 100644 --- a/python/tar.cc +++ b/python/tar.cc @@ -72,8 +72,12 @@ bool ProcessTar::DoItem(Item &Itm,int &Fd) case Item::FIFO: Type = "FIFO"; break; + + default: + return false; } + if (PyObject_CallFunction(Function,"sssiiiiiii",Type,Itm.Name, Itm.LinkTarget,Itm.Mode,Itm.UID,Itm.GID,Itm.Size, Itm.MTime,Itm.Major,Itm.Minor) == 0) |
