Ejemplo n.º 1
0
    def compile(self):
        for category in ("packages", "modules", "datafiles"):
            for name, value in self._node_pkg.iter_category(category):
                builder = self.builder_registry.builder(category, name)
                name, nodes, from_node, target_dir = builder(name, value)
                self.outputs_registry.register_outputs(category, name, nodes,
                                                       from_node, target_dir)

        category = "scripts"
        for name, executable in self.pkg.executables.items():
            builder = self.builder_registry.builder(category, name)
            name, nodes, from_node, target_dir = builder(name, executable)
            self.outputs_registry.register_outputs(category, name, nodes,
                                                   from_node, target_dir)

        if self.pkg.config_py:
            content = _config_content(self.retrieve_configured_scheme())
            target_node = self.build_node.make_node(self.pkg.config_py)
            target_node.parent.mkdir()
            target_node.safe_write(content)
            self.outputs_registry.register_outputs("modules", "bento_config",
                                                   [target_node],
                                                   self.build_node, "$sitedir")

        if self.pkg.meta_template_files:
            target_nodes = []
            for template in self.pkg.meta_template_files:
                target_node = write_template(self.top_node, template, self.pkg,
                                             self._meta)
                target_nodes.append(target_node)
            self.outputs_registry.register_outputs("modules",
                                                   "meta_from_template",
                                                   target_nodes,
                                                   self.build_node, "$sitedir")
Ejemplo n.º 2
0
    def compile(self):
        for category in ("packages", "modules", "datafiles"):
            for name, value in self._node_pkg.iter_category(category):
                builder = self.builder_registry.builder(category, name)
                name, nodes, from_node, target_dir = builder(name, value)
                self.outputs_registry.register_outputs(category, name, nodes, from_node, target_dir)

        category = "scripts"
        for name, executable in self.pkg.executables.items():
            builder = self.builder_registry.builder(category, name)
            name, nodes, from_node, target_dir = builder(name, executable)
            self.outputs_registry.register_outputs(category, name, nodes, from_node, target_dir)

        if self.pkg.config_py:
            content = _config_content(self.get_paths_scheme())
            target_node = self.build_node.make_node(self.pkg.config_py)
            target_node.parent.mkdir()
            target_node.safe_write(content)
            self.outputs_registry.register_outputs("modules", "bento_config", [target_node],
                                                   self.build_node, "$sitedir")

        if self.pkg.meta_template_file:
            target_node = write_template(self.top_node, self.pkg)
            self.outputs_registry.register_outputs("modules", "meta_from_template", [target_node],
                                                   self.build_node, "$sitedir")