summaryrefslogtreecommitdiff
path: root/python/apt_instmodule.cc
diff options
context:
space:
mode:
Diffstat (limited to 'python/apt_instmodule.cc')
-rw-r--r--python/apt_instmodule.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/python/apt_instmodule.cc b/python/apt_instmodule.cc
index 43d5e7f7..95483ee0 100644
--- a/python/apt_instmodule.cc
+++ b/python/apt_instmodule.cc
@@ -5,10 +5,10 @@
apt_intmodule - Top level for the python module. Create the internal
structures for the module in the interpriter.
-
+
Note, this module shares state (particularly global config) with the
apt_pkg module.
-
+
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
@@ -17,7 +17,7 @@
#include <apt-pkg/debfile.h>
#include <apt-pkg/error.h>
-
+
#include <sys/stat.h>
#include <unistd.h>
#include <Python.h>
@@ -37,7 +37,7 @@ static PyObject *debExtractControl(PyObject *Self,PyObject *Args)
PyObject *File;
if (PyArg_ParseTuple(Args,"O!|s",&PyFile_Type,&File,&Member) == 0)
return 0;
-
+
// Subscope makes sure any clean up errors are properly handled.
PyObject *Res = 0;
{
@@ -46,13 +46,13 @@ static PyObject *debExtractControl(PyObject *Self,PyObject *Args)
debDebFile Deb(Fd);
if (_error->PendingError() == true)
return HandleErrors();
-
+
debDebFile::MemControlExtract Extract(Member);
if (Extract.Read(Deb) == false)
return HandleErrors();
-
+
// Build the return result
-
+
if (Extract.Control == 0)
{
Py_INCREF(Py_None);
@@ -61,7 +61,7 @@ static PyObject *debExtractControl(PyObject *Self,PyObject *Args)
else
Res = PyString_FromStringAndSize(Extract.Control,Extract.Length+2);
}
-
+
return HandleErrors(Res);
}
/*}}}*/
@@ -77,11 +77,11 @@ static PyObject *debExtractArchive(PyObject *Self,PyObject *Args)
PyObject *File;
if (PyArg_ParseTuple(Args,"O!|s",&PyFile_Type,&File,&Rootdir) == 0)
return 0;
-
+
// Subscope makes sure any clean up errors are properly handled.
bool res = false;
{
- if(Rootdir != NULL)
+ if(Rootdir != NULL)
{
chdir(Rootdir);
}
@@ -98,7 +98,7 @@ static PyObject *debExtractArchive(PyObject *Self,PyObject *Args)
if (res == false)
return HandleErrors();
- }
+ }
return HandleErrors(Py_BuildValue("b",res));
}
/*}}}*/
@@ -113,13 +113,13 @@ static PyObject *arCheckMember(PyObject *Self,PyObject *Args)
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;