Exemplo n.º 1
0
def do_heuristics(fp):
    c = Copyright()
    num_licenses = 0
    for l in fp.readlines():
        if l.startswith("License:"):
            num_licenses += 1
            _, v = l.split(":", 1)
            data = {"License": v.strip()}
            lic_para = LicenseParagraph(data)
            c.add_license_paragraph(lic_para)

    if num_licenses > 0:
        return c
    else:
        return None
Exemplo n.º 2
0
def do_heuristics(fp):
    c = Copyright()
    num_licenses = 0
    for l in fp.readlines():
        if l.startswith("License:"):
            num_licenses += 1
            _, v = l.split(":", 1)
            data = {"License": v.strip()}
            lic_para = LicenseParagraph(data)
            c.add_license_paragraph(lic_para)

    if num_licenses > 0:
        return c

    return None
Exemplo n.º 3
0
        files = group.files.get_patterns()
    else:
        files = group.files.sorted_members()

    if group.copyrights:
        holders = '\n           '.join(group.copyrights.sorted_members())
    else:
        holders = 'Unknown'
    paragraph = FilesParagraph.create(list(files), holders,
                                      License(group.license))

    comments = group.get_comments()
    if comments:
        paragraph.comment = comments

    c.add_files_paragraph(paragraph)

# Print license paragraphs
for key in sorted(licenses):
    license_ = DecopyLicense.get(key)
    paragraph = LicenseParagraph.create(License(license_.name))
    paragraph.comment = "Add the corresponding license text here"
    c.add_license_paragraph(paragraph)

with open('debian/copyright', 'w') as f:
    c.dump(f)

fixed_lintian_tag('source', 'no-copyright-file')

report_result('Create a debian/copyright file.', certainty=CERTAINTY)