summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-08-18 13:49:42 +0200
committerJulian Andres Klode <jak@debian.org>2009-08-18 13:49:42 +0200
commit3f286a1033479a7cfe40bc0e81c662eb3cd1d0f3 (patch)
tree47b2cf2dacc0a0a7b69e3b2e2851af1736475afc
parentf69208a3dc27357b19aad7879efca4300d56d8bb (diff)
downloadpython-apt-3f286a1033479a7cfe40bc0e81c662eb3cd1d0f3.tar.gz
python: Disable the functions in apt_inst if built without COMPAT_0_7.
Developers should use the class-based API instead.
-rw-r--r--python/apt_instmodule.cc19
-rw-r--r--python/apt_instmodule.h3
-rw-r--r--python/tar.cc4
3 files changed, 14 insertions, 12 deletions
diff --git a/python/apt_instmodule.cc b/python/apt_instmodule.cc
index 9cb166ed..2721509e 100644
--- a/python/apt_instmodule.cc
+++ b/python/apt_instmodule.cc
@@ -23,6 +23,8 @@
#include <Python.h>
/*}}}*/
+#ifdef COMPAT_0_7
+
// debExtractControl - Exctract an arbitary control member /*{{{*/
// ---------------------------------------------------------------------
/* This is a common operation so this function will stay, but others that
@@ -149,25 +151,20 @@ static PyObject *arCheckMember(PyObject *Self,PyObject *Args)
static PyMethodDef methods[] =
{
// access to ar files
- {"ar_check_member", arCheckMember, METH_VARARGS, doc_arCheckMember},
+ {"arCheckMember", arCheckMember, METH_VARARGS, doc_arCheckMember},
// access to deb files
- {"deb_extract_control",debExtractControl,METH_VARARGS,doc_debExtractControl},
- {"deb_extract_archive",debExtractArchive,METH_VARARGS,doc_debExtractArchive},
-
- // access to tar streams
- {"tar_extract",tarExtract,METH_VARARGS,doc_tarExtract},
- {"deb_extract",debExtract,METH_VARARGS,doc_debExtract},
-
-#ifdef COMPAT_0_7
- {"arCheckMember", arCheckMember, METH_VARARGS, doc_arCheckMember},
{"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},
-#endif
{}
};
+#else
+static PyMethodDef *methods = 0;
+#endif // defined(COMPAT_0_7)
static const char *apt_inst_doc =
diff --git a/python/apt_instmodule.h b/python/apt_instmodule.h
index 9f978e44..2b07261b 100644
--- a/python/apt_instmodule.h
+++ b/python/apt_instmodule.h
@@ -14,11 +14,12 @@
#include "generic.h"
#include <apt-pkg/extracttar.h>
+#ifdef COMPAT_0_7
PyObject *debExtract(PyObject *Self,PyObject *Args);
extern char *doc_debExtract;
PyObject *tarExtract(PyObject *Self,PyObject *Args);
extern char *doc_tarExtract;
-
+#endif
extern PyTypeObject PyArMember_Type;
extern PyTypeObject PyArArchive_Type;
diff --git a/python/tar.cc b/python/tar.cc
index b93ba31a..b994d4e7 100644
--- a/python/tar.cc
+++ b/python/tar.cc
@@ -4,10 +4,13 @@
/* ######################################################################
Tar Inteface
+ * THIS FILE IS COMPLETELY DEPRECATED, AND NOT USED ANYMORE IF BUILT *
+ * WITHOUT COMPATIBILITY. *
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#ifdef COMPAT_0_7
#include "generic.h"
#include <apt-pkg/extracttar.h>
@@ -189,3 +192,4 @@ PyObject *debExtract(PyObject *Self,PyObject *Args)
return HandleErrors(Py_None);
}
/*}}}*/
+#endif // defined(COMPAT_0_7)