diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-01-29 09:41:28 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-01-29 09:41:28 +0100 |
| commit | 6715b1ef7d4aad36a400b1d8629e6fe529c4232c (patch) | |
| tree | 4d7c218da4b1b4ae78406c890e83ca0380cc8c00 | |
| parent | 40bf122a63ddbe0b99810c13c5676e871964de33 (diff) | |
| parent | 5cbf0b5807b4cc67818eae652b59a25d52eb9f7b (diff) | |
| download | python-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()
| -rw-r--r-- | apt/cache.py | 3 | ||||
| -rw-r--r-- | debian/changelog | 10 | ||||
| -rw-r--r-- | po/python-apt.pot | 19 | ||||
| -rw-r--r-- | python/apt_pkgmodule.cc | 1 | ||||
| -rw-r--r-- | python/apt_pkgmodule.h | 2 | ||||
| -rw-r--r-- | python/configuration.cc | 18 |
6 files changed, 41 insertions, 12 deletions
diff --git a/apt/cache.py b/apt/cache.py index 0065d14c..b74f8ef1 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -52,6 +52,9 @@ class Cache(object): # force apt to build its caches in memory apt_pkg.Config.Set("Dir::Cache::pkgcache", "") if rootdir: + print "reading apt.conf" + apt_pkg.ReadConfigFile(apt_pkg.Config, rootdir+"/etc/apt/apt.conf") + apt_pkg.ReadConfigDir(apt_pkg.Config, rootdir+"/etc/apt/apt.conf.d") apt_pkg.Config.Set("Dir", rootdir) apt_pkg.Config.Set("Dir::State::status", rootdir + "/var/lib/dpkg/status") diff --git a/debian/changelog b/debian/changelog index 025d3fb7..f60ab667 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +python-apt (0.7.9~exp2ubuntu6) jaunty; urgency=low + + * 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() + + -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 29 Jan 2009 09:30:52 +0100 + python-apt (0.7.9~exp2ubuntu5) jaunty; urgency=low * apt/cache.py: diff --git a/po/python-apt.pot b/po/python-apt.pot index 6af898db..9bcda683 100644 --- a/po/python-apt.pot +++ b/po/python-apt.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-01-09 18:08+0100\n" +"POT-Creation-Date: 2009-01-29 09:24+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -82,11 +82,6 @@ msgstr "" msgid "Community-maintained" msgstr "" -#. CompDescriptionLong -#: ../data/templates/Ubuntu.info.in:305 -msgid "Proprietary drivers for devices" -msgstr "" - #. CompDescription #: ../data/templates/Ubuntu.info.in:307 msgid "Restricted software" @@ -124,7 +119,7 @@ msgstr "" #. CompDescriptionLong #: ../data/templates/Ubuntu.info.in:357 -msgid "Proprietary drivers for devices " +msgid "Proprietary drivers for devices" msgstr "" #. CompDescription @@ -275,7 +270,7 @@ msgstr "" #. Description #: ../data/templates/Debian.info.in:33 -msgid "Debian 4.0 'Etch' " +msgid "Debian 4.0 'Etch'" msgstr "" #. Description @@ -319,7 +314,7 @@ msgid "Non-DFSG-compatible Software" msgstr "" #. TRANSLATORS: %s is a country -#: ../aptsources/distro.py:194 ../aptsources/distro.py:401 +#: ../aptsources/distro.py:207 ../aptsources/distro.py:422 #, python-format msgid "Server for %s" msgstr "" @@ -327,12 +322,12 @@ msgstr "" #. More than one server is used. Since we don't handle this case #. in the user interface we set "custom servers" to true and #. append a list of all used servers -#: ../aptsources/distro.py:213 ../aptsources/distro.py:218 -#: ../aptsources/distro.py:232 +#: ../aptsources/distro.py:225 ../aptsources/distro.py:231 +#: ../aptsources/distro.py:247 msgid "Main server" msgstr "" -#: ../aptsources/distro.py:235 +#: ../aptsources/distro.py:251 msgid "Custom servers" msgstr "" diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index 2e488d58..86732781 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -402,6 +402,7 @@ static PyMethodDef methods[] = // Command line {"ReadConfigFile",LoadConfig,METH_VARARGS,doc_LoadConfig}, + {"ReadConfigDir",LoadConfigDir,METH_VARARGS,doc_LoadConfigDir}, {"ReadConfigFileISC",LoadConfigISC,METH_VARARGS,doc_LoadConfig}, {"ParseCommandLine",ParseCommandLine,METH_VARARGS,doc_ParseCommandLine}, diff --git a/python/apt_pkgmodule.h b/python/apt_pkgmodule.h index 38486182..e047bcd8 100644 --- a/python/apt_pkgmodule.h +++ b/python/apt_pkgmodule.h @@ -23,9 +23,11 @@ extern PyTypeObject VersionType; extern char *doc_LoadConfig; extern char *doc_LoadConfigISC; +extern char *doc_LoadConfigDir; extern char *doc_ParseCommandLine; PyObject *LoadConfig(PyObject *Self,PyObject *Args); PyObject *LoadConfigISC(PyObject *Self,PyObject *Args); +PyObject *LoadConfigDir(PyObject *Self,PyObject *Args); PyObject *ParseCommandLine(PyObject *Self,PyObject *Args); // Tag File Stuff 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 /*{{{*/ |
