"solvable:filemarker",
"namespace:installed",
"namespace:modalias",
+ "system:system",
"src",
"nosrc",
"noarch"
{
int count, totalsize = 0;
Pool *pool;
+ Solvable *s;
pool = (Pool *)xcalloc(1, sizeof(*pool));
pool->nrels = 1;
// pre-alloc space for a Solvable
- pool->solvables = (Solvable *)xcalloc(1, sizeof(Solvable));
- pool->nsolvables = 1;
-
+ pool->solvables = (Solvable *)xcalloc(2, sizeof(Solvable));
+ pool->nsolvables = 2;
+ s = pool->solvables + SYSTEMSOLVABLE;
+ s->name = SYSTEM_SYSTEM;
+ s->arch = ARCH_NOARCH;
+ s->evr = ID_EMPTY;
return pool;
}
pool_shrink_whatprovides(pool);
}
+
/******************************************************************************/
/*
}
+/******************************************************************************/
+
/*
* addrangedep
*
queuepushunique(&plist, p);
break;
case REL_NAMESPACE:
-#if 0
- /* unknown namespace, just pass through */
- pp = GET_PROVIDESP(evr, p);
- while ((p = *pp++) != 0)
- queuepush(&plist, p);
-#endif
+ if (pool->nscallback)
+ {
+ p = pool->nscallback(pool, pool->nscallbackdata, name, evr);
+ if (p > 1)
+ {
+ queuefree(&plist);
+ pool->whatprovides[d] = p;
+ return pool->whatprovidesdata + p;
+ }
+ if (p == 1)
+ queuepush(&plist, SYSTEMSOLVABLE);
+ }
break;
default:
break;
continue; /* no rel match */
queuepush(&plist, p);
}
+ /* make our system solvable provide all unknown rpmlib() stuff */
+ if (plist.count == 0 && !strncmp(id2str(pool, name), "rpmlib(", 7))
+ queuepush(&plist, SYSTEMSOLVABLE);
}
/* add providers to whatprovides */
#if 0
#define SOLVABLE_FILEMARKER 16 // normal provides before this, generated file provides after this
#define NAMESPACE_INSTALLED 17
#define NAMESPACE_MODALIAS 18
-#define ARCH_SRC 19
-#define ARCH_NOSRC 20
-#define ARCH_NOARCH 21
+#define SYSTEM_SYSTEM 19
+#define ARCH_SRC 20
+#define ARCH_NOSRC 21
+#define ARCH_NOARCH 22
+
+/* well known solvable */
+#define SYSTEMSOLVABLE 1
//-----------------------------------------------
Id *whatprovidesdata; /* Ids of solvable providing Id */
Offset whatprovidesdataoff; /* next free slot within whatprovidesdata */
int whatprovidesdataleft; /* number of 'free slots' within whatprovidesdata */
+
+ Id (*nscallback)(struct _Pool *, void *data, Id name, Id evr);
+ void *nscallbackdata;
};
#define TYPE_ID 1
dp = GET_PROVIDESP(req, p); /* get providers of req */
- if (!*dp /* dont care if noone provides rpmlib() */
- && !strncmp(id2str(pool, req), "rpmlib(", 7))
- {
- continue;
- }
-
if (dontfix) /* dont care about breakage */
{
/* the strategy here is to not insist on dependencies
n = solv->decisionq.elements[i];
if (n < 0)
continue;
+ if (n == SYSTEMSOLVABLE)
+ continue;
if (n >= solv->system->start && n < solv->system->start + solv->system->nsolvables)
continue;
s = pool->solvables + n;
p = solv->decisionq.elements[i];
if (p < 0)
continue;
+ if (p == SYSTEMSOLVABLE)
+ continue;
if (p >= solv->system->start && p < solv->system->start + solv->system->nsolvables)
continue;
s = pool->solvables + p;
queueinit(&q);
/*
+ * always install our system solvable
+ */
+ MAPSET(&addedmap, SYSTEMSOLVABLE);
+ queuepush(&solv->decisionq, SYSTEMSOLVABLE);
+ queuepush(&solv->decisionq_why, 0);
+ solv->decisionmap[SYSTEMSOLVABLE] = 1;
+
+ /*
* create rules for installed solvables -> keep them installed
* so called: rpm rules
*