Write get_package_names more simply.