def __init__(self, prefixCommand=None, targets=None, **kwargs):
        self.prefixCommand = prefixCommand
        self.targets = targets

        command = []
        if prefixCommand:
            command += prefixCommand

        command += [
            "ninja",
            WithProperties("%(jobs:+-j)s"),
            WithProperties("%(jobs:-)s"),
            WithProperties("%(loadaverage:+-l)s"),
            WithProperties("%(loadaverage:-)s")
        ]

        if targets:
            command += targets

        # Don't forget to remove all the empty items from the command,
        # which we could get because of WithProperties rendered as empty strings.
        kwargs['command'] = command

        # And upcall to let the base class do its work
        WarningCountingShellCommand.__init__(self, **kwargs)

        self.addFactoryArguments(prefixCommand=prefixCommand, targets=targets)
Esempio n. 2
0
    def __init__(self, prefixCommand=None, options=None, path=None, **kwargs):
        self.prefixCommand = prefixCommand
        self.path = [path]

        if options is None:
            self.options = list()
        else:
            self.options = list(options)

        command = []
        if prefixCommand:
            command += prefixCommand

        command += ["cmake"]

        if self.options:
            command += self.options

        if self.path:
            command += self.path

        # Remove here all the kwargs any of our LLVM buildbot command could consume.
        # Note: We will remove all the empty items from the command at start, as we
        # still didn't get yet WithProperties rendered.
        sanitized_kwargs = self.sanitize_kwargs(kwargs)

        sanitized_kwargs["command"] = command

        # And upcall to let the base class do its work
        WarningCountingShellCommand.__init__(self, **sanitized_kwargs)

        self.addFactoryArguments(prefixCommand=prefixCommand,
                                 options=self.options,
                                 path=path)
Esempio n. 3
0
    def __init__(self, prefixCommand=None, options=None, targets=None, **kwargs):
        self.prefixCommand = prefixCommand
        self.targets = targets

        command = []
        if prefixCommand:
            command += prefixCommand

        command += ["ninja"]

        if options is None:
            self.options = list()
        else:
            self.options = list(options)

        j_opt = re.compile(r'^-j$|^-j\d+$')
        l_opt = re.compile(r'^-l$|^-l\d+(\.(\d+)?)?$')

        # We can get jobs in the options. If so, we would use that.
        if not any(j_opt.search(opt) for opt in self.options if isinstance(opt, basestring)):
            # Otherwise let's see if we got it in the kwargs.
            if kwargs.get('jobs', None):
                self.options += ["-j", kwargs['jobs']]
            else:
                # Use the property if option was not explicitly
                # specified.
                command += [
                    WithProperties("%(jobs:+-j)s"),
                    WithProperties("%(jobs:-)s"),
                    ]

        # The same logic is for hanling the loadaverage option.
        if not any(l_opt.search(opt) for opt in self.options if isinstance(opt, basestring)):
            if kwargs.get('loadaverage', None):
                self.options += ["-l", kwargs['loadaverage']]
            else:
                command += [
                    WithProperties("%(loadaverage:+-l)s"),
                    WithProperties("%(loadaverage:-)s"),
                    ]

        if self.options:
            command += self.options

        if targets:
            command += targets

        # Remove here all the kwargs any of our LLVM buildbot command could consume.
        # Note: We will remove all the empty items from the command at start, as we
        # still didn't get yet WithProperties rendered.
        sanitized_kwargs = self.sanitize_kwargs(kwargs)

        sanitized_kwargs["command"] = command

        # And upcall to let the base class do its work
        WarningCountingShellCommand.__init__(self, **sanitized_kwargs)

        self.addFactoryArguments(prefixCommand=prefixCommand,
                                 options=self.options,
                                 targets=targets)
