Ejemplo n.º 1
0
def get_pseudo_package_list():
    """
    Existing pseudo packages for Debian are obtained from
    `BTS <https://bugs.debian.org/pseudo-packages.maintainers>`_
    """
    PSEUDO_PACKAGE_LIST_URL = (
        'https://bugs.debian.org/pseudo-packages.maintainers'
    )
    cache = HttpCache(settings.DISTRO_TRACKER_CACHE_DIRECTORY)
    if not cache.is_expired(PSEUDO_PACKAGE_LIST_URL):
        return
    response, updated = cache.update(PSEUDO_PACKAGE_LIST_URL)

    try:
        response.raise_for_status()
    except requests.exceptions.HTTPError:
        raise PluginProcessingError()

    if not updated:
        return

    return [
        line.split(None, 1)[0]
        for line in response.text.splitlines()
    ]