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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -5,4 +5,6 @@
|
||||
* for further information
|
||||
*/
|
||||
|
||||
#define ADD_NO_AUTOPRODUCTS (1 << 8)
|
||||
|
||||
extern int repo_add_autopattern(Repo *repo, int flags);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user