示例#1
0
    def _load_config(self):

        create_trees_kwargs = {}
        if self.target_root != os.sep:
            create_trees_kwargs["target_root"] = self.target_root

        env = {
            "PORTAGE_REPOSITORIES":
            "\n".join("[%s]\n%s" % (
                repo_name,
                "\n".join("%s = %s" % (k, v) for k, v in repo_config.items()),
            ) for repo_name, repo_config in self._repositories.items())
        }

        if self.debug:
            env["PORTAGE_DEBUG"] = "1"

        trees = portage.create_trees(env=env,
                                     eprefix=self.eprefix,
                                     **create_trees_kwargs)

        for root, root_trees in trees.items():
            settings = root_trees["vartree"].settings
            settings._init_dirs()
            setconfig = load_default_config(settings, root_trees)
            root_trees["root_config"] = RootConfig(settings, root_trees,
                                                   setconfig)

        return trees[trees._target_eroot]["vartree"].settings, trees
示例#2
0
    def __init__(self, **kwargs):
        """Class init

        @param qatracker: QATracker instance
        @param portdb: portdb instance
        @param repo_settings: repository settings instance
        @param vcs_settings: VCSSettings instance
        @param checks: checks dictionary
        """
        super(Ebuild, self).__init__(**kwargs)
        self.qatracker = kwargs.get("qatracker")
        self.portdb = kwargs.get("portdb")
        self.repo_settings = kwargs.get("repo_settings")
        self.vcs_settings = kwargs.get("vcs_settings")
        self.checks = kwargs.get("checks")
        self.root_config = RootConfig(
            self.repo_settings.repoman_settings,
            self.repo_settings.trees[self.repo_settings.root],
            None,
        )
        self.changed = None
        self.xpkg = None
        self.y_ebuild = None
        self.pkg = None
        self.metadata = None
        self.eapi = None
        self.inherited = None
        self.live_ebuild = None
        self.keywords = None
        self.pkgs = {}
示例#3
0
 def __init__(self, repoman_settings, repo_settings, portdb, qatracker):
     ''''''
     self.portdb = portdb
     self.qatracker = qatracker
     self.root_config = RootConfig(repoman_settings,
                                   repo_settings.trees[repo_settings.root],
                                   None)
	def _load_config(self):

		create_trees_kwargs = {}
		if self.target_root != os.sep:
			create_trees_kwargs["target_root"] = self.target_root

		trees = portage.create_trees(env={}, eprefix=self.eprefix,
			**create_trees_kwargs)

		for root, root_trees in trees.items():
			settings = root_trees["vartree"].settings
			settings._init_dirs()
			setconfig = load_default_config(settings, root_trees)
			root_trees["root_config"] = RootConfig(settings, root_trees, setconfig)

		return trees[trees._target_eroot]["vartree"].settings, trees
示例#5
0
    def _load_config(self):
        portdir_overlay = []
        for repo_name in sorted(self.repo_dirs):
            path = self.repo_dirs[repo_name]
            if path != self.portdir:
                portdir_overlay.append(path)

        env = {
            "ACCEPT_KEYWORDS": "x86",
            "DISTDIR": self.distdir,
            "PKGDIR": self.pkgdir,
            "PORTDIR": self.portdir,
            "PORTDIR_OVERLAY": " ".join(portdir_overlay),
            'PORTAGE_TMPDIR': os.path.join(self.eroot, 'var/tmp'),
        }

        if os.environ.get("NOCOLOR"):
            env["NOCOLOR"] = os.environ["NOCOLOR"]

        if os.environ.get("SANDBOX_ON") == "1":
            # avoid problems from nested sandbox instances
            env["FEATURES"] = "-sandbox"

        # Pass along PORTAGE_USERNAME and PORTAGE_GRPNAME since they
        # need to be inherited by ebuild subprocesses.
        if 'PORTAGE_USERNAME' in os.environ:
            env['PORTAGE_USERNAME'] = os.environ['PORTAGE_USERNAME']
        if 'PORTAGE_GRPNAME' in os.environ:
            env['PORTAGE_GRPNAME'] = os.environ['PORTAGE_GRPNAME']

        trees = portage.create_trees(env=env, eprefix=self.eprefix)
        for root, root_trees in trees.items():
            settings = root_trees["vartree"].settings
            settings._init_dirs()
            setconfig = load_default_config(settings, root_trees)
            root_trees["root_config"] = RootConfig(settings, root_trees,
                                                   setconfig)

        return settings, trees
示例#6
0
    def _load_config(self):
        env = {
            "ACCEPT_KEYWORDS": "x86",
            "PORTDIR": self.portdir,
            'PORTAGE_TMPDIR': os.path.join(self.eroot, 'var/tmp'),
        }

        # Pass along PORTAGE_USERNAME and PORTAGE_GRPNAME since they
        # need to be inherited by ebuild subprocesses.
        if 'PORTAGE_USERNAME' in os.environ:
            env['PORTAGE_USERNAME'] = os.environ['PORTAGE_USERNAME']
        if 'PORTAGE_GRPNAME' in os.environ:
            env['PORTAGE_GRPNAME'] = os.environ['PORTAGE_GRPNAME']

        settings = config(_eprefix=self.eprefix, env=env)
        settings.lock()

        trees = {
            self.root: {
                "vartree":
                vartree(settings=settings),
                "porttree":
                portagetree(self.root, settings=settings),
                "bintree":
                binarytree(self.root,
                           os.path.join(self.eroot, "usr/portage/packages"),
                           settings=settings)
            }
        }

        for root, root_trees in trees.items():
            settings = root_trees["vartree"].settings
            settings._init_dirs()
            setconfig = load_default_config(settings, root_trees)
            root_trees["root_config"] = RootConfig(settings, root_trees,
                                                   setconfig)

        return settings, trees