Imported Upstream version 0.7.12
[platform/upstream/libsolv.git] / src / repo.h
index 58704f1..b503431 100644 (file)
@@ -123,6 +123,26 @@ static inline int pool_installable(const Pool *pool, Solvable *s)
   return 1;
 }
 
+#ifdef LIBSOLV_INTERNAL
+static inline int pool_installable_whatprovides(const Pool *pool, Solvable *s)
+{
+  /* we always need the installed solvable in the whatprovides data,
+     otherwise obsoletes/conflicts on them won't work */
+  if (s->repo != pool->installed)
+    {
+      if (s->arch == ARCH_SRC || s->arch == ARCH_NOSRC || pool_badarch_solvable(pool, s))
+       return 0;
+      if (pool->considered && !pool->whatprovideswithdisabled)
+       {
+         Id id = s - pool->solvables;
+         if (!MAPTST(pool->considered, id))
+           return 0;
+       }
+    }
+  return 1;
+}
+#endif
+
 /* not in solvable.h because we need the repo definition */
 static inline Solvable *solvable_free(Solvable *s, int reuseids)
 {
@@ -169,6 +189,7 @@ int repo_lookup_void(Repo *repo, Id entry, Id keyname);
 const char *repo_lookup_checksum(Repo *repo, Id entry, Id keyname, Id *typep);
 const unsigned char *repo_lookup_bin_checksum(Repo *repo, Id entry, Id keyname, Id *typep);
 const void *repo_lookup_binary(Repo *repo, Id entry, Id keyname, int *lenp);
+unsigned int repo_lookup_count(Repo *repo, Id entry, Id keyname);      /* internal */
 Id solv_depmarker(Id keyname, Id marker);
 
 void repo_set_id(Repo *repo, Id p, Id keyname, Id id);