From ffe6e36398bfd8a98608bb098f062536421df30f Mon Sep 17 00:00:00 2001 From: Oliver Kurth Date: Fri, 7 Oct 2022 09:54:22 -0700 Subject: [PATCH] move SolvReadInstalledRpms() to OpenHandle() --- client/api.c | 9 +++++++-- solv/prototypes.h | 6 ++---- solv/tdnfpool.c | 11 +---------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/client/api.c b/client/api.c index d4c8439e..2d0cf9e1 100644 --- a/client/api.c +++ b/client/api.c @@ -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, diff --git a/solv/prototypes.h b/solv/prototypes.h index 92696ec3..1768d384 100644 --- a/solv/prototypes.h +++ b/solv/prototypes.h @@ -335,10 +335,8 @@ uint32_t SolvInitSack( PSolvSack *ppSack, const char* pszCacheDir, - const char* pszRootDir, - int nInstallAllDeps - ); - + const char* pszRootDir +); // tdnfquery.c uint32_t diff --git a/solv/tdnfpool.c b/solv/tdnfpool.c index 558db1be..bc8716ec 100644 --- a/solv/tdnfpool.c +++ b/solv/tdnfpool.c @@ -67,8 +67,7 @@ uint32_t SolvInitSack( PSolvSack *ppSack, const char* pszCacheDir, - const char* pszRootDir, - int nInstallAllDeps + const char* pszRootDir ) { uint32_t dwError = 0; @@ -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;