summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/apt_instmodule.cc31
-rw-r--r--python/apt_pkgmodule.cc2
-rw-r--r--python/indexfile.cc2
3 files changed, 31 insertions, 4 deletions
diff --git a/python/apt_instmodule.cc b/python/apt_instmodule.cc
index d672a40a..43d5e7f7 100644
--- a/python/apt_instmodule.cc
+++ b/python/apt_instmodule.cc
@@ -102,15 +102,44 @@ static PyObject *debExtractArchive(PyObject *Self,PyObject *Args)
return HandleErrors(Py_BuildValue("b",res));
}
/*}}}*/
+// arFindMember - Find member in AR archive /*{{{*/
+// ---------------------------------------------------------------------
+static char *doc_arCheckMember =
+"arCheckMember(File, membername) -> Bool\n";
+static PyObject *arCheckMember(PyObject *Self,PyObject *Args)
+{
+ char *Member = NULL;
+ bool res = false;
+ PyObject *File;
+ if (PyArg_ParseTuple(Args,"O!s",&PyFile_Type,&File,&Member) == 0)
+ return 0;
+
+ // Open the file and associate the .deb
+ FileFd Fd(fileno(PyFile_AsFile(File)),false);
+ ARArchive AR(Fd);
+ if (_error->PendingError() == true)
+ return HandleErrors(Py_BuildValue("b",res));
+
+ if(AR.FindMember(Member) != 0)
+ res = true;
+
+ return HandleErrors(Py_BuildValue("b",res));
+}
+ /*}}}*/
// initapt_inst - Core Module Initialization /*{{{*/
// ---------------------------------------------------------------------
/* */
static PyMethodDef methods[] =
{
- // Stuff
+ // access to ar files
+ {"arCheckMember", arCheckMember, METH_VARARGS, doc_arCheckMember},
+
+ // access to deb files
{"debExtractControl",debExtractControl,METH_VARARGS,doc_debExtractControl},
{"debExtractArchive",debExtractArchive,METH_VARARGS,doc_debExtractArchive},
+
+ // access to tar streams
{"tarExtract",tarExtract,METH_VARARGS,doc_tarExtract},
{"debExtract",debExtract,METH_VARARGS,doc_debExtract},
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index a0352d4e..15f7d238 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -483,8 +483,6 @@ extern "C" void initapt_pkg()
// Version..
AddStr(Dict,"Version",pkgVersion);
AddStr(Dict,"LibVersion",pkgLibVersion);
- AddStr(Dict,"CPU",pkgCPU);
- AddStr(Dict,"OS",pkgOS);
AddStr(Dict,"Date",__DATE__);
AddStr(Dict,"Time",__TIME__);
diff --git a/python/indexfile.cc b/python/indexfile.cc
index ef6ffc8a..4e32f2ab 100644
--- a/python/indexfile.cc
+++ b/python/indexfile.cc
@@ -56,7 +56,7 @@ static PyObject *PackageIndexFileRepr(PyObject *Self)
{
pkgIndexFile *File = GetCpp<pkgIndexFile*>(Self);
- char S[300];
+ char S[1024];
snprintf(S,sizeof(S),"<pkIndexFile object: "
"Label:'%s' Describe='%s' Exists='%i' "
"HasPackages='%i' Size='%i' "