BPackageManager: Add SetDebugLevel()

Sets the debug level of the solver.
This commit is contained in:
Ingo Weinhold 2014-10-26 00:11:36 +02:00
parent 74b582a4e5
commit d228f29f6e
2 changed files with 17 additions and 0 deletions

View File

@ -75,6 +75,9 @@ public:
void Init(uint32 flags);
void SetDebugLevel(int32 level);
// 0 - 10 (passed to libsolv)
BSolver* Solver() const
{ return fSolver; }
@ -155,6 +158,7 @@ private:
bool _NextSpecificInstallationLocation();
protected:
int32 fDebugLevel;
BPackageInstallationLocation fLocation;
BSolver* fSolver;
InstalledRepository* fSystemRepository;

View File

@ -51,6 +51,7 @@ BPackageManager::BPackageManager(BPackageInstallationLocation location,
InstallationInterface* installationInterface,
UserInteractionHandler* userInteractionHandler)
:
fDebugLevel(0),
fLocation(location),
fSolver(NULL),
fSystemRepository(new (std::nothrow) InstalledRepository("system",
@ -92,6 +93,8 @@ BPackageManager::Init(uint32 flags)
throw std::bad_alloc();
}
fSolver->SetDebugLevel(fDebugLevel);
BRepositoryBuilder(*fLocalRepository).AddToSolver(fSolver, false);
// add installation location repositories
@ -130,6 +133,16 @@ BPackageManager::Init(uint32 flags)
}
void
BPackageManager::SetDebugLevel(int32 level)
{
fDebugLevel = level;
if (fSolver != NULL)
fSolver->SetDebugLevel(fDebugLevel);
}
void
BPackageManager::Install(const char* const* packages, int packageCount)
{