Logo Search packages:      
Sourcecode: falcon version File versions  Download package

def falcon::build::Builder::build (   self,
  tobuild 
)

Build a QueueItem on a build daemon

Definition at line 225 of file build.py.

00225                             :
        """Build a QueueItem on a build daemon"""
        path = os.path.join('.falcon','build','building')
        try:
            falcon.util.output(_("Uploading %s %s for building on %s buildd %s") % (tobuild.packagename, tobuild.version, self.arch, self.name))
            for f in tobuild.files:
                falcon.util.run(['rsync', os.path.join(path, f.name), self.uploadpath], buffer=not falcon.conf.verbose) 
            if self.buildcommand:
                for f in ('FULLYBUILT', 'FAILEDTOBUILD'):
                    if os.path.exists(os.path.join(self.downloadpath, tobuild.log_template() % (self.arch, f) + '.gz')):
                        falcon.util.warning(_("Not building %s %s, a buildlog already exists") % (tobuild.packagename, tobuild.version))
                        return BUILD_FAILED
                buildcommand = [x.replace('%(pocket)', tobuild.pocket).replace('%(dscfile)', os.path.basename(tobuild.dscfile))
                                for x in self.buildcommand]
                falcon.util.output(_("Trying to build on %s") % self.name)
                log = os.path.join(falcon.conf.rootdir, '.falcon', 'build','logs', tobuild.log_template() % (self.arch, 'BUILDING'))
                falcon.util.output(_("Executing the build command, logging to %s") % os.path.basename(log))
                try:
                    falcon.util.run(['ssh', self.hostname] + buildcommand, buffer=False, outfile=log, err_is_out=True)
                except RuntimeError:
                    newlog = os.path.join(falcon.conf.rootdir, '.falcon', 'build','logs', tobuild.log_template() % (self.arch, 'FAILEDTOBUILD'))
                    os.rename(log, newlog)
                    falcon.util.run(['gzip', '-f', newlog])
                    raise # Will be caught a few lines on
                newlog = os.path.join(falcon.conf.rootdir, '.falcon', 'build','logs', tobuild.log_template() % (self.arch, 'FULLYBUILT'))
                os.rename(log, newlog)
                falcon.util.run(['gzip', '-f', newlog])
                return self.download(tobuild)
            else:
                return BUILD_PENDING
        except RuntimeError, e:
            falcon.util.debug_exception()
            return BUILD_FAILED
            
    def download(self, tobuild):


Generated by  Doxygen 1.6.0   Back to index