Factored-out getPkgVersions()