Delay variable definitions in _pkg_visibility_check until
authorZac Medico <zmedico@gentoo.org>
Fri, 6 Aug 2010 23:01:06 +0000 (16:01 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 6 Aug 2010 23:01:06 +0000 (16:01 -0700)
they are needed.

pym/_emerge/depgraph.py

index d765055ba097a677be79782c798dc3142de632e8..31f984d595f777c90de308b817938be1ed1c067a 100644 (file)
@@ -2554,8 +2554,7 @@ class depgraph(object):
                return pkg, existing
 
        def _pkg_visibility_check(self, pkg, allow_missing_keywords=False):
-               pkgsettings = self._frozen_config.pkgsettings[pkg.root]
-               root_config = self._frozen_config.roots[pkg.root]
+
                if pkg.visible:
                        return True
 
@@ -2566,6 +2565,9 @@ class depgraph(object):
 
                if not allow_missing_keywords:
                        return False
+
+               pkgsettings = self._frozen_config.pkgsettings[pkg.root]
+               root_config = self._frozen_config.roots[pkg.root]
                mreasons = _get_masking_status(pkg, pkgsettings, root_config)
                if len(mreasons) == 1 and \
                        mreasons[0].hint == 'unstable keyword':