move pkg_compare_name to pkg_vec and remove qsort in hash_get