pkgman: RepositoryBuilder: add BRepositoryCache c'tor

This commit is contained in:
Ingo Weinhold
2013-07-04 19:06:57 +02:00
parent 383cd08d72
commit 17d00ecd27
2 changed files with 18 additions and 0 deletions
+15
View File
@@ -13,6 +13,7 @@
#include <dirent.h>
#include <Entry.h>
#include <package/RepositoryCache.h>
#include <Path.h>
#include <AutoDeleter.h>
@@ -47,6 +48,20 @@ RepositoryBuilder::RepositoryBuilder(BSolverRepository& repository,
}
RepositoryBuilder::RepositoryBuilder(BSolverRepository& repository,
const BRepositoryCache& cache, const BString& errorName)
:
fRepository(repository),
fErrorName(errorName.IsEmpty() ? cache.Info().Name() : errorName),
fPackagePaths(NULL)
{
status_t error = fRepository.SetTo(cache);
if (error != B_OK)
DIE(error, "failed to init %s repository", fErrorName.String());
fErrorName = fRepository.Name();
}
RepositoryBuilder&
RepositoryBuilder::SetPackagePathMap(PackagePathMap* packagePaths)
{
+3
View File
@@ -33,6 +33,9 @@ public:
const BString& errorName = BString());
RepositoryBuilder(BSolverRepository& repository,
const BRepositoryConfig& config);
RepositoryBuilder(BSolverRepository& repository,
const BRepositoryCache& cache,
const BString& errorName = BString());
RepositoryBuilder& SetPackagePathMap(PackagePathMap* packagePaths);