#define SEARCH_ALL_REPOS (1<<11)
#define SEARCH_SKIP_KIND (1<<12)
+/* By default we don't match in attributes representing filelists
+ because the construction of those strings is costly. Specify this
+ flag if you want this. In that case kv->str will contain the full
+ filename (if matched of course). */
+#define SEARCH_FILES (1<<13)
+
/* Internal */
#define __SEARCH_ONESOLVABLE (1 << 31)
break;
case REPOKEY_TYPE_STR:
break;
+ case REPOKEY_TYPE_DIRSTRARRAY:
+ if (!(flags & SEARCH_FILES))
+ return 0;
+ /* Put the full filename into kv->str. */
+ kv->str = repodata_dir2str(di->data, kv->id, kv->str);
+ /* And to compensate for that put the "empty" directory into
+ kv->id, so that later calls to repodata_dir2str on this data
+ come up with the same filename again. */
+ kv->id = 0;
+ break;
default:
return 0;
}
#if 0
printf ("\nSearchresults:\n");
Dataiterator di;
- dataiterator_init(&di, pool->repos[0], 0, 0, "3", SEARCH_EXTRA | SEARCH_SUBSTRING | SEARCH_ALL_REPOS);
+ dataiterator_init(&di, pool->repos[0], 0, 0, "3", SEARCH_EXTRA | SEARCH_SUBSTRING | SEARCH_ALL_REPOS | SEARCH_FILES);
//int count = 0;
while (dataiterator_step(&di))
{