diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-12 17:30:34 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-12 17:30:34 +0200 |
| commit | 64513033774fb0264c601f021da5d5f6345c3dd4 (patch) | |
| tree | 841ee98adcff18b45f243d863a29c01ddcbe67f2 | |
| parent | 60aba10689f5f3881a3427619be5bead3808d422 (diff) | |
| download | python-apt-64513033774fb0264c601f021da5d5f6345c3dd4.tar.gz | |
python/policy.cc: Disable Policy.read_pindir() on apt < 0.7.22.
| -rw-r--r-- | python/policy.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/policy.cc b/python/policy.cc index 46d73a1a..d086c4fc 100644 --- a/python/policy.cc +++ b/python/policy.cc @@ -96,6 +96,7 @@ static PyObject *Policy_ReadPinFile(PyObject *self, PyObject *arg) { return PyBool_FromLong(ReadPinFile(*policy, PyString_AsString(arg))); } +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 8) static char *Policy_ReadPinDir_doc = "read_pindir(dirname: str) -> bool\n\n" "Read the pin files in the given dir (e.g. '/etc/apt/preferences.d') and\n" "add them to the policy."; @@ -107,6 +108,7 @@ static PyObject *Policy_ReadPinDir(PyObject *self, PyObject *arg) { return PyBool_FromLong(ReadPinDir(*policy, PyString_AsString(arg))); } +#endif static char *Policy_CreatePin_doc = "create_pin(type: str, pkg: str, " "data: str, priority: int)\n\n" @@ -143,8 +145,10 @@ static PyMethodDef Policy_Methods[] = { Policy_GetCandidateVer_doc}, {"read_pinfile",(PyCFunction)Policy_ReadPinFile,METH_O, Policy_ReadPinFile_doc}, +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 8) {"read_pindir",(PyCFunction)Policy_ReadPinDir,METH_O, Policy_ReadPinFile_doc}, +#endif {"create_pin",Policy_CreatePin,METH_VARARGS,Policy_CreatePin_doc}, {"get_match",(PyCFunction)Policy_GetMatch,METH_O, Policy_GetMatch_doc}, {} |
