From: Klaus Kaempf Date: Tue, 12 Aug 2008 12:38:59 +0000 (+0000) Subject: rpm_add_rpmdb is called from bindings, create own repodata in this case. X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffabecf4b1986efe2aefbe005a982181bc40e1d5;p=thirdparty%2Flibsolv.git rpm_add_rpmdb is called from bindings, create own repodata in this case. --- diff --git a/tools/repo_rpmdb.c b/tools/repo_rpmdb.c index bbc15cb2..aeb23e5a 100644 --- a/tools/repo_rpmdb.c +++ b/tools/repo_rpmdb.c @@ -1207,7 +1207,8 @@ repo_add_rpmdb(Repo *repo, Repodata *repodata, Repo *ref, const char *rootdir) DBT dbkey; DBT dbdata; struct stat packagesstat; - + int repodata_self = 0; + memset(&dbkey, 0, sizeof(dbkey)); memset(&dbdata, 0, sizeof(dbdata)); @@ -1217,6 +1218,12 @@ repo_add_rpmdb(Repo *repo, Repodata *repodata, Repo *ref, const char *rootdir) if (!rootdir) rootdir = ""; + if (!repodata) + { + repodata = repo_add_repodata(repo, 0); + repodata_self = 1; + } + if (ref && !(ref->nsolvables && ref->rpmdbid)) ref = 0; @@ -1523,6 +1530,8 @@ repo_add_rpmdb(Repo *repo, Repodata *repodata, Repo *ref, const char *rootdir) sat_free(rpmids); } } + if (repodata && repodata_self) + repodata_internalize(repodata); if (rpmhead) sat_free(rpmhead); if (db)