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

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

Check a QueueItem for completion and download it

Definition at line 259 of file build.py.

00259                                :
        """Check a QueueItem for completion and download it"""
        resdir = os.path.join('.falcon','build','building')
        logdir = os.path.join('.falcon','build','logs')
        falcon.util.output(_("Checking build status of %s %s on %s buildd %s") % (tobuild.packagename, tobuild.version, self.arch, self.name))
        # Grab the log first
        if not self.buildcommand:
            logfile = os.path.join(self.downloadpath, tobuild.log_template() % (self.arch, 'FULLYBUILT')) + '.gz'
            dllog = os.path.join(resdir, logfile)
            try:
                falcon.util.run(['rsync', logfile, logdir], buffer=not falcon.conf.verbose)
            except RuntimeError:
                logfile = os.path.join(self.downloadpath, tobuild.log_template() % (self.arch, 'BUILDING')) + '.gz'
                try:
                    falcon.util.run(['rsync', logfile, logdir], buffer=not falcon.conf.verbose)
                    return BUILD_PENDING
                except RuntimeError:
                    falcon.util.debug(_("Couldn't find BUILDING log"))
                logfile = os.path.join(self.downloadpath, tobuild.log_template() % (self.arch, 'FAILEDTOBUILD')) + '.gz'
                try:
                    falcon.util.run(['rsync', logfile, logdir], buffer=not falcon.conf.verbose)
                    return BUILD_FAILED
                except RuntimeError:
                    falcon.util.debug(_("Couldn't find FAILEDTOBUILD log"))
                    # Assume still pending
                    return BUILD_PENDING

        # Changes file
        logfile = tobuild.changes_file() % self.arch
        if os.path.exists(os.path.join(resdir, logfile)):
            falcon.util.warning(_("Changes file %s already exists, not redownloading from buildd %s") % (logfile, self.name))
            return BUILD_FAILED
        try:
            falcon.util.run(['rsync', os.path.join(self.downloadpath, logfile), resdir], buffer=not falcon.conf.verbose)
        except RuntimeError, e:
            falcon.util.debug_exception()
            falcon.util.warning(_("Failed to download file %s from buildd %s") % (logfile, self.name))
            return BUILD_FAILED

        # Now see which files we can grab!
        log = os.path.join(resdir, logfile)
        fd = open(log)
        log = fd.read()
        fd.close()
        parser = FeedParser.FeedParser()
        parser.feed(log)
        log = parser.close()
        files = log['Files']
        for f in files.split("\n"):
            try:
                f = f.split()[-1]
                falcon.util.output(_("Downloading %s") % f)
                falcon.util.run(['rsync', os.path.join(self.downloadpath, f), resdir], buffer=not falcon.conf.verbose)
                # Since pkg_create_dbgsym doesn't add the .ddeb files to the .changes
                # file, try and grab one manually if it exists
                if f.endswith('.deb') and not f.endswith('all.deb'):
                    f2 = f[:-3].replace('_','-dbgsym_',1) + 'ddeb'
                    try:
                        falcon.util.output(_("Checking for debug symbol package %s") % f2)
                        falcon.util.run(['rsync', os.path.join(self.downloadpath, f2), resdir], buffer=not falcon.conf.verbose)
                    except RuntimeError, e:
                        falcon.util.output(_("Not found"))
            except RuntimeError, e:
                falcon.util.debug_exception()
                falcon.util.warning(_("Failed to download file %s from buildd %s") % (f, self.name))
                return BUILD_FAILED
        return BUILD_OK

class QueueItem(models.Model):


Generated by  Doxygen 1.6.0   Back to index