summaryrefslogtreecommitdiff
path: root/python/configuration.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-01-29 09:41:28 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-01-29 09:41:28 +0100
commit6715b1ef7d4aad36a400b1d8629e6fe529c4232c (patch)
tree4d7c218da4b1b4ae78406c890e83ca0380cc8c00 /python/configuration.cc
parent40bf122a63ddbe0b99810c13c5676e871964de33 (diff)
parent5cbf0b5807b4cc67818eae652b59a25d52eb9f7b (diff)
downloadpython-apt-6715b1ef7d4aad36a400b1d8629e6fe529c4232c.tar.gz
* apt/cache.py:
- when setting a alternative rootdir, read the config from it as well (LP: #243550) * python/configuration.cc, python/apt_pkgmodule.cc: - add apt_pkg.ReadConfigDir()
Diffstat (limited to 'python/configuration.cc')
-rw-r--r--python/configuration.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/configuration.cc b/python/configuration.cc
index f52c3c97..21f70bc1 100644
--- a/python/configuration.cc
+++ b/python/configuration.cc
@@ -330,6 +330,24 @@ PyObject *LoadConfigISC(PyObject *Self,PyObject *Args)
Py_INCREF(Py_None);
return HandleErrors(Py_None);
}
+char *doc_LoadConfigDir = "LoadConfigDir(Configuration,DirName) -> None";
+PyObject *LoadConfigDir(PyObject *Self,PyObject *Args)
+{
+ char *Name = 0;
+ if (PyArg_ParseTuple(Args,"Os",&Self,&Name) == 0)
+ return 0;
+ if (Configuration_Check(Self)== 0)
+ {
+ PyErr_SetString(PyExc_TypeError,"argument 1: expected Configuration.");
+ return 0;
+ }
+
+ if (ReadConfigDir(GetSelf(Self),Name,false) == false)
+ return HandleErrors();
+
+ Py_INCREF(Py_None);
+ return HandleErrors(Py_None);
+}
/*}}}*/
// ParseCommandLine - Wrapper for the command line interface /*{{{*/