Esempio n. 4
0
    def __init__(self,
                 prefixCommand=None,
                 options=None,
                 targets=None,
                 **kwargs):
        self.prefixCommand = prefixCommand
        self.targets = targets

        command = []
        if prefixCommand:
            command += prefixCommand

        command += ["make"]

        if options is None:
            self.options = list()
        else:
            self.options = list(options)

        j_opt = re.compile(r'^-j$|^-j\d+$')

        # We can get jobs in the options. If so, we would use that.
        if not any(
                j_opt.search(opt)
                for opt in self.options if isinstance(opt, basestring)):
            # Otherwise let's see if we got it in the kwargs.
            if kwargs.get('jobs', None):
                self.options += ["-j", kwargs['jobs']]
            else:
                # Use the property if option was not explicitly
                # specified.
                command += [
                    WithProperties("%(jobs:+-j)s"),
                    WithProperties("%(jobs:-)s"),
                ]

        if self.options:
            command += self.options

        if targets:
            command += targets

        # Remove here all the kwargs any of our LLVM buildbot command could consume.
        # Note: We will remove all the empty items from the command at start, as we
        # still didn't get yet WithProperties rendered.
        sanitized_kwargs = self.sanitize_kwargs(kwargs)

        sanitized_kwargs["command"] = command

        # And upcall to let the base class do its work
        WarningCountingShellCommand.__init__(self, **sanitized_kwargs)

        self.addFactoryArguments(prefixCommand=prefixCommand,
                                 options=self.options,
                                 targets=targets)
Esempio n. 5
0
    def __init__(self, prefixCommand=None, options=None, path=None, **kwargs):
        self.prefixCommand = prefixCommand
        self.path = [path]

        if options is None:
            self.options = list()
        else:
            self.options = list(options)

        command = []
        if prefixCommand:
            command += prefixCommand

        command += ["cmake"]

        # Set some default options.
        CmakeCommand.applyDefaultOptions(self.options, [
            ('-DCMAKE_BUILD_TYPE=', 'Release'),
            ('-DLLVM_ENABLE_WERROR=', 'ON'),
            ('-DLLVM_OPTIMIZED_TABLEGEN=', 'ON'),
        ])

        if self.options:
            command += self.options

        if self.path:
            command += self.path

        # Remove here all the kwargs any of our LLVM buildbot command could consume.
        # Note: We will remove all the empty items from the command at start, as we
        # still didn't get yet WithProperties rendered.
        sanitized_kwargs = self.sanitize_kwargs(kwargs)

        sanitized_kwargs["command"] = command

        # And upcall to let the base class do its work
        WarningCountingShellCommand.__init__(self, **sanitized_kwargs)

        self.addFactoryArguments(prefixCommand=prefixCommand,
                                 options=self.options,
                                 path=path)
Esempio n. 6
0
    def __init__(self, prefixCommand=None, options=None, path=None, **kwargs):
        self.prefixCommand = prefixCommand
        self.path = [path]

        if options is None:
            self.options = list()
        else:
            self.options = list(options)

        command = []
        if prefixCommand:
            command += prefixCommand

        command += ["cmake"]

        # Set some default options.
        CmakeCommand.applyDefaultOptions(self.options, [
            ('-DCMAKE_BUILD_TYPE=',        'Release'),
            ('-DLLVM_ENABLE_WERROR=',      'ON'),
            ('-DLLVM_OPTIMIZED_TABLEGEN=', 'ON'),
            ])

        if self.options:
            command += self.options

        if self.path:
            command += self.path

        # Remove here all the kwargs any of our LLVM buildbot command could consume.
        # Note: We will remove all the empty items from the command at start, as we
        # still didn't get yet WithProperties rendered.
        sanitized_kwargs = self.sanitize_kwargs(kwargs)

        sanitized_kwargs["command"] = command

        # And upcall to let the base class do its work
        WarningCountingShellCommand.__init__(self, **sanitized_kwargs)

        self.addFactoryArguments(prefixCommand=prefixCommand,
                                 options=self.options,
                                 path=path)
Esempio n. 7
0
    def __init__(self, prefixCommand=None, targets=None, **kwargs):
        self.prefixCommand = prefixCommand
        self.targets = targets

        command = []
        if prefixCommand:
            command += prefixCommand

        command += ["ninja",
                     WithProperties("%(jobs:+-j)s"),        WithProperties("%(jobs:-)s"),
                     WithProperties("%(loadaverage:+-l)s"), WithProperties("%(loadaverage:-)s")]

        if targets:
            command += targets

        # Don't forget to remove all the empty items from the command,
        # which we could get because of WithProperties rendered as empty strings.
        kwargs['command'] = command

        # And upcall to let the base class do its work
        WarningCountingShellCommand.__init__(self, **kwargs)

        self.addFactoryArguments(prefixCommand=prefixCommand,
                                 targets=targets)
