Example #1
0
    def _test_run(self, bento_info):
        install_prefix = tempfile.mkdtemp()
        try:
            conf, configure, bld, build = self._run_configure_and_build(bento_info, install_prefix)

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

            inst = CmdContext(None, [], opts, conf.pkg, self.top_node)
            install.run(inst)
        finally:
            shutil.rmtree(install_prefix)
Example #2
0
def register_commands(global_context):
    global_context.register_command("help", HelpCommand())
    global_context.register_command("configure", ConfigureCommand())
    global_context.register_command("build", BuildCommand())
    global_context.register_command("install", InstallCommand())
    global_context.register_command("convert", ConvertCommand())
    global_context.register_command("sdist", SdistCommand())
    global_context.register_command("build_egg", BuildEggCommand())
    global_context.register_command("build_wininst", BuildWininstCommand())
    global_context.register_command("sphinx", SphinxCommand())
    global_context.register_command("register_pypi", RegisterPyPI())
    global_context.register_command("upload_pypi", UploadPyPI())

    global_context.register_command("build_pkg_info",
                                    BuildPkgInfoCommand(),
                                    public=False)
    global_context.register_command("parse", ParseCommand(), public=False)
    global_context.register_command("detect_type",
                                    DetectTypeCommand(),
                                    public=False)

    if sys.platform == "darwin":
        import bento.commands.build_mpkg
        global_context.register_command(
            "build_mpkg",
            bento.commands.build_mpkg.BuildMpkgCommand(),
            public=False)
        global_context.set_before("build_mpkg", "build")

    if sys.platform == "win32":
        from bento.commands.build_msi \
            import \
                BuildMsiCommand
        global_context.register_command("build_msi", BuildMsiCommand())
        global_context.set_before("build_msi", "build")
Example #3
0
    def _test_dry_run(self, bento_info):
        install_prefix = tempfile.mkdtemp()
        try:
            context, conf, configure, bld, build = self._run_configure_and_build(
                bento_info, install_prefix)

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

            inst = ContextWithBuildDirectory(context, ["--list-files"], opts,
                                             conf.pkg, self.top_node)
            run_command_in_context(inst, install)
        finally:
            shutil.rmtree(install_prefix)
Example #4
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)
def register_commands(global_context):
    global_context.register_command("configure", ConfigureCommand())
    global_context.register_command("build", BuildCommand())
    global_context.register_command("install", InstallCommand())
    global_context.register_command("sdist", SdistCommand())
    global_context.register_command("build_egg", BuildEggCommand())