static inline int pool_badarch_solvable(const Pool *pool, Solvable *s)
{
- if (!s->arch)
- return 1;
- if (pool->id2arch && pool_arch2score(pool, s->arch) == 0)
+ if (pool->id2arch && (!s->arch || pool_arch2score(pool, s->arch) == 0))
return 1;
return 0;
}
static inline int pool_installable(const Pool *pool, Solvable *s)
{
- if (!s->arch || s->arch == ARCH_SRC || s->arch == ARCH_NOSRC)
+ if (s->arch == ARCH_SRC || s->arch == ARCH_NOSRC)
return 0;
if (s->repo && s->repo->disabled)
return 0;
- if (pool->id2arch && pool_arch2score(pool, s->arch) == 0)
+ if (pool->id2arch && (!s->arch || pool_arch2score(pool, s->arch) == 0))
return 0;
if (pool->considered)
{
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)
+{
+ if (s && s->repo)
+ repo_free_solvable(s->repo, s - s->repo->pool->solvables, reuseids);
+ return 0;
+}
+
/* search callback values */
#define SEARCH_NEXT_KEY 1
#define SEARCH_NEXT_SOLVABLE 2
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);