static void add_installed_packages(Repo *repo, Repodata *repoData, BPackageInstallationLocation location) { BPackageRoster roster; BPackageInfoSet packageInfos; if (roster.GetActivePackages(location, packageInfos) == B_OK) { BRepositoryCache::Iterator it = packageInfos.GetIterator(); while (const BPackageInfo *packageInfo = it.Next()) add_package_info_to_repo(repo, repoData, *packageInfo); } }
status_t BSolverRepository::AddPackages(BPackageInstallationLocation location) { BPackageRoster roster; BPackageInfoSet packageInfos; status_t error = roster.GetActivePackages(location, packageInfos); if (error != B_OK) return error; BRepositoryCache::Iterator it = packageInfos.GetIterator(); while (const BPackageInfo* packageInfo = it.Next()) { error = AddPackage(*packageInfo); if (error != B_OK) return error; } return B_OK; }