Example #1
0
def coccinelle(dsc, analysis):
    raise NotImplemented("Not ported")

    run_command(["dpkg-source", "-x", dsc, "source"])
    with cd('source'):
        log = ""
        failed = False
        for semantic_patch in list_semantic_patches():
            out, err, ret = run_command([
                "spatch",
                "-D", "firehose",
                "--cocci-file", semantic_patch,
                "--dir", ".",
                "--no-show-diff",
                "--timeout", "120",
            ])
            failed = (ret != 0) or failed

            parsed_results = parse_coccinelle(out)

            result_count = 0
            for result in parsed_results:
                analysis.results.append(result)
                result_count += 1

            log += "DEAL patch %s\n" % semantic_patch
            log += "  %d results\n" % result_count

    return (analysis, log, failed, None)
Example #2
0
def coccinelle(dsc, analysis):
    run_command(["dpkg-source", "-x", dsc, "source-coccinelle"])
    os.environ['COCCI_SUT_TYPE'] = 'debian-source'  # used by coccinelle firehose scripts

    with cd('source-coccinelle'):
        log = ""
        failed = False
        for semantic_patch in list_semantic_patches():
            logger.debug('Running patch: {0}'.format(semantic_patch))
            out, err, ret = run_command([
                "spatch",
                "-D", "firehose",
                "--cocci-file", semantic_patch,
                "--dir", ".",
                "--no-show-diff",
                "--timeout", "120",
            ])

            failed = (ret != 0) or failed
            logger.debug('Spatch output: {0}'.format(out))
            logger.debug('Spatch err: {0}'.format(err))
            parsed_results = parse_coccinelle(out)

            result_count = 0
            for result in parsed_results:
                analysis.results.append(result)
                result_count += 1

            log += "DEAL patch %s\n" % semantic_patch
            log += "  %d results\n" % result_count

    return (analysis, log, failed, None, None)
Example #3
0
def coccinelle(dsc, analysis):

    run_command(["dpkg-source", "-x", dsc, "source"])
    os.environ['COCCI_SUT_TYPE'] = 'debian-source' # used by coccinelle firehose scripts

    with cd('source'):
        log = ""
        failed = False
        for semantic_patch in list_semantic_patches():
            logger.debug('Running patch: {0}'.format(semantic_patch))
            out, err, ret = run_command([
                "spatch",
                "-D", "firehose",
                "--cocci-file", semantic_patch,
                "--dir", ".",
                "--no-show-diff",
                "--timeout", "120",
            ])


            failed = (ret != 0) or failed
            logger.debug('Spatch output: {0}'.format(out))
            logger.debug('Spatch err: {0}'.format(err))
            parsed_results = parse_coccinelle(out)

            result_count = 0
            for result in parsed_results:
                analysis.results.append(result)
                result_count += 1

            log += "DEAL patch %s\n" % semantic_patch
            log += "  %d results\n" % result_count

    return (analysis, log, failed, None, None)
Example #4
0
def coccinelle(dsc, analysis):
    raise NotImplemented("Not ported")

    run_command(["dpkg-source", "-x", dsc, "source"])
    with cd('source'):
        log = ""
        failed = False
        for semantic_patch in list_semantic_patches():
            out, err, ret = run_command([
                "spatch",
                "-D",
                "firehose",
                "--cocci-file",
                semantic_patch,
                "--dir",
                ".",
                "--no-show-diff",
                "--timeout",
                "120",
            ])
            failed = (ret != 0) or failed

            parsed_results = parse_coccinelle(out)

            result_count = 0
            for result in parsed_results:
                analysis.results.append(result)
                result_count += 1

            log += "DEAL patch %s\n" % semantic_patch
            log += "  %d results\n" % result_count

    return (analysis, log, failed, None)