Esempio n. 1
0
def output_deb_info(suite, filename, packagename, session = None):
    (control, control_keys, section, predepends, depends, recommends, arch, maintainer) = read_control(filename)

    if control == '':
        return formatted_text("no control info")
    to_print = ""
    if not package_relations.has_key(packagename):
        package_relations[packagename] = {}
    for key in control_keys :
        if key == 'Pre-Depends':
            field_value = create_depends_string(suite, predepends, session)
            package_relations[packagename][key] = field_value
        elif key == 'Depends':
            field_value = create_depends_string(suite, depends, session)
            package_relations[packagename][key] = field_value
        elif key == 'Recommends':
            field_value = create_depends_string(suite, recommends, session)
            package_relations[packagename][key] = field_value
        elif key == 'Section':
            field_value = section
        elif key == 'Architecture':
            field_value = arch
        elif key == 'Maintainer':
            field_value = maintainer
        elif key == 'Description':
            if use_html:
                field_value = formatted_text(control.find(key), strip=True)
            else:
                desc = control.find(key)
                desc = re_newlinespace.sub('\n ', desc)
                field_value = escape_if_needed(desc)
        else:
            field_value = escape_if_needed(control.find(key))
        to_print += " "+format_field(key,field_value)+'\n'
    return to_print
Esempio n. 2
0
def output_deb_info(suite, filename, packagename, session = None):
    (control, control_keys, section, depends, recommends, arch, maintainer) = read_control(filename)

    if control == '':
        return formatted_text("no control info")
    to_print = ""
    if not package_relations.has_key(packagename):
        package_relations[packagename] = {}
    for key in control_keys :
        if key == 'Depends':
            field_value = create_depends_string(suite, depends, session)
            package_relations[packagename][key] = field_value
        elif key == 'Recommends':
            field_value = create_depends_string(suite, recommends, session)
            package_relations[packagename][key] = field_value
        elif key == 'Section':
            field_value = section
        elif key == 'Architecture':
            field_value = arch
        elif key == 'Maintainer':
            field_value = maintainer
        elif key == 'Description':
            if use_html:
                field_value = formatted_text(control.find(key), strip=True)
            else:
                desc = control.find(key)
                desc = re_newlinespace.sub('\n ', desc)
                field_value = escape_if_needed(desc)
        else:
            field_value = escape_if_needed(control.find(key))
        to_print += " "+format_field(key,field_value)+'\n'
    return to_print
Esempio n. 3
0
def output_deb_info(suite, filename, packagename, session=None):
    (control, control_keys, section, predepends, depends, recommends, arch,
     maintainer) = read_control(filename)

    if control == '':
        return formatted_text("no control info")
    to_print = ""
    if packagename not in package_relations:
        package_relations[packagename] = {}
    for key in control_keys:
        if key == 'Source':
            field_value = escape_if_needed(control.find(key))
            if use_html:
                field_value = '<a href="https://tracker.debian.org/pkg/{0}" rel="nofollow">{0}</a>'.format(
                    field_value)
        elif key == 'Pre-Depends':
            field_value = create_depends_string(suite, predepends, session)
            package_relations[packagename][key] = field_value
        elif key == 'Depends':
            field_value = create_depends_string(suite, depends, session)
            package_relations[packagename][key] = field_value
        elif key == 'Recommends':
            field_value = create_depends_string(suite, recommends, session)
            package_relations[packagename][key] = field_value
        elif key == 'Section':
            field_value = section
        elif key == 'Architecture':
            field_value = arch
        elif key == 'Maintainer':
            field_value = maintainer
        elif key in ('Homepage', 'Vcs-Browser'):
            field_value = escape_if_needed(control.find(key))
            if use_html:
                field_value = '<a href="%s" rel="nofollow">%s</a>' % \
                    (field_value, field_value)
        elif key == 'Description':
            if use_html:
                field_value = formatted_text(control.find(key), strip=True)
            else:
                desc = control.find(key)
                desc = re_newlinespace.sub('\n ', desc)
                field_value = escape_if_needed(desc)
        else:
            field_value = escape_if_needed(control.find(key))
        to_print += " " + format_field(key, field_value) + '\n'
    return to_print