Subject: Re: Bug#760549: python-apt: apt_pkg.init_config() should apt_pkg.config.clean()

From: Julian Andres Klode <[email-masked]>
Date: Fri, 5 Sep 2014 10:31:13 +0200

On Fri, Sep 5, 2014 at 10:21 AM, Julian Andres Klode <[email-masked]> wrote:
> On Fri, Sep 05, 2014 at 09:56:26AM +0200, Raphaël Hertzog wrote:
>> Furthermore it would be nice if the configuration was loaded in a lazy
>> way in all the apt.* modules. That would probably solve #728274.
>
> It would not, AFAICT. The thing with #728274 is that is a use case that
> directly conflicts with another use case. One group of users like in the
> bug report want to specify configuration files in the chroot, and others
> are setting them outside the chroot (especially APT::Architecture for
> foreign chroots).

Sorry, yes it actually would solve it in case you only create a single
Cache(). Unfortunately, our configuration is a global thing, and thus
the entries from the different root directory would remain even after
the cache was closed; for example, when creating a new one.

It might make sense to provide the ability to switch apt_pkg.config
between different Configuration instances (setting _config on the C++
level), but I'm not sure if that would provide a consistent behaviour.

In short, global state sucks a lot, and there's not much we can do to fix it.
-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.