예제 #1
0
def STAGE4_loop(srcpkg_paths, nb_cpu):
    total = len(srcpkg_paths)
    job_queue = []
    for srcpkg_path in srcpkg_paths:
        cmd = BBSbase.getSTAGE4cmd(srcpkg_path)
        if cmd == None:
            continue
        pkg = bbs.parse.getPkgFromPath(srcpkg_path)
        version = bbs.parse.getVersionFromPath(srcpkg_path)
        check_dir = pkg + '.Rcheck'
        pkgdumps_prefix = pkg + '.checksrc'
        pkgdumps = BBSbase.PkgDumps(check_dir, pkgdumps_prefix)
        job = BBSbase.CheckSrc_Job(pkg, version, cmd, pkgdumps,
                                   BBSvars.checksrc_rdir)
        job_queue.append(job)
    nb_jobs = len(job_queue)
    print "BBS> BEGIN STAGE4 loop."
    t0 = time.time()
    bbs.jobs.processJobQueue(job_queue, None, nb_cpu,
                             BBScorevars.r_cmd_timeout, True)
    dt = time.time() - t0
    print "BBS> END STAGE4 loop."
    print "BBS> -------------------------------------------------------------"
    print "BBS> STAGE4 SUMMARY:"
    print "BBS>   o Working dir: %s" % os.getcwd()
    print "BBS>   o %d srcpkg file(s) in working dir" % total
    print "BBS>   o %d srcpkg file(s) queued and processed" % nb_jobs
    print "BBS>   o Total time: %.2f seconds" % dt
    print "BBS> -------------------------------------------------------------"
    return
예제 #2
0
파일: BBS-run.py 프로젝트: jwokaty/BBS
def prepare_STAGE4_job_queue(srcpkg_paths, out_dir):
    print("BBS> Preparing STAGE4 job queue ...", end=" ")
    sys.stdout.flush()
    stage = 'checksrc'
    jobs = []
    for srcpkg_path in srcpkg_paths:
        cmd = BBSbase.getSTAGE4cmd(srcpkg_path)
        pkg = bbs.parse.get_pkgname_from_srcpkg_path(srcpkg_path)
        version = bbs.parse.get_version_from_srcpkg_path(srcpkg_path)
        Rcheck_dir = pkg + '.Rcheck'
        pkgdumps_prefix = pkg + '.' + stage
        pkgdumps = BBSbase.PkgDumps(Rcheck_dir, pkgdumps_prefix)
        job = BBSbase.CheckSrc_Job(pkg, version, cmd, pkgdumps, out_dir)
        jobs.append(job)
    print("OK")
    sys.stdout.flush()
    job_queue = bbs.jobs.JobQueue(stage, jobs, None)
    job_queue._total = len(srcpkg_paths)
    return job_queue
예제 #3
0
파일: BBS-run.py 프로젝트: kant/BBS
def prepare_STAGE4_job_queue(srcpkg_paths):
    print "BBS> Preparing STAGE4 job queue ... ",
    stage = 'checksrc'
    jobs = []
    for srcpkg_path in srcpkg_paths:
        cmd = BBSbase.getSTAGE4cmd(srcpkg_path)
        if cmd == None:
            continue
        pkg = bbs.parse.getPkgFromPath(srcpkg_path)
        version = bbs.parse.getVersionFromPath(srcpkg_path)
        check_dir = pkg + '.Rcheck'
        pkgdumps_prefix = pkg + '.' + stage
        pkgdumps = BBSbase.PkgDumps(check_dir, pkgdumps_prefix)
        job = BBSbase.CheckSrc_Job(pkg, version, cmd,
                                   pkgdumps, BBSvars.checksrc_rdir)
        jobs.append(job)
    print "OK"
    job_queue = bbs.jobs.JobQueue(stage, jobs, None)
    job_queue._total = len(srcpkg_paths)
    return job_queue