emerge_main: call portdbapi destructors v2.2.0_alpha179
authorZac Medico <zmedico@gentoo.org>
Sun, 9 Jun 2013 01:17:34 +0000 (18:17 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 9 Jun 2013 01:17:34 +0000 (18:17 -0700)
pym/_emerge/main.py

index 4b9af7ca8ca49dcee85c2c04d32181db031f2c1f..689d1364fc1137e5e07f8e0d1cdb3b9239f5141b 100644 (file)
@@ -1055,4 +1055,11 @@ def emerge_main(args=None):
        emerge_config.action, emerge_config.opts, emerge_config.args = \
                parse_opts(tmpcmdline)
 
-       return run_action(emerge_config)
+       try:
+               return run_action(emerge_config)
+       finally:
+               # Call destructors for our portdbapi instances.
+               for x in emerge_config.trees.values():
+                       if "porttree" in x.lazy_items:
+                               continue
+                       x["porttree"].dbapi.close_caches()