import yaml


def load_ppa_config(config_file='ppa.yaml'):
    """Loads a ppa config and returns the list of ppas and packages that
    are requested.
    """
    with open(config_file, 'r') as conf:
        conf = yaml.safe_load(conf)
    ppas = set(
        pkg['ppa'] for pkg in conf
    ) - {'default'}
    packages = set(pkg for pkgs in conf for pkg in pkgs['packages'])
    return {
        'ppas': sorted(ppas),
        'packages': sorted(packages),
    }