unmerge: use vardbapi._dblink() to simplify
authorZac Medico <zmedico@gentoo.org>
Wed, 9 Mar 2011 03:28:21 +0000 (19:28 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 14 Mar 2011 16:22:37 +0000 (09:22 -0700)
The dblink constructor is complex and best avoided.

pym/_emerge/unmerge.py

index a6a330cd338d4ef51282e38b35ee0a50f56ab086..68b61edc2d5a8038254755ba2f541c0a4336e311 100644 (file)
@@ -7,7 +7,6 @@ import logging
 import sys
 import textwrap
 import portage
-import portage.dbapi.vartree
 from portage import os
 from portage.output import bold, colorize, darkgreen, green
 from portage._sets import SETPREFIX
@@ -321,9 +320,7 @@ def unmerge(root_config, myopts, unmerge_action,
                                        msg = ("Not unmerging package %s since there is no valid reason "
                                                "for Portage to unmerge itself.") % (pkg.cpv,)
                                        skip_pkg = True
-                               elif portage.dbapi.vartree.dblink(pkg.category, pkg.pf,
-                                       settings=settings, treetype="vartree", vartree=vartree,
-                                       scheduler=scheduler).isowner(portage._python_interpreter):
+                               elif vartree.dbapi._dblink(cpv).isowner(portage._python_interpreter):
                                        msg = ("Not unmerging package %s since there is no valid reason "
                                                "for Portage to unmerge currently used Python interpreter.") % (pkg.cpv,)
                                        skip_pkg = True