Author: matz Date: Wed Aug 13 15:26:29 2008 New Revision: 10836 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10836&view=rev Log: Support searching in filelists via the dataiterator. Under control of an extra flag, because this is fairly costly. Intended for user-controled queries, _not_ to be used by the solver or the like. Modified: trunk/sat-solver/src/repo.h trunk/sat-solver/src/repodata.c trunk/sat-solver/tools/dumpsolv.c Modified: trunk/sat-solver/src/repo.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repo.h?rev=10836&r1=10835&r2=10836&view=diff ============================================================================== --- trunk/sat-solver/src/repo.h (original) +++ trunk/sat-solver/src/repo.h Wed Aug 13 15:26:29 2008 @@ -160,6 +160,12 @@ #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) Modified: trunk/sat-solver/src/repodata.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repodata.c?rev=10836&r1=10835&r2=10836&view=diff ============================================================================== --- trunk/sat-solver/src/repodata.c (original) +++ trunk/sat-solver/src/repodata.c Wed Aug 13 15:26:29 2008 @@ -767,6 +767,16 @@ 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; } Modified: trunk/sat-solver/tools/dumpsolv.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/dumpsolv.c?rev=10836&r1=10835&r2=10836&view=diff ============================================================================== --- trunk/sat-solver/tools/dumpsolv.c (original) +++ trunk/sat-solver/tools/dumpsolv.c Wed Aug 13 15:26:29 2008 @@ -321,7 +321,7 @@ #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)) { -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org