diff options
| -rw-r--r-- | apt/__init__.py | 6 | ||||
| -rw-r--r-- | aptsources/__init__.py | 7 | ||||
| -rw-r--r-- | debian/changelog | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/apt/__init__.py b/apt/__init__.py index 4ded8e29..7b04befb 100644 --- a/apt/__init__.py +++ b/apt/__init__.py @@ -25,7 +25,9 @@ from apt.package import Package from apt.cache import Cache, ProblemResolver from apt.cdrom import Cdrom -# init the package system -apt_pkg.init() +# init the package system, but do not re-initialize config +if "APT" not in apt_pkg.config: + apt_pkg.init_config() +apt_pkg.init_system() __all__ = ['Cache', 'Cdrom', 'Package'] diff --git a/aptsources/__init__.py b/aptsources/__init__.py index c02341c2..0929e12b 100644 --- a/aptsources/__init__.py +++ b/aptsources/__init__.py @@ -1,4 +1,7 @@ import apt_pkg -# init the package system -apt_pkg.init() + +# init the package system, but do not re-initialize config +if "APT" not in apt_pkg.config: + apt_pkg.init_config() +apt_pkg.init_system() diff --git a/debian/changelog b/debian/changelog index 77c64d82..81e30b64 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,8 @@ python-apt (0.9.0) UNRELEASED; urgency=low - Add a Package.has_config_files property (Closes: #712749) * tests: - Do not set dir::etc::sourceparts to /tmp + * apt, aptsources: + - Only call init_config() if not already initialized (Closes: #686403) [ Jeremy Bicha ] * data/templates/Ubuntu.info.in: add 'devel' series (Closes: #722961) |
