def list_downloads():
    '''
    Return a list of all updates that have been downloaded locally.

    :return: A list of updates that have been downloaded
    :rtype: list

    CLI Example:

    .. code-block:: bash

       salt '*' softwareupdate.list_downloads
    '''
    outfiles = []
    for root, subFolder, files in os.walk('/Library/Updates'):
        for f in files:
            outfiles.append(os.path.join(root, f))

    dist_files = []
    for f in outfiles:
        if f.endswith('.dist'):
            dist_files.append(f)

    ret = []
    for update in _get_available():
        for f in dist_files:
            with salt.utils.fopen(f) as fhr:
                if update.rsplit('-', 1)[0] in fhr.read():
                    ret.append(update)

    return ret
dataset/ETHPy150Open saltstack/salt/salt/modules/mac_softwareupdate.py/list_downloads/original