Dependencies: check devel lib is installed before running "rpm -qf"

factor out rpmquery