On Wed, Oct 30, 2013 at 8:20 AM, Thomas Bechtold
<thomasbecht...@jpberlin.de> wrote:
> I tried to use python-apt to get all available package versions. I used
> the 'rootdir' parameter for apt.Cache to have a seperate root dir and
> seperated config files.
> In my /etc/apt/apt.conf , I have the following line:
>
> APT::Default-Release "sid";
>
> In my root-dir, I create an empty 'rootdir/etc/apt/apt.conf' and when I
> try to init the apt.Cache, I get the following error:
[…]


Not a python coder here, but as similar symptoms creep up in other code as
well: "apt_pkg.init" will read configuration files, so whatever you are
doing later on is too late.

A quick look at the documentation of "apt.Cache" says that the rootdir=
parameter effects sources.list and lists/, but nothing about configuration.

I will leave the bug open, so the python-gurus can decide if and what is
to do. They might even be able tell you what the equivalent of:
_config->Set("Dir", "/my/empty/rootdir");
pkgInitConfig(*_config);
is (or usage of a file specified in APT_CONFIG environment variable).

(There is also a 'Rootdir' setting, it depends a bit on what you will do
 later on which one you have to use – but for most stuff both will work.
 Rootdir prefixes everything, Dir just relative paths. If you configure
 files to be 'read' from "/dev/null" for example, that is a difference)


Best regards

David Kalnischkies


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to