'Return a list of packages that provide [path].
:param path: File path.'

def provides(self, path):

    try:
        command = os_dep.command('apt-file')
    except ValueError:
        self.install('apt-file')
        command = os_dep.command('apt-file')
    cache_update_cmd = (command + '    update')
    try:
        utils.system(cache_update_cmd, ignore_status=True)
    except error.CmdError:
        logging.error('Apt    file    cache    update    failed')
    fu_cmd = ((command + '    search    ') + path)
    try:
        provides = utils.system_output(fu_cmd).split('\n')
        list_provides = []
        for line in provides:
            if line:
                try:
                    line = line.split(':')
                    package = line[0].strip()
                    lpath = line[1].strip()
                    if ((lpath == path) and (package not in list_provides)):
                        list_provides.append(package)
                except IndexError:
                    pass
        if (len(list_provides) > 1):
            logging.warning('More    than    one    package    found,    opting    by    the    first    result')
        if list_provides:
            logging.info('Package    %s    provides    %s', list_provides[0], path)
            return list_provides[0]
        return None
    except error.CmdError:
        return None
