1
0
mirror of https://github.com/openSUSE/libsolv.git synced 2026-02-05 12:45:46 +01:00

support ADD_NO_AUTOPRODUCTS in repo_autopattern, use in rpmdb2solv

This commit is contained in:
Michael Schroeder
2014-01-28 13:44:56 +01:00
parent cbfff346a9
commit 56140dc8ca
3 changed files with 8 additions and 4 deletions

View File

@@ -73,6 +73,9 @@ repo_add_autopattern(Repo *repo, int flags)
queue_init(&prdq);
queue_init(&prdq2);
if (repo == pool->installed)
flags |= ADD_NO_AUTOPRODUCTS; /* no auto products for installed repos */
pattern_id = pool_str2id(pool, "pattern()", 9);
product_id = pool_str2id(pool, "product()", 9);
FOR_REPO_SOLVABLES(repo, p, s)
@@ -226,8 +229,8 @@ repo_add_autopattern(Repo *repo, int flags)
queue_free(&patq);
queue_free(&patq2);
if (repo == pool->installed)
queue_empty(&prdq2); /* no auto products for installed repos */
if ((flags & ADD_NO_AUTOPRODUCTS) != 0)
queue_empty(&prdq2);
for (i = 0; i < prdq2.count; i += 2)
{

View File

@@ -5,4 +5,6 @@
* for further information
*/
#define ADD_NO_AUTOPRODUCTS (1 << 8)
extern int repo_add_autopattern(Repo *repo, int flags);

View File

@@ -163,7 +163,6 @@ main(int argc, char **argv)
pool_set_rootdir(pool, root);
repo = repo_create(pool, "installed");
pool_set_installed(pool, repo);
data = repo_add_repodata(repo, 0);
if (!nopacks)
@@ -217,7 +216,7 @@ main(int argc, char **argv)
#ifdef SUSE
if (add_auto)
repo_add_autopattern(repo, 0);
repo_add_autopattern(repo, ADD_NO_AUTOPRODUCTS);
#endif
tool_write(repo, basefile, 0);