def METHOD_NAME(copying, srcdir, config, name):
    """Add licenses based on the hash of the copying file."""
    try:
        data = get_contents(copying)
    except FileNotFoundError:
        # LICENSE file is a bad symlink (qemu-4.2.0!)
        return
    if data.startswith(b'#!'):
        # Not a license if this is a script
        return
    data = decode_license(data)
    if not data:
        return
    hash_sum = get_sha1sum(copying)
    if config.license_fetch:
        values = {'hash': hash_sum, 'text': data, 'package': name}
        data = urllib.parse.urlencode(values)
        data = data.encode('utf-8')
        buffer = download.do_curl(config.license_fetch, post=data, is_fatal=True)
        response = buffer.getvalue()
        page = response.decode('utf-8').strip()
        if page:
            print("License     : ", page, " (server) (", hash_sum, ")")
            process_licenses(page, config.license_translations, config.license_blacklist)
            if page != "none":
                # Strip the build source directory off the front
                lic_path = copying[len(srcdir):]
                # Strip any leading slashes
                while lic_path.startswith('/'):
                    lic_path = lic_path[1:]
                lic_path = shlex.quote(lic_path)
                license_files.append(lic_path)
                hashes[lic_path] = hash_sum
            return
    if hash_sum in config.license_hashes:
        add_license(config.license_hashes[hash_sum],
                    config.license_translations,
                    config.license_blacklist)
    else:
        if not config.license_show:
            return
        print_warning("Unknown license {0} with hash {1}".format(copying, hash_sum))
        hash_url = config.license_show % {'HASH': hash_sum}
        print_warning("Visit {0} to enter".format(hash_url))