Esempio n. 8
0
    def __init__(self,
                 architecture=None,
                 distribution=None,
                 basetgz=None,
                 mirror=None,
                 extrapackages=None,
                 keyring=None,
                 components=None,
                 **kwargs):
        """
        Creates the DebPbuilder object.

        @type architecture: str
        @param architecture: the name of the architecture to build
        @type distribution: str
        @param distribution: the man of the distribution to use
        @type basetgz: str
        @param basetgz: the path or  path template of the basetgz
        @type mirror: str
        @param mirror: the mirror for building basetgz
        @type extrapackages: list
        @param extrapackages: adds packages specified to buildroot
        @type keyring: str
        @param keyring: keyring file to use for verification
        @type components: str
        @param components: components to use for chroot creation
        @type kwargs: dict
        @param kwargs: All further keyword arguments.
        """
        WarningCountingShellCommand.__init__(self, **kwargs)

        if architecture:
            self.architecture = architecture
        if distribution:
            self.distribution = distribution
        if mirror:
            self.mirror = mirror
        if extrapackages:
            self.extrapackages = extrapackages
        if keyring:
            self.keyring = keyring
        if components:
            self.components = components

        if self.architecture:
            kwargs['architecture'] = self.architecture
        else:
            kwargs['architecture'] = 'local'
        kwargs['distribution'] = self.distribution

        if basetgz:
            self.basetgz = basetgz % kwargs
        else:
            self.basetgz = self.basetgz % kwargs

        if not self.distribution:
            config.error("You must specify a distribution.")

        self.command = ['pdebuild', '--buildresult', '.', '--pbuilder', self.pbuilder]
        if self.architecture:
            self.command += ['--architecture', self.architecture]
        self.command += ['--', '--buildresult', '.', self.baseOption, self.basetgz]
        if self.extrapackages:
            self.command += ['--extrapackages', " ".join(self.extrapackages)]

        self.suppressions.append((None, re.compile(r"\.pbuilderrc does not exist"), None, None))

        self.addLogObserver(
            'stdio', logobserver.LineConsumerLogObserver(self.logConsumer))
Esempio n. 9
0
    def __init__(self,
                 architecture=None,
                 distribution=None,
                 basetgz=None,
                 mirror=None,
                 extrapackages=None,
                 keyring=None,
                 components=None,
                 **kwargs):
        """
        Creates the DebPbuilder object.

        @type architecture: str
        @param architecture: the name of the architecture to build
        @type distribution: str
        @param distribution: the man of the distribution to use
        @type basetgz: str
        @param basetgz: the path or  path template of the basetgz
        @type mirror: str
        @param mirror: the mirror for building basetgz
        @type extrapackages: list
        @param extrapackages: adds packages specified to buildroot
        @type keyring: str
        @param keyring: keyring file to use for verification
        @type components: str
        @param components: components to use for chroot creation
        @type kwargs: dict
        @param kwargs: All further keyword arguments.
        """
        WarningCountingShellCommand.__init__(self, **kwargs)

        if architecture:
            self.architecture = architecture
        if distribution:
            self.distribution = distribution
        if mirror:
            self.mirror = mirror
        if extrapackages:
            self.extrapackages = extrapackages
        if keyring:
            self.keyring = keyring
        if components:
            self.components = components

        if self.architecture:
            kwargs['architecture'] = self.architecture
        else:
            kwargs['architecture'] = 'local'
        kwargs['distribution'] = self.distribution

        if basetgz:
            self.basetgz = basetgz % kwargs
        else:
            self.basetgz = self.basetgz % kwargs

        if not self.distribution:
            config.error("You must specify a distribution.")

        self.command = [
            'pdebuild', '--buildresult', '.', '--pbuilder', self.pbuilder
        ]
        if self.architecture:
            self.command += ['--architecture', self.architecture]
        self.command += [
            '--', '--buildresult', '.', self.baseOption, self.basetgz
        ]
        if self.extrapackages:
            self.command += ['--extrapackages', " ".join(self.extrapackages)]

        self.suppressions.append(
            (None, re.compile(r"\.pbuilderrc does not exist"), None, None))