Merge lp:~lool/xdeb/dont-load-apt-cache-on-import into lp:xdeb
Status: | Needs review |
---|---|
Proposed branch: | lp:~lool/xdeb/dont-load-apt-cache-on-import |
Merge into: | lp:xdeb |
Diff against target: |
90 lines (+20/-1) 2 files modified
aptutils.py (+16/-1) xdeb.py (+4/-0) |
To merge this branch: | bzr merge lp:~lool/xdeb/dont-load-apt-cache-on-import |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
xdeb-team | Pending | ||
Review via email: mp+79820@code.launchpad.net |
Description of the change
This speeds up importing aptutils.py and xdeb.py by deferring the cache = apt.Cache() in aptutils, which also speeds up running the testsutie; I've also added some progress messages for this step.
It's a bit ugly that xdeb.py functions have to call init_pkg_cache() (NB: the init_cache() name is used in another function in xdeb already), but I couldn't implement __get__()-style hooks here as "aptutils.cache" isn't in a class. We could either move to an aptutils.
Unmerged revisions
- 300. By Loïc Minier
-
Add progress message when rebuilding package cache.
- 299. By Loïc Minier
-
Defer building cache = apt.Cache() in aptutils as this is lengthy; call sites
need to init_pkg_cache() first.