make install DESTDIR=$RPM_BUILD_ROOT
#rm -f %{buildroot}%{_libdir}/libsatsolver.la
-%post -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+#%post -p /sbin/ldconfig
+#%postun -p /sbin/ldconfig
%clean
rm -rf "$RPM_BUILD_ROOT"
-%files
-%defattr(-,root,root)
+#%files
+#%defattr(-,root,root)
%files devel
%defattr(-,root,root)
xfree(pool->stringspace);
xfree(pool->strings);
xfree(pool->rels);
+ for (i = 0; i < DEP2STRBUF; i++)
+ xfree(pool->dep2strbuf[i]);
xfree(pool);
}
/* well known solvable */
#define SYSTEMSOLVABLE 1
+
+/* how many strings to maintain (round robin) */
+#define DEP2STRBUF 16
+
+
//-----------------------------------------------
struct _Pool {
Id (*nscallback)(struct _Pool *, void *data, Id name, Id evr);
void *nscallbackdata;
+
+ /* our dep2str string space */
+ char *dep2strbuf[DEP2STRBUF];
+ int dep2strlen[DEP2STRBUF];
+ int dep2strn;
};
#define TYPE_ID 1
char *s1, *s2;
int n, l, ls1, ls2, lsr;
- static char *dep2strbuf[DEP2STRBUF];
- static int dep2strlen[DEP2STRBUF];
- static int dep2strn;
-
if (!ISRELDEP(id))
return pool->stringspace + pool->strings[id];
rd = GETRELDEP(pool, id);
- n = dep2strn;
+ n = pool->dep2strn;
sr = id2rel(pool, id);
lsr = strlen(sr);
s2 = (char *)dep2str(pool, rd->evr);
- dep2strn = n;
+ pool->dep2strn = n;
ls2 = strlen(s2);
s1 = (char *)dep2str(pool, rd->name);
- dep2strn = n;
+ pool->dep2strn = n;
ls1 = strlen(s1);
if (rd->flags == REL_NAMESPACE)
}
l = ls1 + ls2 + lsr;
- if (l + 1 > dep2strlen[n])
+ if (l + 1 > pool->dep2strlen[n])
{
- if (s1 != dep2strbuf[n])
- dep2strbuf[n] = xrealloc(dep2strbuf[n], l + 32);
+ if (s1 != pool->dep2strbuf[n])
+ pool->dep2strbuf[n] = xrealloc(pool->dep2strbuf[n], l + 32);
else
{
- dep2strbuf[n] = xrealloc(dep2strbuf[n], l + 32);
- s1 = dep2strbuf[n];
+ pool->dep2strbuf[n] = xrealloc(pool->dep2strbuf[n], l + 32);
+ s1 = pool->dep2strbuf[n];
}
- dep2strlen[n] = l + 32;
+ pool->dep2strlen[n] = l + 32;
}
- if (s1 != dep2strbuf[n])
+ if (s1 != pool->dep2strbuf[n])
{
- strcpy(dep2strbuf[n], s1);
- s1 = dep2strbuf[n];
+ strcpy(pool->dep2strbuf[n], s1);
+ s1 = pool->dep2strbuf[n];
}
strcpy(s1 + ls1, sr);
- dep2strbuf[n] = s1 + ls1 + lsr;
+ pool->dep2strbuf[n] = s1 + ls1 + lsr;
s2 = (char *)dep2str(pool, rd->evr);
- if (s2 != dep2strbuf[n])
- strcpy(dep2strbuf[n], s2);
- dep2strbuf[n] = s1;
+ if (s2 != pool->dep2strbuf[n])
+ strcpy(pool->dep2strbuf[n], s2);
+ pool->dep2strbuf[n] = s1;
if (rd->flags == REL_NAMESPACE)
{
s1[ls1 + ls2 + lsr - 1] = ')';
s1[ls1 + ls2 + lsr] = 0;
}
- dep2strn = (n + 1) % DEP2STRBUF;
+ pool->dep2strn = (n + 1) % DEP2STRBUF;
return s1;
}
solv->rules = (Rule *)xrealloc(solv->rules, ((solv->nrules + RULES_BLOCK) & ~RULES_BLOCK) * sizeof(Rule));
solv->nrules = j;
#if 1
- {
- int binr = 0;
- int dc = 0;
- Id *dp;
- Rule *r;
+ if (solv->pool->verbose)
+ {
+ int binr = 0;
+ int lits = 0;
+ Id *dp;
+ Rule *r;
- for (i = 1; i < solv->nrules; i++)
- {
- r = solv->rules + i;
- if (r->d == 0) /* assertion */
- {
+ for (i = 1; i < solv->nrules; i++)
+ {
+ r = solv->rules + i;
+ if (r->d == 0)
binr++;
- continue;
- }
- dp = solv->pool->whatprovidesdata + r->d;
- while (*dp++)
- dc++;
- }
- if (solv->pool->verbose)
- {
- printf(" binary: %d\n", binr);
- printf(" normal: %d\n", solv->nrules - 1 - binr);
- printf(" normal lits: %d\n", dc);
- }
- }
+ else
+ {
+ dp = solv->pool->whatprovidesdata + r->d;
+ while (*dp++)
+ lits++;
+ }
+ }
+ printf(" binary: %d\n", binr);
+ printf(" normal: %d, %d literals\n", solv->nrules - 1 - binr, lits);
+ }
#endif
}
if (!solv->jobrules)
{
/* this is a rpm rule assertion, we do not have to allocate it */
- /* it can be identified by a level of 1 and a zero reason */
+ /* it can be identified by a level of 1 and a zero reason */
+ /* we must not drop those rules from the decisionq when rewinding! */
if (p > 0)
abort();
if (solv->decisionmap[-p] > 0 || solv->decisionmap[-p] < -1)
if (req == SOLVABLE_PREREQMARKER) /* skip the marker */
continue;
- dp = GET_PROVIDESP(req, p); /* get providers of req */
+ dp = GET_PROVIDESP(req, p); /* get providers of req */
- if (dontfix) /* dont care about breakage */
+ if (*dp == SYSTEMSOLVABLE) /* always installed */
+ continue;
+
+ if (dontfix)
{
/* the strategy here is to not insist on dependencies
* that are already broken. so if we find one provider
for (i = 0; dp[i]; i++) /* for all providers */
{
if (dp[i] >= system->start && dp[i] < system->start + system->nsolvables)
- break; /* provider is installed */
+ break; /* provider was installed */
}
- if (!dp[i]) /* previously broken dependency */
+ if (!dp[i]) /* previously broken dependency */
{
if (pool->verbose) printf("ignoring broken requires %s of system package %s-%s.%s\n", dep2str(pool, req), id2str(pool, s->name), id2str(pool, s->evr), id2str(pool, s->arch));
continue;
continue;
}
- if (*dp == SYSTEMSOLVABLE) /* always installed */
- continue;
#if 0
printf("addrule %s-%s.%s %s %d %d\n", id2str(pool, s->name), id2str(pool, s->evr), id2str(pool, s->arch), dep2str(pool, req), -n, dp - pool->whatprovidesdata);
for (i = 0; dp[i]; i++)