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

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 salt.utils.path.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.files.fopen(f) as fhr:
                if update.rsplit('-', 1)[0] in salt.utils.stringutils.to_unicode(fhr.read()):
                    ret.append(update)

    return ret