From: Michael Matz Date: Sun, 27 Apr 2008 18:32:40 +0000 (+0000) Subject: I promised this to Jano; skipping kinds in matcher when a flag is specified. X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~380 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d393ec97508f3c22780ed0f2fcecce3c016aa1e4;p=thirdparty%2Flibsolv.git I promised this to Jano; skipping kinds in matcher when a flag is specified. --- diff --git a/src/repo.h b/src/repo.h index 5eebed5d..f56d7add 100644 --- a/src/repo.h +++ b/src/repo.h @@ -157,6 +157,7 @@ typedef struct _KeyValue { #define SEARCH_NO_STORAGE_SOLVABLE (1<<9) #define SEARCH_EXTRA (1<<10) #define SEARCH_ALL_REPOS (1<<11) +#define SEARCH_SKIP_KIND (1<<12) /* Internal */ #define __SEARCH_ONESOLVABLE (1 << 31) diff --git a/src/repodata.c b/src/repodata.c index 803154cc..910bfe84 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -770,6 +770,15 @@ dataiterator_match_int_real(Dataiterator *di, int flags, const void *vmatch) default: return 0; } + /* Maybe skip the kind specifier. Do this only for SOLVABLE attributes, + for the others we can't know if a colon separates a kind or not. */ + if ((flags & SEARCH_SKIP_KIND) + && di->key->storage == KEY_STORAGE_SOLVABLE) + { + const char *s = strchr(kv->str, ':'); + if (s) + kv->str = s + 1; + } switch ((flags & SEARCH_STRINGMASK)) { case SEARCH_SUBSTRING: