I promised this to Jano; skipping kinds in matcher when a flag is specified.
authorMichael Matz <matz@suse.de>
Sun, 27 Apr 2008 18:32:40 +0000 (18:32 +0000)
committerMichael Matz <matz@suse.de>
Sun, 27 Apr 2008 18:32:40 +0000 (18:32 +0000)
src/repo.h
src/repodata.c

index 5eebed5dc94e3c74b1673d77dfe4a5141d5f5a5a..f56d7add73352bd65250881d7eafb4b0b15530a9 100644 (file)
@@ -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)
index 803154ccf375034a0179662cc716b367da34952e..910bfe84cc9e092b06f162aad807a6033606d1fa 100644 (file)
@@ -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: