Use new ensure_pkg_installed() in build_repo()
Fix regression from [9309e5e1dc] with pkg_cache_data()