Example #1
0
def add_package_prefix(package, count):
    for filename, uris in helpers.get_package_uris(package).iteritems():
        for uri in uris:
            if not uri or "://" not in uri:
                continue
            if uri in count:
                count[uri].update([package])
            else:
                count[uri] = set([package])
Example #2
0
def check_package(package):
    bad_uris = []

    for filename, uris in helpers.get_package_uris(package).iteritems():
        for uri in uris:
            ret = check_uri(package, uri)
            if ret and ret not in bad_uris:
                bad_uris.append(ret)

    if _generate_diff and bad_uris:
        generate_diff(package, bad_uris)
Example #3
0
def upstream_remote_id_package(package):
    if not package.ebuild_path():
        return

    package._remoteids = set()
    package._remoteids_found = set()
    package._remoteids_new = set()
    package._remoteids_bad = set()

    for upstream in package.metadata.upstream():
        for remote_id, remote_type in upstream.upstream_remoteids():
            package._remoteids.add((remote_type, remote_id))

    for filename, uris in helpers.get_package_uris(package).iteritems():
        for uri in uris:
            uri_rules(package, uri)

    for homepage in package.environment("HOMEPAGE").split():
        uri_rules(package, homepage)

    to_check = set()
    if _options.check:
        to_check = to_check.union(package._remoteids.difference(package._remoteids_found))
    if _options.check_all:
        to_check = to_check.union(package._remoteids)
        to_check = to_check.union(package._remoteids_found)

    for remote_type, remote_id in to_check:
        if remote_type in CHECK_REMOTE_ID:
            if not CHECK_REMOTE_ID[remote_type](package, remote_id):
                bad_remote_id(package, remote_id, remote_type)
                if (remote_type, remote_id) in package._remoteids_found:
                    sys.stderr.write(pp.error("Generated bad tag for %s: %s %s" % (package, remote_type, remote_id)))

    if _options.diff:
        output_diff(package)