示例#1
0
    def run(self, args):
        ctx = create_global_context(args)
        ctx.config = Config(ctx, args.config)

        macro = Macro()
        macro.add(ForAllReposCommand(args.command))
        macro.run(ctx, args.skip)
示例#2
0
    def run(self, args):
        """
            Executes the build command of the kas plugin.
        """

        ctx = create_global_context(args)
        ctx.config = Config(args.config, args.target, args.task)

        macro = Macro()
        macro.add(BuildCommand(args.extra_bitbake_args))
        macro.run(ctx, args.skip)
示例#3
0
文件: build.py 项目: siemens/kas
    def run(self, args):
        """
            Executes the build command of the kas plugin.
        """

        if args.config and args.config.startswith('-'):
            args.extra_bitbake_args.insert(0, args.config)
            args.config = None

        ctx = create_global_context(args)
        ctx.config = Config(ctx, args.config, args.target, args.task)

        macro = Macro()
        macro.add(BuildCommand(args.extra_bitbake_args))
        macro.run(ctx, args.skip)
示例#4
0
文件: shell.py 项目: sotah/kas
    def run(self, args):
        """
            Runs this kas plugin
        """

        ctx = create_global_context(args)
        ctx.config = Config(args.config)

        if args.keep_config_unchanged:
            # Skip the tasks which would change the config of the build
            # environment
            args.skip += [
                'setup_dir',
                'finish_setup_repos',
                'repos_apply_patches',
                'write_bbconfig',
            ]

        macro = Macro()
        macro.add(ShellCommand(args.command))
        macro.run(ctx, args.skip)
示例#5
0
    def run(self, args):
        """
            Runs this kas plugin
        """

        ctx = create_global_context(args)
        ctx.config = Config(ctx, args.config)

        if args.preserve_env:
            # Warn if there's any settings that setup_home would apply
            # but are now ignored
            for var in SetupHome.ENV_VARS:
                if var in os.environ:
                    logging.warning(
                        'Environment variable "%s" ignored '
                        'because user environment is being used', var)

            if not os.isatty(sys.stdout.fileno()):
                logging.error("Error: --preserve-env can only be "
                              "run from a tty")
                sys.exit(1)

            ctx.environ = os.environ.copy()

            logging.warning("Preserving the current environment block may "
                            "have unintended side effects on the build.")

        if args.keep_config_unchanged:
            # Skip the tasks which would change the config of the build
            # environment
            args.skip += [
                'setup_dir',
                'finish_setup_repos',
                'repos_apply_patches',
                'write_bbconfig',
            ]

        macro = Macro()
        macro.add(ShellCommand(args.command))
        macro.run(ctx, args.skip)
示例#6
0
文件: shell.py 项目: yuecelm/kas
    def run(self, args):
        """
            Runs this kas plugin
        """
        # pylint: disable= no-self-use

        if args.cmd != 'shell':
            return False

        cfg = load_config(args.config, args.target)

        macro = Macro()

        macro.add(SetupProxy())
        macro.add(SetupEnviron())
        macro.add(SetupHome())
        macro.add(ShellCommand(args.command))

        macro.run(cfg, args.skip)

        return True
示例#7
0
文件: shell.py 项目: hberneck/kas
    def run(self, args):
        """
            Runs this kas plugin
        """
        # pylint: disable= no-self-use

        if args.cmd != 'shell':
            return False

        cfg = Config(args.config, args.target)

        macro = Macro()

        if not args.keep_config_unchanged:
            macro.add(SetupDir())

        macro.add(SetupProxy())
        macro.add(SetupEnviron())

        if not args.keep_config_unchanged:
            macro.add(ReposFetch())
            macro.add(ReposCheckout())
            macro.add(SetupEnviron())
            macro.add(WriteConfig())

        macro.add(SetupHome())
        macro.add(ShellCommand(args.command))

        macro.run(cfg, args.skip)

        return True
示例#8
0
    def run(self, args):
        """
            Runs this kas plugin
        """
        # pylint: disable= no-self-use

        if args.cmd != 'shell':
            return False

        cfg = Config(args.config, args.target)

        macro = Macro()

        # Prepare
        if not args.keep_config_unchanged:
            macro.add(SetupDir())

        macro.add(SetupProxy())

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(SetupSSHAgent())

        if not args.keep_config_unchanged:
            macro.add(ReposFetch())
            macro.add(ReposCheckout())
            macro.add(SetupEnviron())
            macro.add(WriteConfig())
        else:
            macro.add(SetupEnviron())

        # Shell
        macro.add(SetupHome())
        macro.add(ShellCommand(args.command))

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(CleanupSSHAgent())

        macro.run(cfg, args.skip)

        return True
示例#9
0
    def run(self, args):
        """
            Runs this kas plugin
        """

        ctx = create_global_context(args)
        ctx.config = Config(args.config, None, None)

        macro = Macro()

        # Prepare
        if not args.keep_config_unchanged:
            macro.add(SetupDir())

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(SetupSSHAgent())

        ctx.keep_config = args.keep_config_unchanged

        macro.add(InitSetupRepos())

        repo_loop = Loop('repo_setup_loop')
        repo_loop.add(SetupReposStep())

        macro.add(repo_loop)
        macro.add(FinishSetupRepos())

        macro.add(SetupEnviron())
        macro.add(SetupHome())

        if not args.keep_config_unchanged:
            macro.add(ReposApplyPatches())
            macro.add(WriteBBConfig())

        # Shell
        macro.add(ShellCommand(args.command))

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(CleanupSSHAgent())

        macro.run(ctx, args.skip)
示例#10
0
文件: shell.py 项目: jan-kiszka/kas
    def run(self, args):
        """
            Runs this kas plugin
        """
        # pylint: disable= no-self-use

        if args.cmd != 'shell':
            return False

        ctx = Context(args.config, args.target, None)

        macro = Macro()

        # Prepare
        if not args.keep_config_unchanged:
            macro.add(SetupDir())

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(SetupSSHAgent())

        ctx.keep_config = args.keep_config_unchanged
        macro.add(SetupRepos())

        macro.add(SetupEnviron())
        macro.add(SetupHome())

        if not args.keep_config_unchanged:
            macro.add(ReposApplyPatches())
            macro.add(WriteBBConfig())

        # Shell
        macro.add(ShellCommand(args.command))

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(CleanupSSHAgent())

        macro.run(ctx, args.skip)

        return True
示例#11
0
文件: build.py 项目: siredmar/kas
    def run(self, args):
        """
            Executes the build command of the kas plugin.
        """

        ctx = create_global_context(args)
        ctx.config = Config(args.config, args.target, args.task)

        macro = Macro()

        # Prepare
        macro.add(SetupDir())

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(SetupSSHAgent())

        macro.add(InitSetupRepos())

        repo_loop = Loop('repo_setup_loop')
        repo_loop.add(SetupReposStep())

        macro.add(repo_loop)
        macro.add(FinishSetupRepos())

        macro.add(SetupEnviron())
        macro.add(SetupHome())
        macro.add(ReposApplyPatches())

        macro.add(WriteBBConfig())

        # Build
        macro.add(BuildCommand(args.extra_bitbake_args))

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(CleanupSSHAgent())

        macro.run(ctx, args.skip)