def file_dict(*packages):
    errors = []
    ret = {}
    cmd = ['pacman', '-Ql']

    if len(packages) > 0 and os.path.exists(packages[0]):
        packages = list(packages)
        cmd.extend(('-r', packages.pop(0)))

    cmd.extend(packages)

    out = __salt__['cmd.run'](cmd, output_loglevel='trace', python_shell=False)
    for line in salt.utils.itertools.split(out, '\n'):
        if line.startswith('error'):
            errors.append(line)
        else:
            comps = line.split()
            if not comps[0] in ret:
                ret[comps[0]] = []
            ret[comps[0]].append((' '.join(comps[1:])))
    return {'errors': errors, 'packages': ret}
List the files that belong to a package, grouped by package. Not
dataset/ETHPy150Open saltstack/salt/salt/modules/pacman.py/file_dict