From: Michael Schroeder Date: Fri, 18 Nov 2016 12:52:12 +0000 (+0100) Subject: solv: add autopattern right after the repo has been read X-Git-Tag: 0.6.25~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b44ad4c84b41f19b93bdd6e4238722fcd2b893a3;p=thirdparty%2Flibsolv.git solv: add autopattern right after the repo has been read Otherwise we get holes and other nasty things. --- diff --git a/examples/solv/repoinfo.c b/examples/solv/repoinfo.c index e08d160d..91f7c289 100644 --- a/examples/solv/repoinfo.c +++ b/examples/solv/repoinfo.c @@ -10,6 +10,10 @@ #if defined(ENABLE_DEBIAN) && defined(DEBIAN) #include "repo_deb.h" #endif +#ifdef SUSE +#include "repo_autopattern.h" +#endif + #include "repoinfo.h" #include "repoinfo_cache.h" @@ -109,6 +113,9 @@ read_installed_repo(struct repoinfo *cinfo, Pool *pool) #endif #if defined(ENABLE_DEBIAN) && defined(DEBIAN) r = read_installed_debian(cinfo); +#endif +#ifdef SUSE + repo_add_autopattern(cinfo->repo, 0); #endif pool_set_installed(pool, cinfo->repo); return r; @@ -235,6 +242,9 @@ read_repos(Pool *pool, struct repoinfo *repoinfos, int nrepoinfos) if ((!cinfo->autorefresh || cinfo->metadata_expire) && usecachedrepo(cinfo, 0, 0)) { +#ifdef SUSE + repo_add_autopattern(cinfo->repo, 0); +#endif printf("repo '%s':", cinfo->alias); printf(" cached\n"); continue; @@ -268,6 +278,10 @@ read_repos(Pool *pool, struct repoinfo *repoinfos, int nrepoinfos) cinfo->repo = 0; break; } +#ifdef SUSE + if (cinfo->repo) + repo_add_autopattern(cinfo->repo, 0); +#endif } if (sigpool) pool_free(sigpool); diff --git a/examples/solv/solv.c b/examples/solv/solv.c index 814f7e17..33011267 100644 --- a/examples/solv/solv.c +++ b/examples/solv/solv.c @@ -114,17 +114,6 @@ nscallback(Pool *pool, void *data, Id name, Id evr) } #endif -#ifdef SUSE -static void -add_autopackages(Pool *pool) -{ - int i; - Repo *repo; - FOR_REPOS(i, repo) - repo_add_autopattern(repo, 0); -} -#endif - #ifdef SUSE static void showdiskusagechanges(Transaction *trans) @@ -500,15 +489,17 @@ main(int argc, char **argv) commandlinepkgs[i] = p; } if (commandlinerepo) - repo_internalize(commandlinerepo); + { + repo_internalize(commandlinerepo); +#ifdef SUSE + repo_add_autopattern(commandlinerepo, 0); +#endif + } } #if defined(ENABLE_RPMDB) if (pool->disttype == DISTTYPE_RPM) addfileprovides(pool); -#endif -#ifdef SUSE - add_autopackages(pool); #endif pool_createwhatprovides(pool);