def get_package_link(config, pkg, os_name, os_code_name, os_arch):
    """
    Get an informational link about a package.

    This function uses the package_dashboards configuration to attempt to create
    a URL to an information page regarding a package. If it is unsuccessful, the
    URL to the package itself is returned.

    :param config: the parsed YAML configuration.
    :param pkg: the parsed package entry.
    :param os_name: the name of the OS associated with the package.
    :param os_code_name: the OS version associated with the package.
    :param os_arch: the system architecture associated with the package.

    :returns: a URL to a dashboard or package file.
    """
    for dashboard in config.get('package_dashboards', ()):
        match = dashboard['pattern'].match(pkg.url)
        if match:
            return match.expand(dashboard['url']).format_map({
                'binary_name': pkg.binary_name,
                'name': pkg.name,
                'os_arch': os_arch,
                'os_code_name': os_code_name,
                'os_name': os_name,
                'source_name': pkg.source_name,
                'url': pkg.url,
                'version': pkg.version,
            })

    # No configured dashboard - fall back to package URL
    return pkg.url