示例#1
0
    def start(self):
        changes = self.step_status.build.getChanges()
        args = parseSendchangeArguments(changes[0].files)

        # if we were passed in a mozconfig and also have an uploaded one
        # they need to be combined, with the uploaded one overwriting any
        # settings set by the passed in one
        try:
            uploadedFile = path.join(self.patchDir, args['mozconfig'])
            os.stat(uploadedFile)
            oldMasterSrc = self.mastersrc
            self.mastersrc = uploadedFile
            try:
                os.stat(oldMasterSrc)
                # we have both a passed in and uploaded mozconfig
                self.mastersrc = "%s-%s" % (uploadedFile,
                                            self.getProperty("slavename"))

                # read in both configs
                initialConfig = open(oldMasterSrc)
                newConfig = initialConfig.read()
                initialConfig.close()
                uploadedConfig = open(uploadedFile)
                newConfig += "\n"
                newConfig += uploadedConfig.read()
                uploadedConfig.close()

                # now write out the whole new thing
                mozconfig = open(self.mastersrc, "w")
                mozconfig.write(newConfig)
                mozconfig.close()
            except (OSError, TypeError, KeyError):
                # no passed in mozconfig, mastersrc set above
                try:
                    os.stat(self.mastersrc)
                except (OSError, TypeError, KeyError):
                    return SKIPPED
        except (OSError, TypeError, KeyError):
            # no uploaded mozconfig
            try:
                os.stat(self.mastersrc)
                # if this succeeds, the passed in mastersrc is valid
            except (OSError, TypeError, KeyError):
                # nothing to transfer, skip
                return SKIPPED

        # everything is set up, download the file
        FileDownload.start(self)
示例#2
0
    def start(self):
        changes = self.step_status.build.getChanges()
        args = parseSendchangeArguments(changes[0].files)

        # if we were passed in a mozconfig and also have an uploaded one
        # they need to be combined, with the uploaded one overwriting any
        # settings set by the passed in one
        try:
            uploadedFile = path.join(self.patchDir, args['mozconfig'])
            os.stat(uploadedFile)
            oldMasterSrc = self.mastersrc
            self.mastersrc = uploadedFile
            try:
                os.stat(oldMasterSrc)
                # we have both a passed in and uploaded mozconfig
                self.mastersrc = "%s-%s" % (uploadedFile,
                                            self.getProperty("slavename"))

                # read in both configs
                initialConfig = open(oldMasterSrc)
                newConfig = initialConfig.read()
                initialConfig.close()
                uploadedConfig = open(uploadedFile)
                newConfig += "\n"
                newConfig += uploadedConfig.read()
                uploadedConfig.close()

                # now write out the whole new thing
                mozconfig = open(self.mastersrc, "w")
                mozconfig.write(newConfig)
                mozconfig.close()
            except (OSError, TypeError, KeyError):
                # no passed in mozconfig, mastersrc set above
                try:
                    os.stat(self.mastersrc)
                except (OSError, TypeError, KeyError):
                    return SKIPPED
        except (OSError, TypeError, KeyError):
            # no uploaded mozconfig
            try:
                os.stat(self.mastersrc)
                # if this succeeds, the passed in mastersrc is valid
            except (OSError, TypeError, KeyError):
                # nothing to transfer, skip
                return SKIPPED

        # everything is set up, download the file
        FileDownload.start(self)
示例#3
0
    def start(self):
        changes = self.step_status.build.getChanges()

        if len(changes) < 1:
            return SKIPPED

        args = parseSendchangeArguments(changes[0].files)

        if not 'infoFile' in args and self.isOptional:
            return SKIPPED

        self.mastersrc = "%s/%s" % (self.patchDir, args['infoFile'])
        self.slavedest = "%s" % (args['infoFile'])

        # now that everything is set-up, download the file
        FileDownload.start(self)
示例#4
0
    def start(self):
        recent_build = None
        recent_mtime = 0

        for entry in os.listdir(self.build_dir):
            full_path = os.path.abspath(os.path.join(self.build_dir, entry))

            if (os.path.isfile(full_path) and
                entry.startswith(self.basename) and
                entry.endswith("." + self.extension)):

                time = os.path.getmtime(full_path)

                if time > recent_mtime:
                    recent_mtime = time
                    recent_build = full_path

        if recent_build:
            self.setProperty(self.prop_name, recent_build,
                             "DownloadLatestBuild")
            self.mastersrc = recent_build
            self.slavedest = os.path.join(os.path.abspath(self.slavedest),
                                          os.path.dirname(recent_build))
            return FileDownload.start(self)

        self.step_status.setColor("red")
        self.step_status.setText("build not found")
        self.finished(FAILURE)