Why not just `strstr(a.packages.package_name_convention, "$(name)-$(version)")` ?
Anything matching this shall have RPM's problems with name-* when version is *, after all.