diff options
author | Michael Schroeder <mls@suse.de> | 2013-06-21 16:11:24 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2013-06-21 16:11:24 +0200 |
commit | c7bb8a3a9e92ab756e163cbb9759bdf212f0318b (patch) | |
tree | 570f9378e48aeb3c61ec15ee2e39cd719dee5c4c /src | |
parent | 413e4481d18479a9f94651d2b63eacc492f84067 (diff) | |
download | libsolv-c7bb8a3a9e92ab756e163cbb9759bdf212f0318b.tar.gz libsolv-c7bb8a3a9e92ab756e163cbb9759bdf212f0318b.tar.bz2 libsolv-c7bb8a3a9e92ab756e163cbb9759bdf212f0318b.zip |
add another workaround so that the filtered filelist gets omitted when the complete file list is requested
Diffstat (limited to 'src')
-rw-r--r-- | src/repodata.c | 55 |
1 files changed, 50 insertions, 5 deletions
diff --git a/src/repodata.c b/src/repodata.c index 031147f..6a5d84b 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -1381,6 +1381,25 @@ dataiterator_find_keyname(Dataiterator *di, Id keyname) return dp; } +static inline int +is_filelist_extension(Repodata *data) +{ + int j; + if (!repodata_precheck_keyname(data, SOLVABLE_FILELIST)) + return 0; + for (j = 1; j < data->nkeys; j++) + if (data->keys[j].name == SOLVABLE_FILELIST) + break; + if (j == data->nkeys) + return 0; + if (data->state != REPODATA_AVAILABLE) + return 1; + for (j = 1; j < data->nkeys; j++) + if (data->keys[j].name != REPOSITORY_SOLVABLES && data->keys[j].name != SOLVABLE_FILELIST) + return 0; + return 1; +} + static int dataiterator_filelistcheck(Dataiterator *di) { @@ -1392,14 +1411,40 @@ dataiterator_filelistcheck(Dataiterator *di) if (!di->matcher.match || ((di->matcher.flags & (SEARCH_STRINGMASK|SEARCH_NOCASE)) != SEARCH_STRING && (di->matcher.flags & (SEARCH_STRINGMASK|SEARCH_NOCASE)) != SEARCH_GLOB) - || !repodata_filelistfilter_matches(di->data, di->matcher.match)) + || !repodata_filelistfilter_matches(data, di->matcher.match)) needcomplete = 1; if (data->state != REPODATA_AVAILABLE) return needcomplete ? 1 : 0; - for (j = 1; j < data->nkeys; j++) - if (data->keys[j].name != REPOSITORY_SOLVABLES && data->keys[j].name != SOLVABLE_FILELIST) - break; - return j == data->nkeys && !needcomplete ? 0 : 1; + if (!needcomplete) + { + /* we don't need the complete filelist, so ignore all stubs */ + for (j = 1; j < data->nkeys; j++) + if (data->keys[j].name != REPOSITORY_SOLVABLES && data->keys[j].name != SOLVABLE_FILELIST) + return 1; + return 0; + } + else + { + /* we need the complete filelist. check if we habe a filtered filelist and there's + * a extension with the complete filelist later on */ + for (j = 1; j < data->nkeys; j++) + if (data->keys[j].name == SOLVABLE_FILELIST) + break; + if (j == data->nkeys) + return 0; /* does not have filelist */ + for (j = 1; j < data->nkeys; j++) + if (data->keys[j].name != REPOSITORY_SOLVABLES && data->keys[j].name != SOLVABLE_FILELIST) + break; + if (j == data->nkeys) + return 1; /* this is the externsion */ + while (data - data->repo->repodata + 1 < data->repo->nrepodata) + { + data++; + if (is_filelist_extension(data)) + return 0; + } + return 1; + } } int |