'Searches for what provides a given file.
:param name: File path.'

def provides(self, name):

    p_cmd = ((self.base_command + '    what-provides    ') + name)
    list_provides = []
    try:
        p_output = utils.system_output(p_cmd).split('\n')[4:]
        for line in p_output:
            line = [a.strip() for a in line.split('|')]
            try:
                pname = line[1]
                if (pname not in list_provides):
                    list_provides.append(pname)
            except IndexError:
                pass
        if (len(list_provides) > 1):
            logging.warning('More    than    one    package    found,    opting    by    the    first    queue    result')
        if list_provides:
            logging.info('Package    %s    provides    %s', list_provides[0], name)
            return list_provides[0]
        return None
    except error.CmdError:
        return None
