Fix fragile sets config file path handling for for ResolverPlayground
authorZac Medico <zmedico@gentoo.org>
Wed, 25 Aug 2010 08:22:31 +0000 (01:22 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 25 Aug 2010 08:22:31 +0000 (01:22 -0700)
and remove unecessary setconfig_fallback() usage.

pym/portage/tests/resolver/ResolverPlayground.py

index 6d00270b1ddc327e6c9d8c22e35a862f6932bcad..952a5f265d30ad644266063731f16c2829657d91 100644 (file)
@@ -6,6 +6,7 @@ import shutil
 import tempfile
 import portage
 from portage import os
+from portage.const import PORTAGE_BASE_PATH
 from portage.dbapi.vartree import vartree
 from portage.dbapi.porttree import portagetree
 from portage.dbapi.bintree import binarytree
@@ -18,7 +19,6 @@ from _emerge.Blocker import Blocker
 from _emerge.create_depgraph_params import create_depgraph_params
 from _emerge.depgraph import backtrack_depgraph
 from _emerge.RootConfig import RootConfig
-from _emerge.main import setconfig_fallback
 
 class ResolverPlayground(object):
        """
@@ -236,7 +236,8 @@ class ResolverPlayground(object):
                except os.error:
                        pass
 
-               provided_sets_portage_conf = os.path.realpath("../../../cnf/sets/portage.conf")
+               provided_sets_portage_conf = \
+                       os.path.join(PORTAGE_BASE_PATH, "cnf/sets/portage.conf")
                os.symlink(provided_sets_portage_conf, os.path.join(default_sets_conf_dir, "portage.conf"))
 
                set_config_dir = os.path.join(user_config_dir, "sets")
@@ -297,7 +298,6 @@ class ResolverPlayground(object):
                        settings._init_dirs()
                        setconfig = load_default_config(settings, root_trees)
                        root_trees["root_config"] = RootConfig(settings, root_trees, setconfig)
-                       setconfig_fallback(root_trees["root_config"])
                
                return settings, trees