Skip to content

Commit

Permalink
move SolvReadInstalledRpms() to OpenHandle()
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverkurth committed Oct 31, 2022
1 parent 58f1396 commit ffe6e36
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
9 changes: 7 additions & 2 deletions client/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,15 @@ TDNFOpenHandle(
dwError = SolvInitSack(
&pSack,
pTdnf->pConf->pszCacheDir,
pTdnf->pArgs->pszInstallRoot,
pArgs->nAllDeps);
pTdnf->pArgs->pszInstallRoot);
BAIL_ON_TDNF_ERROR(dwError);

if(!pArgs->nAllDeps)
{
dwError = SolvReadInstalledRpms(pSack->pPool->installed, pszCacheDir);
BAIL_ON_TDNF_LIBSOLV_ERROR(dwError);
}

dwError = TDNFLoadRepoData(
pTdnf,
REPOLISTFILTER_ALL,
Expand Down
6 changes: 2 additions & 4 deletions solv/prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,8 @@ uint32_t
SolvInitSack(
PSolvSack *ppSack,
const char* pszCacheDir,
const char* pszRootDir,
int nInstallAllDeps
);

const char* pszRootDir
);

// tdnfquery.c
uint32_t
Expand Down
11 changes: 1 addition & 10 deletions solv/tdnfpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ uint32_t
SolvInitSack(
PSolvSack *ppSack,
const char* pszCacheDir,
const char* pszRootDir,
int nInstallAllDeps
const char* pszRootDir
)
{
uint32_t dwError = 0;
Expand Down Expand Up @@ -122,15 +121,7 @@ SolvInitSack(
dwError = ERROR_TDNF_INVALID_PARAMETER;
BAIL_ON_TDNF_LIBSOLV_ERROR(dwError);
}

if(!nInstallAllDeps)
{
dwError = SolvReadInstalledRpms(pRepo, pszCacheDir);
BAIL_ON_TDNF_LIBSOLV_ERROR(dwError);
}

pool_set_installed(pPool, pRepo);
pool_createwhatprovides(pPool);

pSack->pPool = pPool;
*ppSack = pSack;
Expand Down

0 comments on commit ffe6e36

Please sign in to comment.