Пример #1
0
    def _run_configure_and_build(self, bento_info, install_prefix):
        top_node = self.top_node

        create_fake_package_from_bento_info(top_node, bento_info)

        context = GlobalContext(None)
        options = PackageOptions.from_string(bento_info)
        context.register_package_options(options)

        cmd_argv = [
            "--prefix=%s" % install_prefix,
            "--exec-prefix=%s" % install_prefix
        ]

        conf, configure = prepare_configure(top_node, bento_info,
                                            ConfigureYakuContext, cmd_argv)

        context.register_command("configure", configure)
        options_context = OptionsContext.from_command(configure)
        if not context.is_options_context_registered("configure"):
            context.register_options_context("configure", options_context)
        context.save_command_argv("configure", cmd_argv)

        run_command_in_context(conf, configure)

        bld, build = prepare_build(top_node, bento_info)
        run_command_in_context(bld, build)

        return context, conf, configure, bld, build
Пример #2
0
    def _run_configure_and_build(self, bento_info, install_prefix):
        top_node = self.top_node

        create_fake_package_from_bento_info(top_node, bento_info)

        context = GlobalContext(None)
        options = PackageOptions.from_string(bento_info)
        context.register_package_options(options)

        cmd_argv = ["--prefix=%s" % install_prefix, "--exec-prefix=%s" % install_prefix]

        conf, configure = prepare_configure(top_node, bento_info, ConfigureYakuContext, cmd_argv)

        context.register_command("configure", configure)
        options_context = OptionsContext.from_command(configure)
        if not context.is_options_context_registered("configure"):
            context.register_options_context("configure", options_context)
        context.save_command_argv("configure", cmd_argv)

        run_command_in_context(conf, configure)

        bld, build = prepare_build(top_node, bento_info)
        run_command_in_context(bld, build)

        return context, conf, configure, bld, build
Пример #3
0
    def _create_contexts(self, bentos, bscripts=None):
        top_node = self.top_node

        create_fake_package_from_bento_infos(top_node, bentos, bscripts)

        conf, configure = prepare_configure(top_node, bentos["bento.info"], self._configure_context)
        configure.run(conf)
        conf.shutdown()

        bld, build = prepare_build(top_node, conf.pkg, context_klass=self._build_context)
        return conf, configure, bld, build
Пример #4
0
    def _run_configure(self, bentos, bscripts=None, configure_argv=None, build_argv=None):
        top_node = self.top_node

        create_fake_package_from_bento_infos(top_node, bentos, bscripts)

        conf, configure = prepare_configure(top_node, bentos["bento.info"], self._configure_context)
        run_command_in_context(conf, configure)

        bld, build = prepare_build(top_node, bentos["bento.info"], self._build_context, build_argv)

        return conf, configure, bld, build
Пример #5
0
    def _run_configure(self, bentos, bscripts=None, configure_argv=None, build_argv=None):
        top_node = self.top_node

        create_fake_package_from_bento_infos(top_node, bentos, bscripts)

        conf, configure = prepare_configure(top_node, bentos["bento.info"], self._configure_context)
        run_command_in_context(conf, configure)

        bld, build = prepare_build(top_node, bentos["bento.info"], self._build_context, build_argv)

        return conf, configure, bld, build
Пример #6
0
    def _test_installed_sections(self, bento_infos, r_sections):
        create_fake_package_from_bento_infos(self.top_node, bento_infos)

        conf, configure = prepare_configure(self.run_node, bento_infos["bento.info"])
        run_command_in_context(conf, configure)

        bld, build = prepare_build(self.top_node, bento_infos["bento.info"])
        run_command_in_context(bld, build)

        sections = bld.section_writer.sections

        self.assertEqual(comparable_installed_sections(sections), comparable_installed_sections(r_sections))
Пример #7
0
    def _test_installed_sections(self, bento_info, r_sections):
        create_fake_package_from_bento_info(self.top_node, bento_info)

        conf, configure = prepare_configure(self.run_node, bento_info)
        run_command_in_context(conf, configure)

        bld, build = prepare_build(self.top_node, bento_info)
        run_command_in_context(bld, build)

        sections = bld.section_writer.sections

        self.assertEqual(comparable_installed_sections(sections),
                         comparable_installed_sections(r_sections))
Пример #8
0
    def _test_installed_sections(self, bento_info, r_sections):
        create_fake_package_from_bento_info(self.top_node, bento_info)

        conf, configure = prepare_configure(self.run_node, bento_info)
        configure.run(conf)
        conf.shutdown()

        bld, build = prepare_build(self.top_node, conf.pkg, conf.package_options)
        build.run(bld)
        bld.shutdown()

        sections = bld.section_writer.sections

        self.assertEqual(comparable_installed_sections(sections),
                         comparable_installed_sections(r_sections))
Пример #9
0
    def _run_configure_and_build(self, bento_info, install_prefix):
        top_node = self.top_node

        create_fake_package_from_bento_info(top_node, bento_info)

        cmd_argv = ["--prefix=%s" % install_prefix, "--exec-prefix=%s" % install_prefix]

        conf, configure = prepare_configure(top_node, bento_info, ConfigureYakuContext, cmd_argv)
        configure.run(conf)
        conf.shutdown()

        bld, build = prepare_build(top_node, conf.pkg, conf.package_options)
        build.run(bld)
        build.shutdown(bld)

        return conf, configure, bld, build
Пример #10
0
    def _test_run(self, bento_info):
        top_node = self.top_node

        create_fake_package_from_bento_info(top_node, bento_info)

        install_dir = tempfile.mkdtemp()
        cmd_argv = ["--prefix=%s" % install_dir, "--exec-prefix=%s" % install_dir]

        conf, configure = prepare_configure(top_node, bento_info, ConfigureYakuContext, cmd_argv)
        configure.run(conf)
        conf.shutdown()

        bld, build = prepare_build(top_node, conf.pkg)
        build.run(bld)
        build.shutdown(bld)

        install = InstallCommand()
        opts = OptionsContext.from_command(install)

        inst = CmdContext(["--list-files"], opts, conf.pkg, top_node)
        try:
            install.run(inst)
        finally:
            shutil.rmtree(install_dir)