From d393ec97508f3c22780ed0f2fcecce3c016aa1e4 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Sun, 27 Apr 2008 18:32:40 +0000 Subject: [PATCH] I promised this to Jano; skipping kinds in matcher when a flag is specified. --- src/repo.h | 1 + src/repodata.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/repo.h b/src/repo.h index 5eebed5..f56d7ad 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 803154c..910bfe8 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: -- 2.7.4