qpkg -f /path/to/file *sometimes* gives the following error: /usr/bin/qpkg: line 1: /bin/ls: Argument list too long Strangely other times it gives the correct answer to the same file! While trying to track down the problem found lot of `ls' invocations in qpkg, like `ls .../*/CONTENTS'. These can lead to the error, question is why it somtimes works? Maybe there are "too much" packages on the system, `qpkg -I | wc -l' gives 2454. But the system should manage this situation anyway.
quoted from `qpkg -h`: [quote] NOTICE: This tool will be phased out at some point in the future, please use equery instead. Bugs are still fixed but new features won't be added. [/quote] You might want to try `equery belongs /path/to/file`
this tool is deprecated