if settings.get("PORTAGE_DEBUG", "") == "1":
self.edebug = 1
self.spinner = spinner
- if "/" in trees:
- self._running_root = trees["/"]["root_config"]
- else:
+ if "_test_" in myopts and "/" not in trees:
self._running_root = trees[self.target_root]["root_config"]
+ else:
+ self._running_root = trees["/"]["root_config"]
self._opts_no_restart = frozenset(["--buildpkgonly",
"--fetchonly", "--fetch-all-uri", "--pretend"])
self.pkgsettings = {}
myopts["--root"] = self.root
myopts["--config-root"] = self.root
myopts["--root-deps"] = "rdeps"
+ # Add a fake _test_ option that can be used for
+ # conditional test code.
+ myopts["_test_"] = True
portage.util.noiselimit = -2
myparams = create_depgraph_params(myopts, myaction)