#include "evr.h"
#include "poolarch.h"
#include "repo_solv.h"
+#ifdef ENABLE_SUSEREPO
#include "repo_susetags.h"
+#endif
+#ifdef ENABLE_RPMMD
#include "repo_updateinfoxml.h"
#include "repo_rpmmd.h"
+#endif
#include "solver.h"
#include "solverdebug.h"
-#include "sat_xfopen.h"
+#include "solv_xfopen.h"
void
showproblems(Solver *solv, Solvable *s, Queue *cand, Queue *badguys)
}
break;
case SOLVER_RULE_JOB:
+ case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
+ case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
+ case SOLVER_RULE_JOB_UNSUPPORTED:
break;
case SOLVER_RULE_RPM:
printf(" some dependency problem\n");
queue_init(&job);
- now = sat_timems(0);
+ now = solv_timems(0);
solver_runs = 0;
conp = s->repo->idarraydata + s->conflicts;
}
if (PERF_DEBUGGING)
- printf(" test_all_packages_installable took %d ms in %d runs\n", sat_timems(now), solver_runs);
+ printf(" test_all_packages_installable took %d ms in %d runs\n", solv_timems(now), solver_runs);
}
void
queue_init(&cand);
queue_init(&badguys);
- now = sat_timems(0);
+ now = solv_timems(0);
solver_runs = 0;
/* Test 3: can we upgrade all packages? */
cand.count = j;
}
if (PERF_DEBUGGING)
- printf(" test_can_upgrade_all_packages took %d ms in %d runs\n", sat_timems(now), solver_runs);
+ printf(" test_can_upgrade_all_packages took %d ms in %d runs\n", solv_timems(now), solver_runs);
}
void
{
char *arch, *mypatch;
const char *pname;
- int l;
+ int l, r;
FILE *fp;
int i;
Id pid, p, pp;
int tests = 0;
context_t c;
+ static const char* langs[] = {"en"};
c.install_available = 0;
c.updatestart = 0;
arch = argv[1];
pool = pool_create();
pool_setarch(pool, arch);
- static const char* langs[] = {"en"};
pool_set_languages(pool, langs, 1);
#if 0
l = strlen(argv[i]);
if (!strcmp(argv[i], "-"))
fp = stdin;
- else if ((fp = sat_xfopen(argv[i], 0)) == 0)
+ else if ((fp = solv_xfopen(argv[i], 0)) == 0)
{
perror(argv[i]);
exit(1);
}
- if (l >= 8 && !strcmp(argv[i] + l - 8, "packages"))
+ r = 0;
+ if (0)
+ {
+ }
+#ifdef ENABLE_SUSEREPO
+ else if (l >= 8 && !strcmp(argv[i] + l - 8, "packages"))
{
- repo_add_susetags(c.repo, fp, 0, 0, 0);
+ r = repo_add_susetags(c.repo, fp, 0, 0, 0);
}
else if (l >= 11 && !strcmp(argv[i] + l - 11, "packages.gz"))
{
- repo_add_susetags(c.repo, fp, 0, 0, 0);
+ r = repo_add_susetags(c.repo, fp, 0, 0, 0);
}
+#endif
+#ifdef ENABLE_RPMMD
else if (l >= 14 && !strcmp(argv[i] + l - 14, "primary.xml.gz"))
{
- repo_add_rpmmd(c.repo, fp, 0, 0);
+ r = repo_add_rpmmd(c.repo, fp, 0, 0);
}
else if (l >= 17 && !strcmp(argv[i] + l - 17, "updateinfo.xml.gz"))
{
- repo_add_updateinfoxml(c.repo, fp, 0);
+ r = repo_add_updateinfoxml(c.repo, fp, 0);
}
- else if (repo_add_solv(c.repo, fp))
+#endif
+ else
+ r = repo_add_solv(c.repo, fp, 0);
+ if (r)
{
- fprintf(stderr, "could not add repo %s\n", argv[i]);
+ fprintf(stderr, "could not add repo %s: %s\n", argv[i], pool_errstr(pool));
exit(1);
}
if (fp != stdin)
c.instrepo->start = c.repo->start;
c.instrepo->end = c.repo->end;
c.instrepo->nsolvables = c.repo->nsolvables; /* sic! */
- c.instrepo->lastoff = c.repo->lastoff; /* sic! */
pool_set_installed(pool, c.instrepo);
pool_createwhatprovides(pool);
for (pid = 1; pid < pool->nsolvables; pid++)
{
+ Solvable *s;
c.shown = 0;
- Solvable *s = pool->solvables + pid;
+ s = pool->solvables + pid;
if (!s->repo)
continue;
if (!pool_installable(pool, s))