Imported Upstream version 0.7.14
[platform/upstream/libsolv.git] / ext / repo_susetags.c
index 52d5e5e..dc60aa4 100644 (file)
 #endif
 #include "repodata_diskusage.h"
 
+#ifdef _WIN32
+#include "strfncs.h"
+#endif
+
 struct datashare {
   Id name;
   Id evr;
@@ -333,7 +337,16 @@ lookup_shared_id(Repodata *data, Id p, Id keyname, Id voidid, int uninternalized
        return r;
     }
   if (uninternalized)
-    return repodata_lookup_id_uninternalized(data, p, keyname, voidid);
+    {
+      KeyValue kv;
+      Repokey *key = repodata_lookup_kv_uninternalized(data, p, keyname, &kv);
+      if (!key)
+        return 0;
+      if (key->type == REPOKEY_TYPE_VOID)
+       return voidid;
+      if (key->type == REPOKEY_TYPE_ID)
+       return kv.id;
+    }
   return 0;
 }
 
@@ -1062,6 +1075,23 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
 
   solv_free(joinhash);
   repodata_free_dircache(data);
+
+    if ((flags & REPO_EXTEND_SOLVABLES) != 0)
+    {    
+      /* is this a filelist extension? */
+      if (repodata_has_keyname(data, SOLVABLE_FILELIST))
+        repodata_set_filelisttype(data, REPODATA_FILELIST_EXTENSION);
+    }    
+  else 
+    {    
+      /* is this a primary with a filtered filelist? */
+      if (data->end > data->start)
+       {
+          repodata_set_filelisttype(data, REPODATA_FILELIST_FILTERED);
+         repodata_set_void(data, SOLVID_META, REPOSITORY_FILTEREDFILELIST);
+       }
+    }  
+
   if (!(flags & REPO_NO_INTERNALIZE))
     repodata_internalize(data);