summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2011-05-24 16:39:51 +0200
committerMichael Schroeder <mls@suse.de>2011-05-24 16:39:51 +0200
commite2a47f38496014e671b9e9ca7b6f0db1839af78d (patch)
tree67feaf6207435aecc8c65e24d0b72243fa0295a3
parent4cd5d62a01ff1b50c26507a9f27a7df18febacc4 (diff)
downloadlibsolv-e2a47f38496014e671b9e9ca7b6f0db1839af78d.tar.gz
libsolv-e2a47f38496014e671b9e9ca7b6f0db1839af78d.tar.bz2
libsolv-e2a47f38496014e671b9e9ca7b6f0db1839af78d.zip
- do not use obsolete interface in libsolv library itself
-rw-r--r--Makefile.cvs30
-rw-r--r--examples/solv.c64
-rw-r--r--ext/pool_fileconflicts.c8
-rw-r--r--ext/repo_content.c32
-rw-r--r--ext/repo_deb.c20
-rw-r--r--ext/repo_deltainfoxml.c18
-rw-r--r--ext/repo_helix.c40
-rw-r--r--ext/repo_products.c10
-rw-r--r--ext/repo_releasefile_products.c6
-rw-r--r--ext/repo_rpmdb.c58
-rw-r--r--ext/repo_rpmmd.c40
-rw-r--r--ext/repo_susetags.c54
-rw-r--r--ext/repo_updateinfoxml.c18
-rw-r--r--ext/repo_write.c14
-rw-r--r--ext/repo_zyppdb.c8
-rw-r--r--ext/tools_util.h4
-rw-r--r--src/evr.c20
-rw-r--r--src/evr.h2
-rw-r--r--src/policy.c12
-rw-r--r--src/pool.c30
-rw-r--r--src/pool.h2
-rw-r--r--src/poolarch.c4
-rw-r--r--src/poolid.c6
-rw-r--r--src/poolid.h2
-rw-r--r--src/poolvendor.c2
-rw-r--r--src/repo.c80
-rw-r--r--src/repo_solv.c18
-rw-r--r--src/repodata.c24
-rw-r--r--src/rules.c34
-rw-r--r--src/solvable.c16
-rw-r--r--src/solver.c42
-rw-r--r--src/solver.h6
-rw-r--r--src/solverdebug.c196
-rw-r--r--src/transaction.c70
-rw-r--r--tools/common_write.c12
-rw-r--r--tools/dumpsolv.c22
-rw-r--r--tools/findfileconflicts.c2
-rw-r--r--tools/installcheck.c60
-rw-r--r--tools/patchcheck.c88
-rw-r--r--tools/repomdxml2solv.c6
-rw-r--r--tools/susetags2solv.c2
41 files changed, 580 insertions, 602 deletions
diff --git a/Makefile.cvs b/Makefile.cvs
deleted file mode 100644
index 3dfffe4..0000000
--- a/Makefile.cvs
+++ /dev/null
@@ -1,30 +0,0 @@
-# Generic Makefile.cvs for CMake-based projects:
-#
-# Create a subdirecory build/ and call cmake from there with /usr prefix.
-#
-# Intentionally using /usr rather than the default /usr/local since this is for
-# internal use, and we are the distribution makers: /usr/local is off limits
-# for us.
-#
-# Author: Stefan Hundhammer <sh@suse.de>
-
-BUILD_SUBDIR = build
-HERE_FROM_BUILD_SUBDIR = ..
-PREFIX = /usr
-CMAKE = /usr/bin/cmake
-
-all: cmake
-
-
-cmake: create-build-subdir create-toplevel-makefile
- ( cd $(BUILD_SUBDIR) && $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(PREFIX) $(HERE_FROM_BUILD_SUBDIR) )
-
-
-create-build-subdir:
- test -d $(BUILD_SUBDIR) || mkdir $(BUILD_SUBDIR)
-
-
-create-toplevel-makefile:
- echo 'all:' >Makefile
- echo -e '\t$$(MAKE) $$(MAKEFLAGS) -C $(BUILD_SUBDIR)' >>Makefile
-
diff --git a/examples/solv.c b/examples/solv.c
index 75418c0..d8e1acc 100644
--- a/examples/solv.c
+++ b/examples/solv.c
@@ -1911,7 +1911,7 @@ str2archid(Pool *pool, char *arch)
Id id;
if (!*arch)
return 0;
- id = str2id(pool, arch, 0);
+ id = pool_str2id(pool, arch, 0);
if (id == ARCH_SRC || id == ARCH_NOSRC || id == ARCH_NOARCH)
return id;
if (pool->id2arch && (id > pool->lastarch || !pool->id2arch[id]))
@@ -1928,7 +1928,7 @@ int
depglob(Pool *pool, char *name, Queue *job, int what)
{
Id p, pp;
- Id id = str2id(pool, name, 0);
+ Id id = pool_str2id(pool, name, 0);
int i, match = 0;
if (id)
@@ -1964,7 +1964,7 @@ depglob(Pool *pool, char *name, Queue *job, int what)
if (!s->repo || !pool_installable(pool, s))
continue;
id = s->name;
- if (fnmatch(name, id2str(pool, id), 0) == 0)
+ if (fnmatch(name, pool_id2str(pool, id), 0) == 0)
{
for (i = 0; i < job->count; i += 2)
if (job->elements[i] == SOLVER_SOLVABLE_NAME && job->elements[i + 1] == id)
@@ -1984,7 +1984,7 @@ depglob(Pool *pool, char *name, Queue *job, int what)
{
if (!pool->whatprovides[id])
continue;
- if (fnmatch(name, id2str(pool, id), 0) == 0)
+ if (fnmatch(name, pool_id2str(pool, id), 0) == 0)
{
if (!match && what == DEPGLOB_NAMEDEP)
printf("[using capability match for '%s']\n", name);
@@ -2015,13 +2015,13 @@ limitrelation(Pool *pool, Queue *job, int flags, Id evr)
fprintf(stderr, "limitrelation only works on name/provides jobs\n");
exit(1);
}
- job->elements[i + 1] = rel2id(pool, job->elements[i + 1], evr, flags, 1);
+ job->elements[i + 1] = pool_rel2id(pool, job->elements[i + 1], evr, flags, 1);
if (flags == REL_ARCH)
job->elements[i] |= SOLVER_SETARCH;
if (flags == REL_EQ && select == SOLVER_SOLVABLE_NAME && job->elements[i])
{
#ifndef DEBIAN
- const char *evrstr = id2str(pool, evr);
+ const char *evrstr = pool_id2str(pool, evr);
if (!strchr(evrstr, '-'))
job->elements[i] |= SOLVER_SETEV;
else
@@ -2051,11 +2051,11 @@ limitrelation_arch(Pool *pool, Queue *job, int flags, char *evr)
{
*r = 0;
limitrelation(pool, job, REL_ARCH, archid);
- limitrelation(pool, job, flags, str2id(pool, evr, 1));
+ limitrelation(pool, job, flags, pool_str2id(pool, evr, 1));
*r = '.';
}
else
- limitrelation(pool, job, flags, str2id(pool, evr, 1));
+ limitrelation(pool, job, flags, pool_str2id(pool, evr, 1));
return job->count / 2;
}
@@ -2165,7 +2165,7 @@ mkselect(Pool *pool, int mode, char *name, Queue *job)
if (depglob(pool, name, job, DEPGLOB_NAMEDEP))
{
name[nend] = oldnend;
- limitrelation(pool, job, rflags, str2id(pool, r, 1));
+ limitrelation(pool, job, rflags, pool_str2id(pool, r, 1));
return job->count / 2;
}
if ((r2 = strrchr(name, '.')) != 0 && r2[1] && (archid = str2archid(pool, r2 + 1)) != 0)
@@ -2176,7 +2176,7 @@ mkselect(Pool *pool, int mode, char *name, Queue *job)
name[nend] = oldnend;
*r2 = '.';
limitrelation(pool, job, REL_ARCH, archid);
- limitrelation(pool, job, rflags, str2id(pool, r, 1));
+ limitrelation(pool, job, rflags, pool_str2id(pool, r, 1));
return job->count / 2;
}
*r2 = '.';
@@ -2305,7 +2305,7 @@ fileconflict_cb(Pool *pool, Id p, void *cbdata)
if (!fp)
return 0;
rewind(fp);
- return rpm_byfp(fp, solvable2str(pool, s), &fcstate->rpmdbstate);
+ return rpm_byfp(fp, pool_solvable2str(pool, s), &fcstate->rpmdbstate);
}
@@ -2396,10 +2396,10 @@ nscallback(Pool *pool, void *data, Id name, Id evr)
Solvable *s = pool->solvables + evr;
Id p, pp, cap;
- cap = str2id(pool, pool_tmpjoin(pool, "product(", id2str(pool, s->name) + 8, ")"), 0);
+ cap = pool_str2id(pool, pool_tmpjoin(pool, "product(", pool_id2str(pool, s->name) + 8, ")"), 0);
if (!cap)
return 0;
- cap = rel2id(pool, cap, s->evr, REL_EQ, 0);
+ cap = pool_rel2id(pool, cap, s->evr, REL_EQ, 0);
if (!cap)
return 0;
FOR_PROVIDES(p, pp, cap)
@@ -2440,7 +2440,7 @@ addsoftlocks(Pool *pool, Queue *job)
type = SOLVER_SOLVABLE_PROVIDES;
bp += 9;
}
- id = str2id(pool, bp, 1);
+ id = pool_str2id(pool, bp, 1);
if (pool->installed)
{
FOR_JOB_SELECT(p, pp, type, id)
@@ -2710,7 +2710,7 @@ main(int argc, char **argv)
Solvable *s = pool_id2solvable(pool, p);
if (!MAPTST(&m, p))
continue;
- printf(" - %s: %s\n", solvable2str(pool, s), solvable_lookup_str(s, SOLVABLE_SUMMARY));
+ printf(" - %s: %s\n", pool_solvable2str(pool, s), solvable_lookup_str(s, SOLVABLE_SUMMARY));
}
map_free(&m);
exit(0);
@@ -2807,7 +2807,7 @@ main(int argc, char **argv)
if (mainmode == MODE_INFO)
{
const char *str;
- printf("Name: %s\n", solvable2str(pool, s));
+ printf("Name: %s\n", pool_solvable2str(pool, s));
printf("Repo: %s\n", s->repo->name);
printf("Summary: %s\n", solvable_lookup_str(s, SOLVABLE_SUMMARY));
str = solvable_lookup_str(s, SOLVABLE_URL);
@@ -2826,7 +2826,7 @@ main(int argc, char **argv)
#else
const char *sum = solvable_lookup_str_poollang(s, SOLVABLE_SUMMARY);
#endif
- printf(" - %s [%s]\n", solvable2str(pool, s), s->repo->name);
+ printf(" - %s [%s]\n", pool_solvable2str(pool, s), s->repo->name);
if (sum)
printf(" %s\n", sum);
}
@@ -2861,14 +2861,14 @@ main(int argc, char **argv)
Id p2;
s = pool->solvables + p;
- if (strncmp(id2str(pool, s->name), "patch:", 6) != 0)
+ if (strncmp(pool_id2str(pool, s->name), "patch:", 6) != 0)
continue;
FOR_PROVIDES(p2, pp, s->name)
{
Solvable *s2 = pool->solvables + p2;
if (s2->name != s->name)
continue;
- r = evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
+ r = pool_evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
if (r < 0 || (r == 0 && p > p2))
break;
}
@@ -2916,9 +2916,9 @@ main(int argc, char **argv)
queue_push2(&job, SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_REPO, repofilter);
// multiversion test
- // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, str2id(pool, "kernel-pae", 1));
- // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, str2id(pool, "kernel-pae-base", 1));
- // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, str2id(pool, "kernel-pae-extra", 1));
+ // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, pool_str2id(pool, "kernel-pae", 1));
+ // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, pool_str2id(pool, "kernel-pae-base", 1));
+ // queue_push2(&job, SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME, pool_str2id(pool, "kernel-pae-extra", 1));
#ifdef SOFTLOCKS_PATH
addsoftlocks(pool, &job);
@@ -3105,7 +3105,7 @@ rerunsolver:
if (pool->installed && pool->installed->nsolvables)
{
/* try a delta first */
- char *matchname = strdup(id2str(pool, s->name));
+ char *matchname = strdup(pool_id2str(pool, s->name));
dataiterator_init(&di, pool, s->repo, SOLVID_META, DELTA_PACKAGE_NAME, matchname, SEARCH_STRING);
dataiterator_prepend_keyname(&di, REPOSITORY_DELTAINFO);
while (dataiterator_step(&di))
@@ -3141,7 +3141,7 @@ rerunsolver:
seq = pool_tmpjoin(pool, seqname, "-", seqevr);
seq = pool_tmpappend(pool, seq, "-", seqnum);
#ifdef FEDORA
- sprintf(cmd, "/usr/bin/applydeltarpm -a %s -c -s ", id2str(pool, s->arch));
+ sprintf(cmd, "/usr/bin/applydeltarpm -a %s -c -s ", pool_id2str(pool, s->arch));
#else
sprintf(cmd, "/usr/bin/applydeltarpm -c -s ");
#endif
@@ -3161,7 +3161,7 @@ rerunsolver:
/* got it, now reconstruct */
newfd = opentmpfile();
#ifdef FEDORA
- sprintf(cmd, "applydeltarpm -a %s /dev/fd/%d /dev/fd/%d", id2str(pool, s->arch), fileno(fp), newfd);
+ sprintf(cmd, "applydeltarpm -a %s /dev/fd/%d /dev/fd/%d", pool_id2str(pool, s->arch), fileno(fp), newfd);
#else
sprintf(cmd, "applydeltarpm /dev/fd/%d /dev/fd/%d", fileno(fp), newfd);
#endif
@@ -3231,7 +3231,7 @@ rerunsolver:
{
printf("\n");
for (i = 0; i < conflicts.count; i += 5)
- printf("file %s of package %s conflicts with package %s\n", id2str(pool, conflicts.elements[i]), solvid2str(pool, conflicts.elements[i + 1]), solvid2str(pool, conflicts.elements[i + 3]));
+ printf("file %s of package %s conflicts with package %s\n", pool_id2str(pool, conflicts.elements[i]), pool_solvid2str(pool, conflicts.elements[i + 1]), pool_solvid2str(pool, conflicts.elements[i + 3]));
printf("\n");
if (yesno("Re-run solver (y/n/q)? "))
{
@@ -3266,26 +3266,26 @@ rerunsolver:
switch(type)
{
case SOLVER_TRANSACTION_ERASE:
- printf("erase %s\n", solvid2str(pool, p));
+ printf("erase %s\n", pool_solvid2str(pool, p));
#ifndef DEBIAN
if (!s->repo->rpmdbid || !s->repo->rpmdbid[p - s->repo->start])
continue;
/* strip epoch from evr */
- evr = evrp = id2str(pool, s->evr);
+ evr = evrp = pool_id2str(pool, s->evr);
while (*evrp >= '0' && *evrp <= '9')
evrp++;
if (evrp > evr && evrp[0] == ':' && evrp[1])
evr = evrp + 1;
- nvra = pool_tmpjoin(pool, id2str(pool, s->name), "-", evr);
- nvra = pool_tmpappend(pool, nvra, ".", id2str(pool, s->arch));
+ nvra = pool_tmpjoin(pool, pool_id2str(pool, s->name), "-", evr);
+ nvra = pool_tmpappend(pool, nvra, ".", pool_id2str(pool, s->arch));
runrpm("-e", nvra, -1); /* too bad that --querybynumber doesn't work */
#else
- rundpkg("--remove", id2str(pool, s->name), 0);
+ rundpkg("--remove", pool_id2str(pool, s->name), 0);
#endif
break;
case SOLVER_TRANSACTION_INSTALL:
case SOLVER_TRANSACTION_MULTIINSTALL:
- printf("install %s\n", solvid2str(pool, p));
+ printf("install %s\n", pool_solvid2str(pool, p));
for (j = 0; j < newpkgs; j++)
if (checkq.elements[j] == p)
break;
diff --git a/ext/pool_fileconflicts.c b/ext/pool_fileconflicts.c
index 0e91e9b..c36e967 100644
--- a/ext/pool_fileconflicts.c
+++ b/ext/pool_fileconflicts.c
@@ -249,7 +249,7 @@ static int conflicts_cmp(const void *ap, const void *bp, void *dp)
const Id *a = ap;
const Id *b = bp;
if (a[0] != b[0])
- return strcmp(id2str(pool, a[0]), id2str(pool, b[0]));
+ return strcmp(pool_id2str(pool, a[0]), pool_id2str(pool, b[0]));
if (a[1] != b[1])
return a[1] - b[1];
if (a[3] != b[3])
@@ -411,11 +411,11 @@ pool_findfileconflicts(Pool *pool, Queue *pkgs, int cutoff, Queue *conflicts, vo
continue; /* md5 sum matches */
if (pool->obsoleteusescolors && fsi[33] && fsj[33] && (fsi[33] & fsj[33]) == 0)
continue; /* colors do not conflict */
- queue_push(conflicts, str2id(pool, (char *)cbdata.filesspace + cbdata.files.elements[ii] + 34, 1));
+ queue_push(conflicts, pool_str2id(pool, (char *)cbdata.filesspace + cbdata.files.elements[ii] + 34, 1));
queue_push(conflicts, p);
- queue_push(conflicts, str2id(pool, (char *)cbdata.filesspace + cbdata.files.elements[ii], 1));
+ queue_push(conflicts, pool_str2id(pool, (char *)cbdata.filesspace + cbdata.files.elements[ii], 1));
queue_push(conflicts, q);
- queue_push(conflicts, str2id(pool, (char *)cbdata.filesspace + cbdata.files.elements[jj], 1));
+ queue_push(conflicts, pool_str2id(pool, (char *)cbdata.filesspace + cbdata.files.elements[jj], 1));
}
}
}
diff --git a/ext/repo_content.c b/ext/repo_content.c
index eadab6e..29279cb 100644
--- a/ext/repo_content.c
+++ b/ext/repo_content.c
@@ -132,7 +132,7 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
dependencies sometimes. */
if (!strncmp (name, "package:", 8))
name += 8;
- id = str2id(pool, name, 1);
+ id = pool_str2id(pool, name, 1);
if (*line == '<' || *line == '>' || *line == '=') /* rel follows */
{
char *rel = splitword(&line);
@@ -152,7 +152,7 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
pool_debug(pool, SAT_FATAL, "repo_content: unknown relation '%s'\n", rel);
continue;
}
- id = rel2id(pool, id, str2id(pool, evr, 1), flags + 1, 1);
+ id = pool_rel2id(pool, id, pool_str2id(pool, evr, 1), flags + 1, 1);
}
olddeps = repo_addid_dep(pd->repo, olddeps, id, marker);
}
@@ -318,7 +318,7 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
else
repodata_set_poolstr(data, SOLVID_META, SUSETAGS_DEFAULTVENDOR, value);
if (s)
- s->vendor = str2id(pool, value, 1);
+ s->vendor = pool_str2id(pool, value, 1);
defvendor = strdup(value);
continue;
}
@@ -364,7 +364,7 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
{
/* this solvable was created without seeing a
PRODUCT entry, just set the name and continue */
- s->name = str2id(pool, join(&pd, "product", ":", value), 1);
+ s->name = pool_str2id(pool, join(&pd, "product", ":", value), 1);
continue;
}
if (s)
@@ -375,7 +375,7 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
if (!s->evr)
s->evr = ID_EMPTY;
if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
if (code10)
s->supplements = repo_fix_supplements(repo, s->provides, s->supplements, 0);
}
@@ -383,13 +383,13 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
s = pool_id2solvable(pool, repo_add_solvable(repo));
repodata_extend(data, s - pool->solvables);
handle = s - pool->solvables;
- s->name = str2id(pool, join(&pd, "product", ":", value), 1);
+ s->name = pool_str2id(pool, join(&pd, "product", ":", value), 1);
if (datadir)
repodata_set_str(data, s - pool->solvables, SUSETAGS_DATADIR, datadir);
if (descrdir)
repodata_set_str(data, s - pool->solvables, SUSETAGS_DESCRDIR, descrdir);
if (defvendor)
- s->vendor = str2id(pool, defvendor, 1);
+ s->vendor = pool_str2id(pool, defvendor, 1);
continue;
}
@@ -409,13 +409,13 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
else if (code11 && istag ("DISTRIBUTION"))
repodata_set_str(data, s - pool->solvables, SOLVABLE_DISTRIBUTION, value);
else if (istag ("UPDATEURLS"))
- add_multiple_urls(data, handle, value, str2id(pool, "update", 1));
+ add_multiple_urls(data, handle, value, pool_str2id(pool, "update", 1));
else if (istag ("EXTRAURLS"))
- add_multiple_urls(data, handle, value, str2id(pool, "extra", 1));
+ add_multiple_urls(data, handle, value, pool_str2id(pool, "extra", 1));
else if (istag ("OPTIONALURLS"))
- add_multiple_urls(data, handle, value, str2id(pool, "optional", 1));
+ add_multiple_urls(data, handle, value, pool_str2id(pool, "optional", 1));
else if (istag ("RELNOTESURL"))
- add_multiple_urls(data, handle, value, str2id(pool, "releasenotes", 1));
+ add_multiple_urls(data, handle, value, pool_str2id(pool, "releasenotes", 1));
else if (istag ("SHORTLABEL"))
repodata_set_str(data, s - pool->solvables, PRODUCT_SHORTLABEL, value);
else if (istag ("LABEL")) /* LABEL is the products SUMMARY. */
@@ -425,18 +425,18 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
else if (istag ("FLAGS"))
add_multiple_strings(data, handle, PRODUCT_FLAGS, value);
else if (istag ("VENDOR")) /* actually already handled above */
- s->vendor = str2id(pool, value, 1);
+ s->vendor = pool_str2id(pool, value, 1);
else if (istag ("BASEARCHS"))
{
char *arch;
if ((arch = splitword(&value)) != 0)
{
- s->arch = str2id(pool, arch, 1);
+ s->arch = pool_str2id(pool, arch, 1);
while ((arch = splitword(&value)) != 0)
{
otherarchs = sat_extend(otherarchs, numotherarchs, 1, sizeof(Id), 7);
- otherarchs[numotherarchs++] = str2id(pool, arch, 1);
+ otherarchs[numotherarchs++] = pool_str2id(pool, arch, 1);
}
}
}
@@ -515,7 +515,7 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
if (!s->evr)
s->evr = ID_EMPTY;
if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
if (code10)
s->supplements = repo_fix_supplements(repo, s->provides, s->supplements, 0);
@@ -531,7 +531,7 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
/* self provides */
if (s->name && p->arch != ARCH_SRC && p->arch != ARCH_NOSRC)
- p->provides = repo_addid_dep(repo, p->provides, rel2id(pool, p->name, p->evr, REL_EQ, 1), 0);
+ p->provides = repo_addid_dep(repo, p->provides, pool_rel2id(pool, p->name, p->evr, REL_EQ, 1), 0);
/* now merge the attributes */
repodata_merge_attrs(data, p - pool->solvables, s - pool->solvables);
diff --git a/ext/repo_deb.c b/ext/repo_deb.c
index d2d31e3..d299f9a 100644
--- a/ext/repo_deb.c
+++ b/ext/repo_deb.c
@@ -121,17 +121,17 @@ parseonedep(Pool *pool, char *p)
while (*p == ' ' || *p == '\t' || *p == '\n')
p++;
}
- name = strn2id(pool, n, ne - n, 1);
+ name = pool_strn2id(pool, n, ne - n, 1);
if (e)
{
- evr = strn2id(pool, e, ee - e, 1);
- name = rel2id(pool, name, evr, flags, 1);
+ evr = pool_strn2id(pool, e, ee - e, 1);
+ name = pool_rel2id(pool, name, evr, flags, 1);
}
if (*p == '|')
{
Id id = parseonedep(pool, p + 1);
if (id)
- name = rel2id(pool, name, id, REL_OR, 1);
+ name = pool_rel2id(pool, name, id, REL_OR, 1);
}
return name;
}
@@ -212,7 +212,7 @@ control2solvable(Solvable *s, Repodata *data, char *control)
{
case 'A' << 8 | 'R':
if (!strcasecmp(tag, "architecture"))
- s->arch = str2id(pool, q, 1);
+ s->arch = pool_str2id(pool, q, 1);
break;
case 'B' << 8 | 'R':
if (!strcasecmp(tag, "breaks"))
@@ -263,7 +263,7 @@ control2solvable(Solvable *s, Repodata *data, char *control)
break;
case 'P' << 8 | 'A':
if (!strcasecmp(tag, "package"))
- s->name = str2id(pool, q, 1);
+ s->name = pool_str2id(pool, q, 1);
break;
case 'P' << 8 | 'R':
if (!strcasecmp(tag, "pre-depends"))
@@ -298,10 +298,10 @@ control2solvable(Solvable *s, Repodata *data, char *control)
*q2 = 0;
break;
}
- if (s->name && !strcmp(q, id2str(pool, s->name)))
+ if (s->name && !strcmp(q, pool_id2str(pool, s->name)))
repodata_set_void(data, s - pool->solvables, SOLVABLE_SOURCENAME);
else
- repodata_set_id(data, s - pool->solvables, SOLVABLE_SOURCENAME, str2id(pool, q, 1));
+ repodata_set_id(data, s - pool->solvables, SOLVABLE_SOURCENAME, pool_str2id(pool, q, 1));
havesource = 1;
}
break;
@@ -311,7 +311,7 @@ control2solvable(Solvable *s, Repodata *data, char *control)
break;
case 'V' << 8 | 'E':
if (!strcasecmp(tag, "version"))
- s->evr = str2id(pool, q, 1);
+ s->evr = pool_str2id(pool, q, 1);
break;
}
}
@@ -322,7 +322,7 @@ control2solvable(Solvable *s, Repodata *data, char *control)
if (!s->evr)
s->evr = ID_EMPTY;
if (s->name)
- s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
if (s->name && !havesource)
repodata_set_void(data, s - pool->solvables, SOLVABLE_SOURCENAME);
if (s->obsoletes)
diff --git a/ext/repo_deltainfoxml.c b/ext/repo_deltainfoxml.c
index 222d398..2758928 100644
--- a/ext/repo_deltainfoxml.c
+++ b/ext/repo_deltainfoxml.c
@@ -211,7 +211,7 @@ makeevr_atts(Pool *pool, struct parsedata *pd, const char **atts)
#if 0
fprintf(stderr, "evr: %s\n", pd->content);
#endif
- return str2id(pool, pd->content, 1);
+ return pool_str2id(pool, pd->content, 1);
}
static void parse_delta_location( struct parsedata *pd,
@@ -232,7 +232,7 @@ static void parse_delta_location( struct parsedata *pd,
s1 = strrchr (s, '/');
if (s1)
{
- pd->delta.locdir = strn2id(pool, s, s1 - s, 1);
+ pd->delta.locdir = pool_strn2id(pool, s, s1 - s, 1);
s = s1 + 1;
}
/* Guess suffix. */
@@ -253,7 +253,7 @@ static void parse_delta_location( struct parsedata *pd,
}
if (*s1 == '.')
*s1++ = 0;
- pd->delta.locsuffix = str2id(pool, s1, 1);
+ pd->delta.locsuffix = pool_str2id(pool, s1, 1);
}
/* Last '-'. */
s1 = strrchr (s, '-');
@@ -269,9 +269,9 @@ static void parse_delta_location( struct parsedata *pd,
if (s2 > s && *s2 == '-')
{
*s2++ = 0;
- pd->delta.locevr = str2id(pool, s2, 1);
+ pd->delta.locevr = pool_str2id(pool, s2, 1);
}
- pd->delta.locname = str2id(pool, s, 1);
+ pd->delta.locname = pool_str2id(pool, s, 1);
free(real_str);
}
}
@@ -320,12 +320,12 @@ startElement(void *userData, const char *name, const char **atts)
case STATE_NEWPACKAGE:
if ((str = find_attr("name", atts)) != 0)
{
- pd->newpkgname = str2id(pool, str, 1);
+ pd->newpkgname = pool_str2id(pool, str, 1);
}
pd->newpkgevr = makeevr_atts(pool, pd, atts);
if ((str = find_attr("arch", atts)) != 0)
{
- pd->newpkgarch = str2id(pool, str, 1);
+ pd->newpkgarch = pool_str2id(pool, str, 1);
}
break;
@@ -503,8 +503,8 @@ endElement(void *userData, const char *name)
break;
if (*s2 == '-')
{
- pd->delta.seqevr = strn2id(pool, s2 + 1, s1 - s2 - 1, 1);
- pd->delta.seqname = strn2id(pool, str, s2 - str, 1);
+ pd->delta.seqevr = pool_strn2id(pool, s2 + 1, s1 - s2 - 1, 1);
+ pd->delta.seqname = pool_strn2id(pool, str, s2 - str, 1);
str = s1 + 1;
}
}
diff --git a/ext/repo_helix.c b/ext/repo_helix.c
index 94a286c..d5255f9 100644
--- a/ext/repo_helix.c
+++ b/ext/repo_helix.c
@@ -235,7 +235,7 @@ evr2id(Pool *pool, Parsedata *pd, const char *e, const char *v, const char *r)
fprintf(stderr, "evr: %s\n", pd->content);
#endif
// intern and create
- return str2id(pool, pd->content, 1);
+ return pool_str2id(pool, pd->content, 1);
}
@@ -338,11 +338,11 @@ adddep(Pool *pool, Parsedata *pd, unsigned int olddeps, const char **atts, Id ma
pd->acontent = l + 256;
}
sprintf(pd->content, "%s:%s", k, n);
- name = str2id(pool, pd->content, 1);
+ name = pool_str2id(pool, pd->content, 1);
}
else
{
- name = str2id(pool, n, 1); /* package: just intern <name> */
+ name = pool_str2id(pool, n, 1); /* package: just intern <name> */
}
if (f) /* operator ? */
@@ -360,7 +360,7 @@ adddep(Pool *pool, Parsedata *pd, unsigned int olddeps, const char **atts, Id ma
if (flags > 7)
flags = 0;
/* intern rel */
- id = rel2id(pool, name, evr, flags, 1);
+ id = pool_rel2id(pool, name, evr, flags, 1);
}
else
id = name; /* no operator */
@@ -546,7 +546,7 @@ static const char *findKernelFlavor(Parsedata *pd, Solvable *s)
if (!ISRELDEP(pid))
continue; /* wrong provides name */
prd = GETRELDEP(pool, pid);
- depname = id2str(pool, prd->name);
+ depname = pool_id2str(pool, prd->name);
if (!strncmp(depname, "kernel-", 7))
return depname + 7;
}
@@ -561,12 +561,12 @@ static const char *findKernelFlavor(Parsedata *pd, Solvable *s)
if (!ISRELDEP(pid))
{
- depname = id2str(pool, pid);
+ depname = pool_id2str(pool, pid);
}
else
{
Reldep *prd = GETRELDEP(pool, pid);
- depname = id2str(pool, prd->name);
+ depname = pool_id2str(pool, prd->name);
}
if (!strncmp(depname, "kernel-", 7))
return depname + 7;
@@ -620,7 +620,7 @@ endElement(void *userData, const char *name)
pd->release ? pd->evrspace + pd->release : 0);
/* ensure self-provides */
if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(pd->repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
s->supplements = repo_fix_supplements(pd->repo, s->provides, s->supplements, pd->freshens);
s->conflicts = repo_fix_conflicts(pd->repo, s->conflicts);
pd->freshens = 0;
@@ -647,11 +647,11 @@ endElement(void *userData, const char *name)
if (ISRELDEP(pid))
{
prd = GETRELDEP(pool, pid);
- depname = id2str(pool, prd->name);
+ depname = pool_id2str(pool, prd->name);
}
else
{
- depname = id2str(pool, pid);
+ depname = pool_id2str(pool, pid);
}
@@ -659,9 +659,9 @@ endElement(void *userData, const char *name)
{
char newdep[100];
snprintf(newdep, sizeof(newdep), "kernel(%s:%s", cflavor, depname + 7);
- pid = str2id(pool, newdep, 1);
+ pid = pool_str2id(pool, newdep, 1);
if (prd)
- pid = rel2id(pool, pid, prd->evr, prd->flags, 1);
+ pid = pool_rel2id(pool, pid, prd->evr, prd->flags, 1);
}
npr = repo_addid_dep(pd->repo, npr, pid, 0);
@@ -682,20 +682,20 @@ endElement(void *userData, const char *name)
if (ISRELDEP(pid))
{
prd = GETRELDEP(pool, pid);
- depname = id2str(pool, prd->name);
+ depname = pool_id2str(pool, prd->name);
}
else
{
- depname = id2str(pool, pid);
+ depname = pool_id2str(pool, pid);
}
if (!strncmp(depname, "kernel(", 7) && !strchr(depname, ':'))
{
char newdep[100];
snprintf(newdep, sizeof(newdep), "kernel(%s:%s", cflavor, depname + 7);
- pid = str2id(pool, newdep, 1);
+ pid = pool_str2id(pool, newdep, 1);
if (prd)
- pid = rel2id(pool, pid, prd->evr, prd->flags, 1);
+ pid = pool_rel2id(pool, pid, prd->evr, prd->flags, 1);
}
npr = repo_addid_dep(pd->repo, npr, pid, 0);
}
@@ -706,10 +706,10 @@ endElement(void *userData, const char *name)
}
break;
case STATE_NAME:
- s->name = str2id(pool, pd->content, 1);
+ s->name = pool_str2id(pool, pd->content, 1);
break;
case STATE_VENDOR:
- s->vendor = str2id(pool, pd->content, 1);
+ s->vendor = pool_str2id(pool, pd->content, 1);
break;
case STATE_BUILDTIME:
t = atoi (pd->content);
@@ -726,7 +726,7 @@ endElement(void *userData, const char *name)
pd->version = 0;
pd->release = 0;
/* use highest evr */
- if (!s->evr || evrcmp(pool, s->evr, evr, EVRCMP_MATCH_RELEASE) <= 0)
+ if (!s->evr || pool_evrcmp(pool, s->evr, evr, EVRCMP_MATCH_RELEASE) <= 0)
s->evr = evr;
break;
case STATE_EPOCH:
@@ -752,7 +752,7 @@ endElement(void *userData, const char *name)
break;
case STATE_ARCH:
case STATE_PARCH:
- s->arch = str2id(pool, pd->content, 1);
+ s->arch = pool_str2id(pool, pd->content, 1);
break;
default:
break;
diff --git a/ext/repo_products.c b/ext/repo_products.c
index 56e2733..62e4f9d 100644
--- a/ext/repo_products.c
+++ b/ext/repo_products.c
@@ -298,14 +298,14 @@ endElement(void *userData, const char *name)
if (!s->evr)
s->evr = ID_EMPTY;
if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pd->pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(pd->repo, s->provides, pool_rel2id(pd->pool, s->name, s->evr, REL_EQ, 1), 0);
pd->solvable = 0;
break;
case STATE_VENDOR:
- s->vendor = str2id(pd->pool, pd->content, 1);
+ s->vendor = pool_str2id(pd->pool, pd->content, 1);
break;
case STATE_NAME:
- s->name = str2id(pd->pool, join2("product", ":", pd->content), 1);
+ s->name = pool_str2id(pd->pool, join2("product", ":", pd->content), 1);
break;
case STATE_VERSION:
pd->tmpvers = strdup(pd->content);
@@ -314,7 +314,7 @@ endElement(void *userData, const char *name)
pd->tmprel = strdup(pd->content);
break;
case STATE_ARCH:
- s->arch = str2id(pd->pool, pd->content, 1);
+ s->arch = pool_str2id(pd->pool, pd->content, 1);
break;
case STATE_PRODUCTLINE:
repodata_set_str(pd->data, pd->handle, PRODUCT_PRODUCTLINE, pd->content);
@@ -337,7 +337,7 @@ endElement(void *userData, const char *name)
if (pd->tmpurltype)
{
repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL, pd->content);
- repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, str2id(pd->pool, pd->tmpurltype, 1));
+ repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, pool_str2id(pd->pool, pd->tmpurltype, 1));
}
pd->tmpurltype = sat_free((void *)pd->tmpurltype);
break;
diff --git a/ext/repo_releasefile_products.c b/ext/repo_releasefile_products.c
index d7352af..ec202a9 100644
--- a/ext/repo_releasefile_products.c
+++ b/ext/repo_releasefile_products.c
@@ -66,7 +66,7 @@ add_releasefile_product(Repo *repo, FILE *fp)
&& (*ptr1 == ' ' || isdigit(*ptr1) || *ptr1 == '.'))
--ptr1;
*(++ptr1) = 0;
- name = str2id(pool, join2("product", ":", buf), 1);
+ name = pool_str2id(pool, join2("product", ":", buf), 1);
if (ptr)
{
@@ -83,7 +83,7 @@ add_releasefile_product(Repo *repo, FILE *fp)
*ptr1 = tolower(*ptr1);
++ptr1;
}
- arch = str2id(pool, ptr, 1);
+ arch = pool_str2id(pool, ptr, 1);
}
}
}
@@ -105,7 +105,7 @@ add_releasefile_product(Repo *repo, FILE *fp)
s->evr = version ? version : ID_EMPTY;
s->arch = arch ? arch : ARCH_NOARCH;
if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
}
}
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c
index 1d17c80..c679bc1 100644
--- a/ext/repo_rpmdb.c
+++ b/ext/repo_rpmdb.c
@@ -494,15 +494,15 @@ makedeps(Pool *pool, Repo *repo, RpmHead *rpmhead, int tagn, int tagv, int tagf,
flags |= 2;
if ((f[i] & DEP_GREATER) != 0)
flags |= 1;
- name = str2id(pool, n[i], 1);
+ name = pool_str2id(pool, n[i], 1);
if (v[i][0] == '0' && v[i][1] == ':' && v[i][2])
- evr = str2id(pool, v[i] + 2, 1);
+ evr = pool_str2id(pool, v[i] + 2, 1);
else
- evr = str2id(pool, v[i], 1);
- *ida++ = rel2id(pool, name, evr, flags, 1);
+ evr = pool_str2id(pool, v[i], 1);
+ *ida++ = pool_rel2id(pool, name, evr, flags, 1);
}
else
- *ida++ = str2id(pool, n[i], 1);
+ *ida++ = pool_str2id(pool, n[i], 1);
}
*ida++ = 0;
repo->idarraysize += cc + 1;
@@ -760,7 +760,7 @@ addfileprovides(Pool *pool, Repo *repo, Repodata *data, Solvable *s, RpmHead *rp
}
strcpy(fn, dn[di[i]]);
strcat(fn, bn[i]);
- olddeps = repo_addid_dep(repo, olddeps, str2id(pool, fn, 1), SOLVABLE_FILEMARKER);
+ olddeps = repo_addid_dep(repo, olddeps, pool_str2id(pool, fn, 1), SOLVABLE_FILEMARKER);
#endif
if (data)
{
@@ -817,15 +817,15 @@ addsourcerpm(Pool *pool, Repodata *data, Id handle, char *sourcerpm, char *name,
else if (!strcmp(sarch, "nosrc.rpm"))
repodata_set_constantid(data, handle, SOLVABLE_SOURCEARCH, ARCH_NOSRC);
else
- repodata_set_constantid(data, handle, SOLVABLE_SOURCEARCH, strn2id(pool, sarch, strlen(sarch) - 4, 1));
+ repodata_set_constantid(data, handle, SOLVABLE_SOURCEARCH, pool_strn2id(pool, sarch, strlen(sarch) - 4, 1));
if (evr && !strncmp(sevr, evr, sarch - sevr - 1) && evr[sarch - sevr - 1] == 0)
repodata_set_void(data, handle, SOLVABLE_SOURCEEVR);
else
- repodata_set_id(data, handle, SOLVABLE_SOURCEEVR, strn2id(pool, sevr, sarch - sevr - 1, 1));
+ repodata_set_id(data, handle, SOLVABLE_SOURCEEVR, pool_strn2id(pool, sevr, sarch - sevr - 1, 1));
if (name && !strncmp(sourcerpm, name, sevr - sourcerpm - 1) && name[sevr - sourcerpm - 1] == 0)
repodata_set_void(data, handle, SOLVABLE_SOURCENAME);
else
- repodata_set_id(data, handle, SOLVABLE_SOURCENAME, strn2id(pool, sourcerpm, sevr - sourcerpm - 1, 1));
+ repodata_set_id(data, handle, SOLVABLE_SOURCENAME, pool_strn2id(pool, sourcerpm, sevr - sourcerpm - 1, 1));
}
static int
@@ -838,7 +838,7 @@ rpm2solv(Pool *pool, Repo *repo, Repodata *data, Solvable *s, RpmHead *rpmhead,
name = headstring(rpmhead, TAG_NAME);
if (!strcmp(name, "gpg-pubkey"))
return 0;
- s->name = str2id(pool, name, 1);
+ s->name = pool_str2id(pool, name, 1);
if (!s->name)
{
fprintf(stderr, "package has no name\n");
@@ -846,7 +846,7 @@ rpm2solv(Pool *pool, Repo *repo, Repodata *data, Solvable *s, RpmHead *rpmhead,
}
sourcerpm = headstring(rpmhead, TAG_SOURCERPM);
if (sourcerpm)
- s->arch = str2id(pool, headstring(rpmhead, TAG_ARCH), 1);
+ s->arch = pool_str2id(pool, headstring(rpmhead, TAG_ARCH), 1);
else
{
if (headexists(rpmhead, TAG_NOSOURCE) || headexists(rpmhead, TAG_NOPATCH))
@@ -857,14 +857,14 @@ rpm2solv(Pool *pool, Repo *repo, Repodata *data, Solvable *s, RpmHead *rpmhead,
if (!s->arch)
s->arch = ARCH_NOARCH;
evr = headtoevr(rpmhead);
- s->evr = str2id(pool, evr, 1);
- s->vendor = str2id(pool, headstring(rpmhead, TAG_VENDOR), 1);
+ s->evr = pool_str2id(pool, evr, 1);
+ s->vendor = pool_str2id(pool, headstring(rpmhead, TAG_VENDOR), 1);
s->provides = makedeps(pool, repo, rpmhead, TAG_PROVIDENAME, TAG_PROVIDEVERSION, TAG_PROVIDEFLAGS, 0);
if ((flags & RPM_ADD_NO_FILELIST) == 0)
s->provides = addfileprovides(pool, repo, data, s, rpmhead, s->provides);
if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
s->requires = makedeps(pool, repo, rpmhead, TAG_REQUIRENAME, TAG_REQUIREVERSION, TAG_REQUIREFLAGS, (flags & RPM_ADD_NO_RPMLIBREQS) ? MAKEDEPS_NO_RPMLIB : 0);
s->conflicts = makedeps(pool, repo, rpmhead, TAG_CONFLICTNAME, TAG_CONFLICTVERSION, TAG_CONFLICTFLAGS, 0);
s->obsoletes = makedeps(pool, repo, rpmhead, TAG_OBSOLETENAME, TAG_OBSOLETEVERSION, TAG_OBSOLETEFLAGS, 0);
@@ -989,12 +989,12 @@ copyreldep(Pool *pool, Pool *frompool, Id id)
if (ISRELDEP(name))
name = copyreldep(pool, frompool, name);
else
- name = str2id(pool, id2str(frompool, name), 1);
+ name = pool_str2id(pool, pool_id2str(frompool, name), 1);
if (ISRELDEP(evr))
evr = copyreldep(pool, frompool, evr);
else
- evr = str2id(pool, id2str(frompool, evr), 1);
- return rel2id(pool, name, evr, rd->flags, 1);
+ evr = pool_str2id(pool, pool_id2str(frompool, evr), 1);
+ return pool_rel2id(pool, name, evr, rd->flags, 1);
}
static Offset
@@ -1022,7 +1022,7 @@ copydeps(Pool *pool, Repo *repo, Offset fromoff, Repo *fromrepo)
if (ISRELDEP(id))
id = copyreldep(pool, frompool, id);
else
- id = str2id(pool, id2str(frompool, id), 1);
+ id = pool_str2id(pool, pool_id2str(frompool, id), 1);
*ida++ = id;
}
*ida = 0;
@@ -1053,7 +1053,7 @@ copydir_complex(Pool *pool, Repodata *data, Stringpool *fromspool, Repodata *fro
if (parent)
parent = copydir(pool, data, fromspool, fromdata, parent, cache);
if (fromspool != &pool->ss)
- compid = str2id(pool, stringpool_id2str(fromspool, compid), 1);
+ compid = pool_str2id(pool, stringpool_id2str(fromspool, compid), 1);
compid = dirpool_add_dir(&data->dirpool, parent, compid, 1);
if (cache)
{
@@ -1081,7 +1081,7 @@ solvable_copy_cb(void *vcbdata, Solvable *r, Repodata *fromdata, Repokey *key, K
keyname = key->name;
if (keyname >= ID_NUM_INTERNAL)
- keyname = str2id(pool, id2str(frompool, keyname), 1);
+ keyname = pool_str2id(pool, pool_id2str(frompool, keyname), 1);
switch(key->type)
{
case REPOKEY_TYPE_ID:
@@ -1093,7 +1093,7 @@ solvable_copy_cb(void *vcbdata, Solvable *r, Repodata *fromdata, Repokey *key, K
if (ISRELDEP(id))
id = copyreldep(pool, frompool, id);
else
- id = str2id(pool, stringpool_id2str(fromspool, id), 1);
+ id = pool_str2id(pool, stringpool_id2str(fromspool, id), 1);
}
if (key->type == REPOKEY_TYPE_ID)
repodata_set_id(data, handle, keyname, id);
@@ -1130,7 +1130,7 @@ solvable_copy_cb(void *vcbdata, Solvable *r, Repodata *fromdata, Repokey *key, K
if (ISRELDEP(id))
break; /* can't do those at the moment */
if (pool != frompool || fromdata->localpool)
- id = str2id(pool, stringpool_id2str(fromspool, id), 1);
+ id = pool_str2id(pool, stringpool_id2str(fromspool, id), 1);
repodata_add_idarray(data, handle, keyname, id);
break;
default:
@@ -1158,13 +1158,13 @@ solvable_copy(Solvable *s, Solvable *r, Repodata *data, Id *dircache)
else
{
if (r->name)
- s->name = str2id(pool, id2str(fromrepo->pool, r->name), 1);
+ s->name = pool_str2id(pool, pool_id2str(fromrepo->pool, r->name), 1);
if (r->evr)
- s->evr = str2id(pool, id2str(fromrepo->pool, r->evr), 1);
+ s->evr = pool_str2id(pool, pool_id2str(fromrepo->pool, r->evr), 1);
if (r->arch)
- s->arch = str2id(pool, id2str(fromrepo->pool, r->arch), 1);
+ s->arch = pool_str2id(pool, pool_id2str(fromrepo->pool, r->arch), 1);
if (r->vendor)
- s->vendor = str2id(pool, id2str(fromrepo->pool, r->vendor), 1);
+ s->vendor = pool_str2id(pool, pool_id2str(fromrepo->pool, r->vendor), 1);
}
s->provides = copydeps(pool, repo, r->provides, fromrepo);
s->requires = copydeps(pool, repo, r->requires, fromrepo);
@@ -1206,7 +1206,7 @@ pkgids_sort_cmp(const void *va, const void *vb, void *dp)
Id *rpmdbid;
if (a->name != b->name)
- return strcmp(id2str(pool, a->name), id2str(pool, b->name));
+ return strcmp(pool_id2str(pool, a->name), pool_id2str(pool, b->name));
rpmdbid = repo->rpmdbid;
return rpmdbid[(a - pool->solvables) - repo->start] - rpmdbid[(b - pool->solvables) - repo->start];
}
@@ -3019,8 +3019,8 @@ pubkey2solvable(Solvable *s, Repodata *data, char *pubkey)
sprintf(evrbuf, "%02x%02x%02x%02x-%02x%02x%02x%02x", dig->pubkey.signid[4], dig->pubkey.signid[5], dig->pubkey.signid[6], dig->pubkey.signid[7], dig->pubkey.time[0], dig->pubkey.time[1], dig->pubkey.time[2], dig->pubkey.time[3]);
repodata_set_num(data, s - s->repo->pool->solvables, SOLVABLE_BUILDTIME, btime);
- s->name = str2id(pool, "gpg-pubkey", 1);
- s->evr = str2id(pool, evrbuf, 1);
+ s->name = pool_str2id(pool, "gpg-pubkey", 1);
+ s->evr = pool_str2id(pool, evrbuf, 1);
s->arch = 1;
for (i = 0; i < 8; i++)
sprintf(keyid + 2 * i, "%02x", dig->pubkey.signid[i]);
diff --git a/ext/repo_rpmmd.c b/ext/repo_rpmmd.c
index d4a202e..74c1532 100644
--- a/ext/repo_rpmmd.c
+++ b/ext/repo_rpmmd.c
@@ -423,7 +423,7 @@ makeevr_atts(Pool *pool, struct parsedata *pd, const char **atts)
#if 0
fprintf(stderr, "evr: %s\n", pd->content);
#endif
- return str2id(pool, pd->content, 1);
+ return pool_str2id(pool, pd->content, 1);
}
@@ -501,10 +501,10 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, const char **atts
pd->acontent = l + 256;
}
sprintf(pd->content, "%s:%s", k, n);
- name = str2id(pool, pd->content, 1);
+ name = pool_str2id(pool, pd->content, 1);
}
else
- name = str2id(pool, (char *)n, 1);
+ name = pool_str2id(pool, (char *)n, 1);
if (f)
{
Id evr = makeevr_atts(pool, pd, atts);
@@ -513,12 +513,12 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, const char **atts
if (!strcmp(f, flagtab[flags]))
break;
flags = flags < 6 ? flags + 1 : 0;
- id = rel2id(pool, name, evr, flags, 1);
+ id = pool_rel2id(pool, name, evr, flags, 1);
}
else
id = name;
#if 0
- fprintf(stderr, "new dep %s%s%s\n", id2str(pool, d), id2rel(pool, d), id2evr(pool, d));
+ fprintf(stderr, "new dep %s%s%s\n", pool_id2str(pool, d), id2rel(pool, d), id2evr(pool, d));
#endif
return repo_addid_dep(pd->common.repo, olddeps, id, marker);
}
@@ -609,17 +609,17 @@ set_sourcerpm(Repodata *data, Solvable *s, Id handle, char *sourcerpm)
else if (!strcmp(sarch, "nosrc.rpm"))
repodata_set_constantid(data, handle, SOLVABLE_SOURCEARCH, ARCH_NOSRC);
else
- repodata_set_constantid(data, handle, SOLVABLE_SOURCEARCH, strn2id(pool, sarch, strlen(sarch) - 4, 1));
- evr = id2str(pool, s->evr);
+ repodata_set_constantid(data, handle, SOLVABLE_SOURCEARCH, pool_strn2id(pool, sarch, strlen(sarch) - 4, 1));
+ evr = pool_id2str(pool, s->evr);
if (evr && !strncmp(sevr, evr, sarch - sevr - 1) && evr[sarch - sevr - 1] == 0)
repodata_set_void(data, handle, SOLVABLE_SOURCEEVR);
else
- repodata_set_id(data, handle, SOLVABLE_SOURCEEVR, strn2id(pool, sevr, sarch - sevr - 1, 1));
- name = id2str(pool, s->name);
+ repodata_set_id(data, handle, SOLVABLE_SOURCEEVR, pool_strn2id(pool, sevr, sarch - sevr - 1, 1));
+ name = pool_id2str(pool, s->name);
if (name && !strncmp(sourcerpm, name, sevr - sourcerpm - 1) && name[sevr - sourcerpm - 1] == 0)
repodata_set_void(data, handle, SOLVABLE_SOURCENAME);
else
- repodata_set_id(data, handle, SOLVABLE_SOURCENAME, strn2id(pool, sourcerpm, sevr - sourcerpm - 1, 1));
+ repodata_set_id(data, handle, SOLVABLE_SOURCENAME, pool_strn2id(pool, sourcerpm, sevr - sourcerpm - 1, 1));
}
/*-----------------------------------------------*/
@@ -932,13 +932,13 @@ endElement(void *userData, const char *name)
{
case STATE_SOLVABLE:
if (pd->kind && !s->name) /* add namespace in case of NULL name */
- s->name = str2id(pool, join2(pd->kind, ":", ""), 1);
+ s->name = pool_str2id(pool, join2(pd->kind, ":", ""), 1);
if (!s->arch)
s->arch = ARCH_NOARCH;
if (!s->evr)
s->evr = ID_EMPTY; /* some patterns have this */
if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
s->supplements = repo_fix_supplements(repo, s->provides, s->supplements, pd->freshens);
s->conflicts = repo_fix_conflicts(repo, s->conflicts);
pd->freshens = 0;
@@ -946,15 +946,15 @@ endElement(void *userData, const char *name)
break;
case STATE_NAME:
if (pd->kind)
- s->name = str2id(pool, join2(pd->kind, ":", pd->content), 1);
+ s->name = pool_str2id(pool, join2(pd->kind, ":", pd->content), 1);
else
- s->name = str2id(pool, pd->content, 1);
+ s->name = pool_str2id(pool, pd->content, 1);
break;
case STATE_ARCH:
- s->arch = str2id(pool, pd->content, 1);
+ s->arch = pool_str2id(pool, pd->content, 1);
break;
case STATE_VENDOR:
- s->vendor = str2id(pool, pd->content, 1);
+ s->vendor = pool_str2id(pool, pd->content, 1);
break;
case STATE_RPM_GROUP:
repodata_set_poolstr(pd->data, handle, SOLVABLE_GROUP, pd->content);
@@ -991,7 +991,7 @@ endElement(void *userData, const char *name)
}
case STATE_FILE:
#if 0
- id = str2id(pool, pd->content, 1);
+ id = pool_str2id(pool, pd->content, 1);
s->provides = repo_addid_dep(repo, s->provides, id, SOLVABLE_FILEMARKER);
#endif
if ((p = strrchr(pd->content, '/')) != 0)
@@ -1051,21 +1051,21 @@ endElement(void *userData, const char *name)
if (pd->content[0])
{
repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL, pd->content);
- repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, str2id(pool, "releasenotes", 1));
+ repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, pool_str2id(pool, "releasenotes", 1));
}
break;
case STATE_UPDATEURL:
if (pd->content[0])
{
repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL, pd->content);
- repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, str2id(pool, "update", 1));
+ repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, pool_str2id(pool, "update", 1));
}
break;
case STATE_OPTIONALURL:
if (pd->content[0])
{
repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL, pd->content);
- repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, str2id(pool, "optional", 1));
+ repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, pool_str2id(pool, "optional", 1));
}
break;
case STATE_FLAG:
diff --git a/ext/repo_susetags.c b/ext/repo_susetags.c
index 802217f..ad7f374 100644
--- a/ext/repo_susetags.c
+++ b/ext/repo_susetags.c
@@ -77,7 +77,7 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
if (line[6] == '/')
{
/* A file dependency. Do not try to parse it */
- id = str2id(pool, line + 6, 1);
+ id = pool_str2id(pool, line + 6, 1);
}
else
{
@@ -88,9 +88,9 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
exit(1);
}
if (kind)
- id = str2id(pool, join2(kind, ":", sp[0]), 1);
+ id = pool_str2id(pool, join2(kind, ":", sp[0]), 1);
else
- id = str2id(pool, sp[0], 1);
+ id = pool_str2id(pool, sp[0], 1);
if (i == 3)
{
evrid = makeevr(pool, sp[2]);
@@ -102,7 +102,7 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
pool_debug(pool, SAT_FATAL, "susetags: unknown relation in %d: '%s'\n", pd->lineno, sp[1]);
exit(1);
}
- id = rel2id(pool, id, evrid, flags + 1, 1);
+ id = pool_rel2id(pool, id, evrid, flags + 1, 1);
}
}
return repo_addid_dep(pd->repo, olddeps, id, marker);
@@ -127,9 +127,9 @@ add_source(struct parsedata *pd, char *line, Solvable *s, Id handle)
exit(1);
}
- Id name = str2id(pool, sp[0], 1);
+ Id name = pool_str2id(pool, sp[0], 1);
Id evr = makeevr(pool, join2(sp[1], "-", sp[2]));
- Id arch = str2id(pool, sp[3], 1);
+ Id arch = pool_str2id(pool, sp[3], 1);
/* XXX: could record a dep here, depends on where we want to store the data */
if (name == s->name)
repodata_set_void(pd->data, handle, SOLVABLE_SOURCENAME);
@@ -224,7 +224,7 @@ set_delta_location(Repodata *data, Id handle, int medianr, char *dir, char *file
if (l == 1 && dir[0] == '.')
l = 0;
if (dir && l)
- repodata_set_id(data, handle, DELTA_LOCATION_DIR, strn2id(pool, dir, l, 1));
+ repodata_set_id(data, handle, DELTA_LOCATION_DIR, pool_strn2id(pool, dir, l, 1));
if ((p = strrchr(file, '.')) != 0)
{
*p = 0;
@@ -240,7 +240,7 @@ set_delta_location(Repodata *data, Id handle, int medianr, char *dir, char *file
*p = 0;
}
}
- repodata_set_id(data, handle, DELTA_LOCATION_SUFFIX, str2id(pool, p + 1, 1));
+ repodata_set_id(data, handle, DELTA_LOCATION_SUFFIX, pool_str2id(pool, p + 1, 1));
}
if ((p = strrchr(file, '-')) != 0)
{
@@ -251,9 +251,9 @@ set_delta_location(Repodata *data, Id handle, int medianr, char *dir, char *file
p = op;
*p = 0;
}
- repodata_set_id(data, handle, DELTA_LOCATION_EVR, str2id(pool, p + 1, 1));
+ repodata_set_id(data, handle, DELTA_LOCATION_EVR, pool_str2id(pool, p + 1, 1));
}
- repodata_set_id(data, handle, DELTA_LOCATION_NAME, str2id(pool, file, 1));
+ repodata_set_id(data, handle, DELTA_LOCATION_NAME, pool_str2id(pool, file, 1));
}
@@ -399,7 +399,7 @@ finish_solvable(struct parsedata *pd, Solvable *s, Id handle, Offset freshens)
lastreal = p + 1;
for (p = lastreal; *p; p++)
{
- str = id2str(pool, *p);
+ str = pool_id2str(pool, *p);
if (*str != '/')
lastreal = p + 1;
}
@@ -409,7 +409,7 @@ finish_solvable(struct parsedata *pd, Solvable *s, Id handle, Offset freshens)
{
char fname_buf[128];
const char *fname;
- str = id2str(pool, *p);
+ str = pool_id2str(pool, *p);
sp = strrchr(str, '/');
/* Need to copy filename now, before we add string that could
realloc the stringspace (and hence invalidate str). */
@@ -449,7 +449,7 @@ finish_solvable(struct parsedata *pd, Solvable *s, Id handle, Offset freshens)
to do twice (in case we see the same package twice). */
if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
s->provides = repo_addid_dep(pd->repo, s->provides,
- rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
/* XXX This uses repo_addid_dep internally, so should also be
harmless to do twice. */
s->supplements = repo_fix_supplements(pd->repo, s->provides, s->supplements, freshens);
@@ -747,10 +747,10 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
Id evr;
if (split(line + 5, sp, 5) != 5)
continue;
- repodata_set_id(data, handle, DELTA_SEQ_NAME, str2id(pool, sp[0], 1));
+ repodata_set_id(data, handle, DELTA_SEQ_NAME, pool_str2id(pool, sp[0], 1));
evr = makeevr(pool, join2(sp[1], "-", sp[2]));
repodata_set_id(data, handle, DELTA_SEQ_EVR, evr);
- /* repodata_set_id(data, handle, DELTA_SEQ_ARCH, str2id(pool, sp[3], 1)); */
+ /* repodata_set_id(data, handle, DELTA_SEQ_ARCH, pool_str2id(pool, sp[3], 1)); */
repodata_set_str(data, handle, DELTA_SEQ_NUM, sp[4]);
repodata_set_id(data, handle, DELTA_BASE_EVR, evr);
continue;
@@ -803,9 +803,9 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
exit(1);
}
handle = repodata_new_handle(data);
- repodata_set_id(data, handle, DELTA_PACKAGE_NAME, str2id(pool, sp[0], 1));
+ repodata_set_id(data, handle, DELTA_PACKAGE_NAME, pool_str2id(pool, sp[0], 1));
repodata_set_id(data, handle, DELTA_PACKAGE_EVR, makeevr(pool, join2(sp[1], "-", sp[2])));
- repodata_set_id(data, handle, DELTA_PACKAGE_ARCH, str2id(pool, sp[3], 1));
+ repodata_set_id(data, handle, DELTA_PACKAGE_ARCH, pool_str2id(pool, sp[3], 1));
repodata_add_flexarray(data, SOLVID_META, REPOSITORY_DELTAINFO, handle);
indelta = 1;
continue;
@@ -845,11 +845,11 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
Id name, evr, arch;
/* we don't use the create flag here as a simple pre-check for existance */
if (pd.kind)
- name = str2id(pool, join2(pd.kind, ":", sp[0]), 0);
+ name = pool_str2id(pool, join2(pd.kind, ":", sp[0]), 0);
else
- name = str2id(pool, sp[0], 0);
+ name = pool_str2id(pool, sp[0], 0);
evr = makeevr(pool, join2(sp[1], "-", sp[2]));
- arch = str2id(pool, sp[3], 0);
+ arch = pool_str2id(pool, sp[3], 0);
if (name && arch)
{
if (repo->start + last_found_pack + 1 < repo->end)
@@ -870,11 +870,11 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
/* normal operation. create a new solvable. */
s = pool_id2solvable(pool, repo_add_solvable(repo));
if (pd.kind)
- s->name = str2id(pool, join2(pd.kind, ":", sp[0]), 1);
+ s->name = pool_str2id(pool, join2(pd.kind, ":", sp[0]), 1);
else
- s->name = str2id(pool, sp[0], 1);
+ s->name = pool_str2id(pool, sp[0], 1);
s->evr = makeevr(pool, join2(sp[1], "-", sp[2]));
- s->arch = str2id(pool, sp[3], 1);
+ s->arch = pool_str2id(pool, sp[3], 1);
s->vendor = defvendor;
createdpkgs = 1;
}
@@ -963,7 +963,7 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
}
continue;
case CTAG('=', 'V', 'n', 'd'): /* vendor */
- s->vendor = str2id(pool, line + 6, 1);
+ s->vendor = pool_str2id(pool, line + 6, 1);
continue;
/* From here it's the attribute tags. */
@@ -981,7 +981,7 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
pool_debug(pool, SAT_FATAL, "susetags: bad location line: %d: %s\n", pd.lineno, line);
exit(1);
}
- repodata_set_location(data, handle, atoi(sp[0]), i == 3 ? sp[2] : id2str(pool, s->arch), sp[1]);
+ repodata_set_location(data, handle, atoi(sp[0]), i == 3 ? sp[2] : pool_id2str(pool, s->arch), sp[1]);
}
continue;
case CTAG('=', 'S', 'r', 'c'):
@@ -1039,9 +1039,9 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
pool_debug(pool, SAT_FATAL, "susetags: bad =Shr line: %s\n", line + 6);
exit(1);
}
- name = str2id(pool, sp[0], 1);
+ name = pool_str2id(pool, sp[0], 1);
evr = makeevr(pool, join2(sp[1], "-", sp[2]));
- arch = str2id(pool, sp[3], 1);
+ arch = pool_str2id(pool, sp[3], 1);
if (last_found_pack >= pd.nshare)
{
pd.share_with = sat_realloc2(pd.share_with, last_found_pack + 256, sizeof(*pd.share_with));
diff --git a/ext/repo_updateinfoxml.c b/ext/repo_updateinfoxml.c
index 7e87e2d..7c569fa 100644
--- a/ext/repo_updateinfoxml.c
+++ b/ext/repo_updateinfoxml.c
@@ -217,7 +217,7 @@ makeevr_atts(Pool *pool, struct parsedata *pd, const char **atts)
#if 0
fprintf(stderr, "evr: %s\n", pd->content);
#endif
- return str2id(pool, pd->content, 1);
+ return pool_str2id(pool, pd->content, 1);
}
@@ -290,8 +290,8 @@ startElement(void *userData, const char *name, const char **atts)
solvable = pd->solvable = pool_id2solvable(pool, repo_add_solvable(pd->repo));
pd->datanum = pd->solvable - pool->solvables;
- solvable->vendor = str2id(pool, from, 1);
- solvable->evr = str2id(pool, version, 1);
+ solvable->vendor = pool_str2id(pool, from, 1);
+ solvable->evr = pool_str2id(pool, version, 1);
solvable->arch = ARCH_NOARCH;
if (type)
repodata_set_str(pd->data, pd->datanum, SOLVABLE_PATCHCATEGORY, type);
@@ -394,15 +394,15 @@ startElement(void *userData, const char *name, const char **atts)
name = atts[1];
}
/* generated Id for name */
- n = str2id(pool, name, 1);
+ n = pool_str2id(pool, name, 1);
rel_id = n;
if (arch)
{
/* generate Id for arch and combine with name */
- a = str2id(pool, arch, 1);
- rel_id = rel2id(pool, n, a, REL_ARCH, 1);
+ a = pool_str2id(pool, arch, 1);
+ rel_id = pool_rel2id(pool, n, a, REL_ARCH, 1);
}
- rel_id = rel2id(pool, rel_id, evr, REL_LT, 1);
+ rel_id = pool_rel2id(pool, rel_id, evr, REL_LT, 1);
solvable->conflicts = repo_addid_dep(pd->repo, solvable->conflicts, rel_id, 0);
@@ -462,10 +462,10 @@ endElement(void *userData, const char *name)
case STATE_UPDATES:
break;
case STATE_UPDATE:
- s->provides = repo_addid_dep(repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
break;
case STATE_ID:
- s->name = str2id(pool, join2("patch", ":", pd->content), 1);
+ s->name = pool_str2id(pool, join2("patch", ":", pd->content), 1);
break;
/* <title>imlib-1.9.15-6.fc8</title> */
case STATE_TITLE:
diff --git a/ext/repo_write.c b/ext/repo_write.c
index 5d4e289..38c2e48 100644
--- a/ext/repo_write.c
+++ b/ext/repo_write.c
@@ -696,7 +696,7 @@ repo_write_cb_needed(void *vcbdata, Solvable *s, Repodata *data, Repokey *key, K
#if 0
if (s)
- fprintf(stderr, "solvable %d (%s): key (%d)%s %d\n", s ? s - repo->pool->solvables : 0, s ? id2str(repo->pool, s->name) : "", key->name, id2str(repo->pool, key->name), key->type);
+ fprintf(stderr, "solvable %d (%s): key (%d)%s %d\n", s ? s - repo->pool->solvables : 0, s ? pool_id2str(repo->pool, s->name) : "", key->name, pool_id2str(repo->pool, key->name), key->type);
#endif
return repo_write_collect_needed(cbdata, repo, data, key, kv);
}
@@ -945,7 +945,7 @@ repo_write_stdkeyfilter(Repo *repo, Repokey *key, void *kfdata)
for (i = 0; verticals[i]; i++)
if (key->name == verticals[i])
return KEY_STORAGE_VERTICAL_OFFSET;
- keyname = id2str(repo->pool, key->name);
+ keyname = pool_id2str(repo->pool, key->name);
for (i = 0; languagetags[i] != 0; i++)
if (!strncmp(keyname, languagetags[i], strlen(languagetags[i])))
return KEY_STORAGE_VERTICAL_OFFSET;
@@ -1236,7 +1236,7 @@ fprintf(stderr, "poolusage: %d\n", poolusage);
fprintf(stderr, "dirpoolusage: %d\n", dirpoolusage);
fprintf(stderr, "nkeys: %d\n", target.nkeys);
for (i = 1; i < target.nkeys; i++)
- fprintf(stderr, " %2d: %s[%d] %d %d %d\n", i, id2str(pool, target.keys[i].name), target.keys[i].name, target.keys[i].type, target.keys[i].size, target.keys[i].storage);
+ fprintf(stderr, " %2d: %s[%d] %d %d %d\n", i, pool_id2str(pool, target.keys[i].name), target.keys[i].name, target.keys[i].type, target.keys[i].size, target.keys[i].storage);
#endif
/* copy keys if requested */
@@ -1256,15 +1256,15 @@ for (i = 1; i < target.nkeys; i++)
/* put mapped ids right into target.keys */
for (i = 1, key = target.keys + i; i < target.nkeys; i++, key++)
{
- key->name = stringpool_str2id(spool, id2str(pool, key->name), 1);
+ key->name = stringpool_str2id(spool, pool_id2str(pool, key->name), 1);
if (key->type == REPOKEY_TYPE_CONSTANTID)
{
- key->type = stringpool_str2id(spool, id2str(pool, key->type), 1);
+ key->type = stringpool_str2id(spool, pool_id2str(pool, key->type), 1);
type_constantid = key->type;
- key->size = stringpool_str2id(spool, id2str(pool, key->size), 1);
+ key->size = stringpool_str2id(spool, pool_id2str(pool, key->size), 1);
}
else
- key->type = stringpool_str2id(spool, id2str(pool, key->type), 1);
+ key->type = stringpool_str2id(spool, pool_id2str(pool, key->type), 1);
}
if (poolusage == 2)
stringpool_freehash(spool); /* free some mem */
diff --git a/ext/repo_zyppdb.c b/ext/repo_zyppdb.c
index b4f7b90..29570ae 100644
--- a/ext/repo_zyppdb.c
+++ b/ext/repo_zyppdb.c
@@ -236,21 +236,21 @@ endElement(void *userData, const char *name)
if (!s->evr)
s->evr = ID_EMPTY;
if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
- s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pd->pool, s->name, s->evr, REL_EQ, 1), 0);
+ s->provides = repo_addid_dep(pd->repo, s->provides, pool_rel2id(pd->pool, s->name, s->evr, REL_EQ, 1), 0);
pd->solvable = 0;
break;
case STATE_NAME:
- s->name = str2id(pd->pool, join2("product", ":", pd->content), 1);
+ s->name = pool_str2id(pd->pool, join2("product", ":", pd->content), 1);
break;
case STATE_ARCH:
- s->arch = str2id(pd->pool, pd->content, 1);
+ s->arch = pool_str2id(pd->pool, pd->content, 1);
break;
case STATE_SUMMARY:
repodata_set_str(pd->data, pd->handle, langtag(pd, SOLVABLE_SUMMARY, pd->tmplang), pd->content);
pd->tmplang = sat_free((void *)pd->tmplang);
break;
case STATE_VENDOR:
- s->vendor = str2id(pd->pool, pd->content, 1);
+ s->vendor = pool_str2id(pd->pool, pd->content, 1);
break;
case STATE_INSTALLTIME:
repodata_set_num(pd->data, pd->handle, SOLVABLE_INSTALLTIME, atol(pd->content));
diff --git a/ext/tools_util.h b/ext/tools_util.h
index 06f246e..20bfcfe 100644
--- a/ext/tools_util.h
+++ b/ext/tools_util.h
@@ -28,7 +28,7 @@ makeevr(Pool *pool, const char *s)
{
if (!strncmp(s, "0:", 2) && s[2])
s += 2;
- return str2id(pool, s, 1);
+ return pool_str2id(pool, s, 1);
}
/**
@@ -110,7 +110,7 @@ join_freemem(void)
static inline void repodata_set_tstr(Repodata *data, Id handle, const char *attrname, const char *lang, const char *str)
{
Id attrid;
- attrid = str2id(data->repo->pool, join2(attrname, ":", lang), 1);
+ attrid = pool_str2id(data->repo->pool, join2(attrname, ":", lang), 1);
repodata_set_str(data, handle, attrid, str);
}
diff --git a/src/evr.c b/src/evr.c
index 587cd5a..e3268b2 100644
--- a/src/evr.c
+++ b/src/evr.c
@@ -172,7 +172,7 @@ pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode)
s2 = 0;
if (s1 && s2)
{
- r = vercmp(evr1, s1, evr2, s2);
+ r = sat_vercmp(evr1, s1, evr2, s2);
if (r)
return r;
evr1 = s1 + 1;
@@ -206,7 +206,7 @@ pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode)
r = 0;
if (mode != EVRCMP_MATCH || (evr1 != (r1 ? r1 : s1) && evr2 != (r2 ? r2 : s2)))
- r = vercmp(evr1, r1 ? r1 : s1, evr2, r2 ? r2 : s2);
+ r = sat_vercmp(evr1, r1 ? r1 : s1, evr2, r2 ? r2 : s2);
if (r)
return r;
@@ -222,7 +222,7 @@ pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode)
if (r1 && r2)
{
if (s1 != ++r1 && s2 != ++r2)
- r = vercmp(r1, s1, r2, s2);
+ r = sat_vercmp(r1, s1, r2, s2);
}
return r;
}
@@ -233,9 +233,9 @@ pool_evrcmp(const Pool *pool, Id evr1id, Id evr2id, int mode)
const char *evr1, *evr2;
if (evr1id == evr2id)
return 0;
- evr1 = id2str(pool, evr1id);
- evr2 = id2str(pool, evr2id);
- return evrcmp_str(pool, evr1, evr2, mode);
+ evr1 = pool_id2str(pool, evr1id);
+ evr2 = pool_id2str(pool, evr2id);
+ return pool_evrcmp_str(pool, evr1, evr2, mode);
}
int
@@ -246,14 +246,14 @@ pool_evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version
const char *r1;
int r;
- evr1 = id2str(pool, evrid);
+ evr1 = pool_id2str(pool, evrid);
for (s1 = evr1; *s1 >= '0' && *s1 <= '9'; s1++)
;
if (s1 != evr1 && *s1 == ':')
{
if (epoch)
{
- r = vercmp(evr1, s1, epoch, epoch + strlen(epoch));
+ r = sat_vercmp(evr1, s1, epoch, epoch + strlen(epoch));
if (r)
return r;
}
@@ -271,7 +271,7 @@ pool_evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version
r1 = s1;
if (version)
{
- r = vercmp(evr1, r1 ? r1 : s1, version, version + strlen(version));
+ r = sat_vercmp(evr1, r1 ? r1 : s1, version, version + strlen(version));
if (r)
return r;
}
@@ -279,7 +279,7 @@ pool_evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version
{
if (!r1)
return -1;
- r = vercmp(r1 + 1, s1, release, release + strlen(release));
+ r = sat_vercmp(r1 + 1, s1, release, release + strlen(release));
if (r)
return r;
}
diff --git a/src/evr.h b/src/evr.h
index 6f0b931..a856eb1 100644
--- a/src/evr.h
+++ b/src/evr.h
@@ -31,6 +31,7 @@ extern int pool_evrcmp(const Pool *pool, Id evr1id, Id evr2id, int mode);
extern int pool_evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version, const char *release);
/* obsolete, do not use in new code */
+#ifdef OBSOLETE_INTERFACE
static inline int vercmp(const char *s1, const char *q1, const char *s2, const char *q2)
{
return sat_vercmp(s1, q1, s2, q2);
@@ -47,6 +48,7 @@ static inline int evrmatch(const Pool *pool, Id evrid, const char *epoch, const
{
return pool_evrmatch(pool, evrid, epoch, version, release);
}
+#endif
#ifdef __cplusplus
}
diff --git a/src/policy.c b/src/policy.c
index e21e3ef..8ca71f4 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -46,8 +46,8 @@ prune_to_best_version_sortcmp(const void *ap, const void *bp, void *dp)
const char *na, *nb;
/* different names. We use real strcmp here so that the result
* is not depending on some random solvable order */
- na = id2str(pool, sa->name);
- nb = id2str(pool, sb->name);
+ na = pool_id2str(pool, sa->name);
+ nb = pool_id2str(pool, sb->name);
return strcmp(na, nb);
}
/* the same name, bring installed solvables to the front */
@@ -370,7 +370,7 @@ prune_to_best_version(Pool *pool, Queue *plist)
s = pool->solvables + plist->elements[i];
POOL_DEBUG(SAT_DEBUG_POLICY, "- %s[%s]\n",
- solvable2str(pool, s),
+ pool_solvable2str(pool, s),
(pool->installed && s->repo == pool->installed) ? "installed" : "not installed");
if (!best) /* if no best yet, the current is best */
@@ -389,7 +389,7 @@ prune_to_best_version(Pool *pool, Queue *plist)
if (best->evr != s->evr) /* compare evr */
{
- if (evrcmp(pool, best->evr, s->evr, EVRCMP_COMPARE) < 0)
+ if (pool_evrcmp(pool, best->evr, s->evr, EVRCMP_COMPARE) < 0)
best = s;
}
}
@@ -543,7 +543,7 @@ policy_is_illegal(Solver *solv, Solvable *is, Solvable *s, int ignore)
int ret = 0;
if (!(ignore & POLICY_ILLEGAL_DOWNGRADE) && !solv->allowdowngrade)
{
- if (is->name == s->name && evrcmp(pool, is->evr, s->evr, EVRCMP_COMPARE) > 0)
+ if (is->name == s->name && pool_evrcmp(pool, is->evr, s->evr, EVRCMP_COMPARE) > 0)
ret |= POLICY_ILLEGAL_DOWNGRADE;
}
if (!(ignore & POLICY_ILLEGAL_ARCHCHANGE) && !solv->allowarchchange)
@@ -681,7 +681,7 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all)
ps = pool->solvables + p;
if (s->name == ps->name) /* name match */
{
- if (!allow_all && !solv->allowdowngrade && evrcmp(pool, s->evr, ps->evr, EVRCMP_COMPARE) > 0)
+ if (!allow_all && !solv->allowdowngrade && pool_evrcmp(pool, s->evr, ps->evr, EVRCMP_COMPARE) > 0)
continue;
}
else if (!solv->noupdateprovide && ps->obsoletes) /* provides/obsoletes combination ? */
diff --git a/src/pool.c b/src/pool.c
index 1f3007c..66d0e9c 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -482,7 +482,7 @@ pool_match_nevr_rel(Pool *pool, Solvable *s, Id d)
return 1;
if (flags != 2 && flags != 5)
flags ^= 5;
- if ((flags & (1 << (1 + evrcmp(pool, s->evr, evr, EVRCMP_DEPCMP)))) != 0)
+ if ((flags & (1 << (1 + pool_evrcmp(pool, s->evr, evr, EVRCMP_DEPCMP)))) != 0)
return 1;
return 0;
}
@@ -505,7 +505,7 @@ pool_match_flags_evr(Pool *pool, int pflags, Id pevr, int flags, int evr)
else
{
int f = flags == 5 ? 5 : flags == 2 ? pflags : (flags ^ 5) & (pflags | 5);
- if ((f & (1 << (1 + evrcmp(pool, pevr, evr, EVRCMP_DEPCMP)))) != 0)
+ if ((f & (1 << (1 + pool_evrcmp(pool, pevr, evr, EVRCMP_DEPCMP)))) != 0)
return 1;
}
return 0;
@@ -685,7 +685,7 @@ pool_addrelproviders(Pool *pool, Id d)
{
/* simple version comparison relation */
#if 0
- POOL_DEBUG(SAT_DEBUG_STATS, "addrelproviders: what provides %s?\n", dep2str(pool, name));
+ POOL_DEBUG(SAT_DEBUG_STATS, "addrelproviders: what provides %s?\n", pool_dep2str(pool, name));
#endif
pp = pool_whatprovides_ptr(pool, name);
while (ISRELDEP(name))
@@ -735,7 +735,7 @@ pool_addrelproviders(Pool *pool, Id d)
queue_push(&plist, p);
}
/* make our system solvable provide all unknown rpmlib() stuff */
- if (plist.count == 0 && !strncmp(id2str(pool, name), "rpmlib(", 7))
+ if (plist.count == 0 && !strncmp(pool_id2str(pool, name), "rpmlib(", 7))
queue_push(&plist, SYSTEMSOLVABLE);
}
/* add providers to whatprovides */
@@ -860,7 +860,7 @@ pool_addfileprovides_dep(Pool *pool, Id *ida, struct searchfiles *sf, struct sea
if (MAPTST(&csf->seen, dep))
continue;
MAPSET(&csf->seen, dep);
- s = id2str(pool, dep);
+ s = pool_id2str(pool, dep);
if (*s != '/')
continue;
csf->ids = sat_extend(csf->ids, csf->nfiles, 1, sizeof(Id), SEARCHFILES_BLOCK);
@@ -1015,11 +1015,11 @@ pool_addfileprovides_search(Pool *pool, struct addfileprovides_cbdata *cbd, stru
{
#if 0
for (i = 0; i < cbd->nfiles; i++)
- if (!MAPTST(&cbd->providedids, cbd->ids[i]) && !repodata_filelistfilter_matches(data, id2str(pool, cbd->ids[i])))
- printf("need complete filelist because of %s\n", id2str(pool, cbd->ids[i]));
+ if (!MAPTST(&cbd->providedids, cbd->ids[i]) && !repodata_filelistfilter_matches(data, pool_id2str(pool, cbd->ids[i])))
+ printf("need complete filelist because of %s\n", pool_id2str(pool, cbd->ids[i]));
#endif
for (i = 0; i < cbd->nfiles; i++)
- if (!MAPTST(&cbd->providedids, cbd->ids[i]) && !repodata_filelistfilter_matches(data, id2str(pool, cbd->ids[i])))
+ if (!MAPTST(&cbd->providedids, cbd->ids[i]) && !repodata_filelistfilter_matches(data, pool_id2str(pool, cbd->ids[i])))
break;
if (i < cbd->nfiles)
incomplete = 1;
@@ -1099,7 +1099,7 @@ pool_addfileprovides_ids(Pool *pool, Repo *installed, Id **idp)
{
#if 0
for (i = 0; i < sf.nfiles; i++)
- POOL_DEBUG(SAT_DEBUG_STATS, "looking up %s in filelist\n", id2str(pool, sf.ids[i]));
+ POOL_DEBUG(SAT_DEBUG_STATS, "looking up %s in filelist\n", pool_id2str(pool, sf.ids[i]));
#endif
pool_addfileprovides_search(pool, &cbd, &sf, 0);
if (idp)
@@ -1122,7 +1122,7 @@ pool_addfileprovides_ids(Pool *pool, Repo *installed, Id **idp)
{
#if 0
for (i = 0; i < isf.nfiles; i++)
- POOL_DEBUG(SAT_DEBUG_STATS, "looking up %s in installed filelist\n", id2str(pool, isf.ids[i]));
+ POOL_DEBUG(SAT_DEBUG_STATS, "looking up %s in installed filelist\n", pool_id2str(pool, isf.ids[i]));
#endif
if (installed)
pool_addfileprovides_search(pool, &cbd, &isf, installed);
@@ -1198,14 +1198,14 @@ pool_id2langid(Pool *pool, Id id, const char *lang, int create)
if (!lang)
return id;
- n = id2str(pool, id);
+ n = pool_id2str(pool, id);
l = strlen(n) + strlen(lang) + 2;
if (l > sizeof(buf))
p = sat_malloc(strlen(n) + strlen(lang) + 2);
else
p = buf;
sprintf(p, "%s:%s", n, lang);
- id = str2id(pool, p, create);
+ id = pool_str2id(pool, p, create);
if (p != buf)
free(p);
return id;
@@ -1400,7 +1400,7 @@ solver_fill_DU_cb(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyVa
if (data->localpool)
compstr = stringpool_id2str(&data->spool, comp);
else
- compstr = id2str(data->repo->pool, comp);
+ compstr = pool_id2str(data->repo->pool, comp);
compl = strlen(compstr);
for (i = mptree[mp].child; i; i = mptree[i].sibling)
if (mptree[i].compl == compl && !strncmp(mptree[i].comp, compstr, compl))
@@ -1751,7 +1751,7 @@ pool_trivial_installable_noobsoletesmap(Pool *pool, Map *installedmap, Queue *pk
{
int ispatch = 0; /* see solver.c patch handling */
- if (!strncmp("patch:", id2str(pool, s->name), 6))
+ if (!strncmp("patch:", pool_id2str(pool, s->name), 6))
ispatch = 1;
conp = s->repo->idarraydata + s->conflicts;
while ((con = *conp++) != 0)
@@ -1921,7 +1921,7 @@ pool_add_fileconflicts_deps(Pool *pool, Queue *conflicts)
p = conflicts->elements[i + 1];
md5 = conflicts->elements[i + 2];
q = conflicts->elements[i + 3];
- id = rel2id(pool, fn, md5, REL_FILECONFLICT, 1);
+ id = pool_rel2id(pool, fn, md5, REL_FILECONFLICT, 1);
s = pool->solvables + p;
if (!s->repo)
continue;
diff --git a/src/pool.h b/src/pool.h
index fb2b0a2..198a069 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -226,6 +226,7 @@ static inline const char *pool_solvid2str(Pool *pool, Id p)
}
/* obsolete, do not use anymore */
+#ifdef OBSOLETE_INTERFACE
static inline const char *solvable2str(Pool *pool, Solvable *s)
{
return pool_solvable2str(pool, s);
@@ -234,6 +235,7 @@ static inline const char *solvid2str(Pool *pool, Id p)
{
return pool_solvable2str(pool, pool->solvables + p);
}
+#endif
void pool_set_languages(Pool *pool, const char **languages, int nlanguages);
Id pool_id2langid(Pool *pool, Id id, const char *lang, int create);
diff --git a/src/poolarch.c b/src/poolarch.c
index fdb8175..12fd202 100644
--- a/src/poolarch.c
+++ b/src/poolarch.c
@@ -112,7 +112,7 @@ pool_setarchpolicy(Pool *pool, const char *arch)
l = strcspn(arch, ":=>");
if (l)
{
- id = strn2id(pool, arch, l, 1);
+ id = pool_strn2id(pool, arch, l, 1);
if (id > lastarch)
{
id2arch = sat_realloc2(id2arch, (id + 255 + 1), sizeof(Id));
@@ -146,7 +146,7 @@ pool_arch2color_slow(Pool *pool, Id arch)
return ARCHCOLOR_ALL;
if (!pool->id2color)
pool->id2color = sat_calloc(pool->lastarch + 1, 1);
- s = id2str(pool, arch);
+ s = pool_id2str(pool, arch);
if (arch == ARCH_NOARCH || arch == ARCH_ALL)
color = ARCHCOLOR_ALL;
else if (!strcmp(s, "s390x") || strstr(s, "64"))
diff --git a/src/poolid.c b/src/poolid.c
index 25b89a2..d5f6bb2 100644
--- a/src/poolid.c
+++ b/src/poolid.c
@@ -208,7 +208,7 @@ dep2strlen(const Pool *pool, Id id)
{
Reldep *rd = GETRELDEP(pool, id);
/* add 2 for parens */
- l += 2 + dep2strlen(pool, rd->name) + strlen(id2rel(pool, id));
+ l += 2 + dep2strlen(pool, rd->name) + strlen(pool_id2rel(pool, id));
id = rd->evr;
}
return l + strlen(pool->ss.stringspace + pool->ss.strings[id]);
@@ -227,7 +227,7 @@ dep2strcpy(const Pool *pool, char *p, Id id, int oldrel)
*p++ = '(';
dep2strcpy(pool, p, rd->name, rd->flags);
p += strlen(p);
- strcpy(p, id2rel(pool, id));
+ strcpy(p, pool_id2rel(pool, id));
p += strlen(p);
dep2strcpy(pool, p, rd->evr, rd->flags);
strcat(p, ")");
@@ -247,7 +247,7 @@ dep2strcpy(const Pool *pool, char *p, Id id, int oldrel)
*p = 0;
return;
}
- strcpy(p, id2rel(pool, id));
+ strcpy(p, pool_id2rel(pool, id));
p += strlen(p);
id = rd->evr;
oldrel = rd->flags;
diff --git a/src/poolid.h b/src/poolid.h
index 05c788f..f7c6511 100644
--- a/src/poolid.h
+++ b/src/poolid.h
@@ -40,6 +40,7 @@ extern void pool_freeidhashes(Pool *pool);
/* deprecated names, do not use in new code */
+#ifdef OBSOLETE_INTERFACE
static inline Id str2id(Pool *pool, const char *str, int create)
{
return pool_str2id(pool, str, create);
@@ -68,5 +69,6 @@ static inline const char *dep2str(Pool *pool, Id id)
{
return pool_dep2str(pool, id);
}
+#endif
#endif /* LIBSOLV_POOLID_H */
diff --git a/src/poolvendor.c b/src/poolvendor.c
index baaab19..04180b9 100644
--- a/src/poolvendor.c
+++ b/src/poolvendor.c
@@ -51,7 +51,7 @@ Id pool_vendor2mask(Pool *pool, Id vendor)
for (i = 0; i < pool->vendormap.count; i += 2)
if (pool->vendormap.elements[i] == vendor)
return pool->vendormap.elements[i + 1];
- vstr = id2str(pool, vendor);
+ vstr = pool_id2str(pool, vendor);
m = 1;
mask = 0;
for (v = pool->vendorclasses; ; v++)
diff --git a/src/repo.c b/src/repo.c
index 1eb02d8..6e582ff 100644
--- a/src/repo.c
+++ b/src/repo.c
@@ -414,7 +414,7 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
id = repo->idarraydata[i];
if (ISRELDEP(id))
continue;
- dep = (char *)id2str(pool, id);
+ dep = (char *)pool_id2str(pool, id);
if (!strncmp(dep, "locale(", 7) && strlen(dep) < sizeof(buf) - 2)
{
idp = 0;
@@ -423,7 +423,7 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
if ((p = strchr(dep, ':')) != 0 && p != dep)
{
*p++ = 0;
- idp = str2id(pool, dep, 1);
+ idp = pool_str2id(pool, dep, 1);
dep = p;
}
id = 0;
@@ -437,13 +437,13 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
*p++ = 0;
#if 0
strncpy(dep - 9, "language:", 9);
- idl = str2id(pool, dep - 9, 1);
+ idl = pool_str2id(pool, dep - 9, 1);
#else
- idl = str2id(pool, dep, 1);
- idl = rel2id(pool, NAMESPACE_LANGUAGE, idl, REL_NAMESPACE, 1);
+ idl = pool_str2id(pool, dep, 1);
+ idl = pool_rel2id(pool, NAMESPACE_LANGUAGE, idl, REL_NAMESPACE, 1);
#endif
if (id)
- id = rel2id(pool, id, idl, REL_OR, 1);
+ id = pool_rel2id(pool, id, idl, REL_OR, 1);
else
id = idl;
dep = p;
@@ -455,18 +455,18 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
*p = 0;
#if 0
strncpy(dep - 9, "language:", 9);
- idl = str2id(pool, dep - 9, 1);
+ idl = pool_str2id(pool, dep - 9, 1);
#else
- idl = str2id(pool, dep, 1);
- idl = rel2id(pool, NAMESPACE_LANGUAGE, idl, REL_NAMESPACE, 1);
+ idl = pool_str2id(pool, dep, 1);
+ idl = pool_rel2id(pool, NAMESPACE_LANGUAGE, idl, REL_NAMESPACE, 1);
#endif
if (id)
- id = rel2id(pool, id, idl, REL_OR, 1);
+ id = pool_rel2id(pool, id, idl, REL_OR, 1);
else
id = idl;
}
if (idp)
- id = rel2id(pool, idp, id, REL_AND, 1);
+ id = pool_rel2id(pool, idp, id, REL_AND, 1);
if (id)
supplements = repo_addid_dep(repo, supplements, id, 0);
}
@@ -475,14 +475,14 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
strcpy(buf, dep);
p = buf + (p - dep);
*p++ = 0;
- idp = str2id(pool, buf, 1);
+ idp = pool_str2id(pool, buf, 1);
/* strip trailing slashes */
l = strlen(p);
while (l > 1 && p[l - 1] == '/')
p[--l] = 0;
- id = str2id(pool, p, 1);
- id = rel2id(pool, idp, id, REL_WITH, 1);
- id = rel2id(pool, NAMESPACE_SPLITPROVIDES, id, REL_NAMESPACE, 1);
+ id = pool_str2id(pool, p, 1);
+ id = pool_rel2id(pool, idp, id, REL_WITH, 1);
+ id = pool_rel2id(pool, NAMESPACE_SPLITPROVIDES, id, REL_NAMESPACE, 1);
supplements = repo_addid_dep(repo, supplements, id, 0);
}
}
@@ -494,7 +494,7 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
id = repo->idarraydata[i];
if (ISRELDEP(id))
continue;
- dep = (char *)id2str(pool, id);
+ dep = (char *)pool_id2str(pool, id);
if (!strncmp(dep, "system:modalias(", 16))
dep += 7;
if (!strncmp(dep, "modalias(", 9) && dep[9] && dep[10] && strlen(dep) < sizeof(buf))
@@ -504,18 +504,18 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
if (p && p != buf + 9 && strchr(p + 1, ':'))
{
*p++ = 0;
- idp = str2id(pool, buf + 9, 1);
+ idp = pool_str2id(pool, buf + 9, 1);
p[strlen(p) - 1] = 0;
- id = str2id(pool, p, 1);
- id = rel2id(pool, NAMESPACE_MODALIAS, id, REL_NAMESPACE, 1);
- id = rel2id(pool, idp, id, REL_AND, 1);
+ id = pool_str2id(pool, p, 1);
+ id = pool_rel2id(pool, NAMESPACE_MODALIAS, id, REL_NAMESPACE, 1);
+ id = pool_rel2id(pool, idp, id, REL_AND, 1);
}
else
{
p = buf + 9;
p[strlen(p) - 1] = 0;
- id = str2id(pool, p, 1);
- id = rel2id(pool, NAMESPACE_MODALIAS, id, REL_NAMESPACE, 1);
+ id = pool_str2id(pool, p, 1);
+ id = pool_rel2id(pool, NAMESPACE_MODALIAS, id, REL_NAMESPACE, 1);
}
if (id)
repo->idarraydata[i] = id;
@@ -533,9 +533,9 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
continue;
}
*p++ = 0;
- idp = str2id(pool, dep, 1);
+ idp = pool_str2id(pool, dep, 1);
if (id)
- id = rel2id(pool, id, idp, REL_AND, 1);
+ id = pool_rel2id(pool, id, idp, REL_AND, 1);
else
id = idp;
dep = p;
@@ -543,9 +543,9 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
if (dep[0] && dep[1])
{
dep[strlen(dep) - 1] = 0;
- idp = str2id(pool, dep, 1);
+ idp = pool_str2id(pool, dep, 1);
if (id)
- id = rel2id(pool, id, idp, REL_AND, 1);
+ id = pool_rel2id(pool, id, idp, REL_AND, 1);
else
id = idp;
}
@@ -557,8 +557,8 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
strcpy(buf, dep + 11);
if ((p = strrchr(buf, ')')) != 0)
*p = 0;
- id = str2id(pool, buf, 1);
- id = rel2id(pool, NAMESPACE_FILESYSTEM, id, REL_NAMESPACE, 1);
+ id = pool_str2id(pool, buf, 1);
+ id = pool_rel2id(pool, NAMESPACE_FILESYSTEM, id, REL_NAMESPACE, 1);
repo->idarraydata[i] = id;
}
}
@@ -573,19 +573,19 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre
if (!idsupp)
idsupp = repo->idarraydata[i];
else
- idsupp = rel2id(pool, idsupp, repo->idarraydata[i], REL_OR, 1);
+ idsupp = pool_rel2id(pool, idsupp, repo->idarraydata[i], REL_OR, 1);
}
for (i = freshens; repo->idarraydata[i]; i++)
{
if (!idfresh)
idfresh = repo->idarraydata[i];
else
- idfresh = rel2id(pool, idfresh, repo->idarraydata[i], REL_OR, 1);
+ idfresh = pool_rel2id(pool, idfresh, repo->idarraydata[i], REL_OR, 1);
}
if (!idsupp)
idsupp = idfresh;
else
- idsupp = rel2id(pool, idsupp, idfresh, REL_AND, 1);
+ idsupp = pool_rel2id(pool, idsupp, idfresh, REL_AND, 1);
supplements = repo_addid_dep(repo, 0, idsupp, 0);
}
return supplements;
@@ -606,14 +606,14 @@ repo_fix_conflicts(Repo *repo, Offset conflicts)
id = repo->idarraydata[i];
if (ISRELDEP(id))
continue;
- dep = (char *)id2str(pool, id);
+ dep = (char *)pool_id2str(pool, id);
if (!strncmp(dep, "otherproviders(", 15) && strlen(dep) < sizeof(buf) - 2)
{
strcpy(buf, dep + 15);
if ((p = strchr(buf, ')')) != 0)
*p = 0;
- id = str2id(pool, buf, 1);
- id = rel2id(pool, NAMESPACE_OTHERPROVIDERS, id, REL_NAMESPACE, 1);
+ id = pool_str2id(pool, buf, 1);
+ id = pool_rel2id(pool, NAMESPACE_OTHERPROVIDERS, id, REL_NAMESPACE, 1);
repo->idarraydata[i] = id;
}
}
@@ -870,13 +870,13 @@ repo_lookup_str(Repo *repo, Id entry, Id keyname)
switch (keyname)
{
case SOLVABLE_NAME:
- return id2str(pool, pool->solvables[entry].name);
+ return pool_id2str(pool, pool->solvables[entry].name);
case SOLVABLE_ARCH:
- return id2str(pool, pool->solvables[entry].arch);
+ return pool_id2str(pool, pool->solvables[entry].arch);
case SOLVABLE_EVR:
- return id2str(pool, pool->solvables[entry].evr);
+ return pool_id2str(pool, pool->solvables[entry].evr);
case SOLVABLE_VENDOR:
- return id2str(pool, pool->solvables[entry].vendor);
+ return pool_id2str(pool, pool->solvables[entry].vendor);
}
}
for (i = 0, data = repo->repodata; i < repo->nrepodata; i++, data++)
@@ -1189,7 +1189,7 @@ repo_set_str(Repo *repo, Id p, Id keyname, const char *str)
case SOLVABLE_ARCH:
case SOLVABLE_EVR:
case SOLVABLE_VENDOR:
- repo_set_id(repo, p, keyname, str2id(repo->pool, str, 1));
+ repo_set_id(repo, p, keyname, pool_str2id(repo->pool, str, 1));
return;
}
}
@@ -1209,7 +1209,7 @@ repo_set_poolstr(Repo *repo, Id p, Id keyname, const char *str)
case SOLVABLE_ARCH:
case SOLVABLE_EVR:
case SOLVABLE_VENDOR:
- repo_set_id(repo, p, keyname, str2id(repo->pool, str, 1));
+ repo_set_id(repo, p, keyname, pool_str2id(repo->pool, str, 1));
return;
}
}
diff --git a/src/repo_solv.c b/src/repo_solv.c
index b264d71..a3ea500 100644
--- a/src/repo_solv.c
+++ b/src/repo_solv.c
@@ -827,15 +827,15 @@ repo_add_solv_flags(Repo *repo, FILE *fp, int flags)
if (idmap)
id = idmap[id];
else if ((flags & REPO_LOCALPOOL) != 0)
- id = str2id(pool, stringpool_id2str(spool, id), 1);
+ id = pool_str2id(pool, stringpool_id2str(spool, id), 1);
type = read_id(&data, numid);
if (idmap)
type = idmap[type];
else if ((flags & REPO_LOCALPOOL) != 0)
- type = str2id(pool, stringpool_id2str(spool, type), 1);
+ type = pool_str2id(pool, stringpool_id2str(spool, type), 1);
if (type < REPOKEY_TYPE_VOID || type > REPOKEY_TYPE_FLEXARRAY)
{
- pool_debug(pool, SAT_ERROR, "unsupported data type '%s'\n", id2str(pool, type));
+ pool_debug(pool, SAT_ERROR, "unsupported data type '%s'\n", pool_id2str(pool, type));
data.error = SOLV_ERROR_UNSUPPORTED;
type = REPOKEY_TYPE_VOID;
}
@@ -869,7 +869,7 @@ repo_add_solv_flags(Repo *repo, FILE *fp, int flags)
if (keys[i].type == REPOKEY_TYPE_CONSTANTID && idmap)
keys[i].size = idmap[keys[i].size];
#if 0
- fprintf(stderr, "key %d %s %s %d %d\n", i, id2str(pool,id), id2str(pool, keys[i].type),
+ fprintf(stderr, "key %d %s %s %d %d\n", i, pool_id2str(pool,id), pool_id2str(pool, keys[i].type),
keys[i].size, keys[i].storage);
#endif
}
@@ -1040,7 +1040,7 @@ printf("pop flexarray %d %d\n", keydepth, nentries);
data.mainschemaoffsets[keyp - 1 - (schemadata + schemata[data.mainschema])] = data.incoredatalen;
#if 0
-printf("=> %s %s %p\n", id2str(pool, keys[key].name), id2str(pool, keys[key].type), s);
+printf("=> %s %s %p\n", pool_id2str(pool, keys[key].name), pool_id2str(pool, keys[key].type), s);
#endif
id = keys[key].name;
if (keys[key].storage == KEY_STORAGE_VERTICAL_OFFSET)
@@ -1066,13 +1066,13 @@ printf("=> %s %s %p\n", id2str(pool, keys[key].name), id2str(pool, keys[key].typ
else if (keys[key].storage == KEY_STORAGE_INCORE)
incore_add_id(&data, did);
#if 0
- POOL_DEBUG(SAT_DEBUG_STATS, "%s -> %s\n", id2str(pool, id), id2str(pool, did));
+ POOL_DEBUG(SAT_DEBUG_STATS, "%s -> %s\n", pool_id2str(pool, id), pool_id2str(pool, did));
#endif
break;
case REPOKEY_TYPE_U32:
dp = data_read_u32(dp, &h);
#if 0
- POOL_DEBUG(SAT_DEBUG_STATS, "%s -> %u\n", id2str(pool, id), h);
+ POOL_DEBUG(SAT_DEBUG_STATS, "%s -> %u\n", pool_id2str(pool, id), h);
#endif
if (s && id == RPM_RPMDBID)
{
@@ -1129,9 +1129,9 @@ printf("=> %s %s %p\n", id2str(pool, keys[key].name), id2str(pool, keys[key].typ
else if (id == SOLVABLE_ENHANCES)
s->enhances = ido;
#if 0
- POOL_DEBUG(SAT_DEBUG_STATS, "%s ->\n", id2str(pool, id));
+ POOL_DEBUG(SAT_DEBUG_STATS, "%s ->\n", pool_id2str(pool, id));
for (; repo->idarraydata[ido]; ido++)
- POOL_DEBUG(SAT_DEBUG_STATS," %s\n", dep2str(pool, repo->idarraydata[ido]));
+ POOL_DEBUG(SAT_DEBUG_STATS," %s\n", pool_dep2str(pool, repo->idarraydata[ido]));
#endif
break;
case REPOKEY_TYPE_FIXARRAY:
diff --git a/src/repodata.c b/src/repodata.c
index 7b8682e..70718f4 100644
--- a/src/repodata.c
+++ b/src/repodata.c
@@ -267,7 +267,7 @@ repodata_str2dir(Repodata *data, const char *dir, int create)
if (data->localpool)
id = stringpool_strn2id(&data->spool, dir, dire - dir, create);
else
- id = strn2id(data->repo->pool, dir, dire - dir, create);
+ id = pool_strn2id(data->repo->pool, dir, dire - dir, create);
if (!id)
return 0;
parent = dirpool_add_dir(&data->dirpool, parent, id, create);
@@ -612,7 +612,7 @@ repodata_lookup_str(Repodata *data, Id solvid, Id keyname)
return 0;
if (data->localpool)
return stringpool_id2str(&data->spool, id);
- return id2str(data->repo->pool, id);
+ return pool_id2str(data->repo->pool, id);
}
int
@@ -699,7 +699,7 @@ repodata_globalize_id(Repodata *data, Id id, int create)
{
if (!id || !data || !data->localpool)
return id;
- return str2id(data->repo->pool, stringpool_id2str(&data->spool, id), create);
+ return pool_str2id(data->repo->pool, stringpool_id2str(&data->spool, id), create);
}
Id
@@ -707,7 +707,7 @@ repodata_localize_id(Repodata *data, Id id, int create)
{
if (!id || !data || !data->localpool)
return id;
- return stringpool_str2id(&data->spool, id2str(data->repo->pool, id), create);
+ return stringpool_str2id(&data->spool, pool_id2str(data->repo->pool, id), create);
}
@@ -727,7 +727,7 @@ repodata_stringify(Pool *pool, Repodata *data, Repokey *key, KeyValue *kv, int f
if (data && data->localpool)
kv->str = stringpool_id2str(&data->spool, kv->id);
else
- kv->str = id2str(pool, kv->id);
+ kv->str = pool_id2str(pool, kv->id);
if ((flags & SEARCH_SKIP_KIND) != 0 && key->storage == KEY_STORAGE_SOLVABLE)
{
const char *s;
@@ -1935,7 +1935,7 @@ repodata_set_poolstr(Repodata *data, Id solvid, Id keyname, const char *str)
if (data->localpool)
id = stringpool_str2id(&data->spool, str, 1);
else
- id = str2id(data->repo->pool, str, 1);
+ id = pool_str2id(data->repo->pool, str, 1);
key.name = keyname;
key.type = REPOKEY_TYPE_ID;
key.size = 0;
@@ -2134,7 +2134,7 @@ repodata_chk2str(Repodata *data, Id type, const unsigned char *buf)
static inline const char *
evrid2vrstr(Pool *pool, Id evrid)
{
- const char *p, *evr = id2str(pool, evrid);
+ const char *p, *evr = pool_id2str(pool, evrid);
if (!evr)
return evr;
for (p = evr; *p >= '0' && *p <= '9'; p++)
@@ -2175,7 +2175,7 @@ repodata_set_location(Repodata *data, Id solvid, int medianr, const char *dir, c
s = pool->solvables + solvid;
if (dir && l)
{
- str = id2str(pool, s->arch);
+ str = pool_id2str(pool, s->arch);
if (!strncmp(dir, str, l) && !str[l])
repodata_set_void(data, solvid, SOLVABLE_MEDIADIR);
else if (!dir[l])
@@ -2189,7 +2189,7 @@ repodata_set_location(Repodata *data, Id solvid, int medianr, const char *dir, c
}
}
fp = file;
- str = id2str(pool, s->name);
+ str = pool_id2str(pool, s->name);
l = strlen(str);
if ((!l || !strncmp(fp, str, l)) && fp[l] == '-')
{
@@ -2199,7 +2199,7 @@ repodata_set_location(Repodata *data, Id solvid, int medianr, const char *dir, c
if ((!l || !strncmp(fp, str, l)) && fp[l] == '.')
{
fp += l + 1;
- str = id2str(pool, s->arch);
+ str = pool_id2str(pool, s->arch);
l = strlen(str);
if ((!l || !strncmp(fp, str, l)) && !strcmp(fp + l, ".rpm"))
{
@@ -2283,7 +2283,7 @@ repodata_add_poolstr_array(Repodata *data, Id solvid, Id keyname,
if (data->localpool)
id = stringpool_str2id(&data->spool, str, 1);
else
- id = str2id(data->repo->pool, str, 1);
+ id = pool_str2id(data->repo->pool, str, 1);
repodata_add_idarray(data, solvid, keyname, id);
}
@@ -2700,7 +2700,7 @@ fprintf(stderr, "schemadata %p\n", data->schemadata);
}
key = data->keys + *keyp;
#if 0
- fprintf(stderr, "internalize %d(%d):%s:%s\n", entry, entry + data->start, id2str(data->repo->pool, key->name), id2str(data->repo->pool, key->type));
+ fprintf(stderr, "internalize %d(%d):%s:%s\n", entry, entry + data->start, pool_id2str(data->repo->pool, key->name), pool_id2str(data->repo->pool, key->type));
#endif
ndp = dp;
if (oldcount)
diff --git a/src/rules.c b/src/rules.c
index 8543d44..344c4e8 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -516,12 +516,12 @@ solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m)
&& s->arch != ARCH_NOSRC
&& !pool_installable(pool, s))
{
- POOL_DEBUG(SAT_DEBUG_RULE_CREATION, "package %s [%d] is not installable\n", solvable2str(pool, s), (Id)(s - pool->solvables));
+ POOL_DEBUG(SAT_DEBUG_RULE_CREATION, "package %s [%d] is not installable\n", pool_solvable2str(pool, s), (Id)(s - pool->solvables));
addrpmrule(solv, -n, 0, SOLVER_RULE_RPM_NOT_INSTALLABLE, 0);
}
/* yet another SUSE hack, sigh */
- if (pool->nscallback && !strncmp("product:", id2str(pool, s->name), 8))
+ if (pool->nscallback && !strncmp("product:", pool_id2str(pool, s->name), 8))
{
Id buddy = pool->nscallback(pool, pool->nscallbackdata, NAMESPACE_PRODUCTBUDDY, n);
if (buddy > 0 && buddy != SYSTEMSOLVABLE && buddy != n && buddy < pool->nsolvables)
@@ -567,7 +567,7 @@ solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m)
/* didn't find an installed provider: previously broken dependency */
if (!p)
{
- POOL_DEBUG(SAT_DEBUG_RULE_CREATION, "ignoring broken requires %s of installed package %s\n", dep2str(pool, req), solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RULE_CREATION, "ignoring broken requires %s of installed package %s\n", pool_dep2str(pool, req), pool_solvable2str(pool, s));
continue;
}
}
@@ -575,16 +575,16 @@ solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m)
if (!*dp)
{
/* nothing provides req! */
- POOL_DEBUG(SAT_DEBUG_RULE_CREATION, "package %s [%d] is not installable (%s)\n", solvable2str(pool, s), (Id)(s - pool->solvables), dep2str(pool, req));
+ POOL_DEBUG(SAT_DEBUG_RULE_CREATION, "package %s [%d] is not installable (%s)\n", pool_solvable2str(pool, s), (Id)(s - pool->solvables), pool_dep2str(pool, req));
addrpmrule(solv, -n, 0, SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP, req);
continue;
}
IF_POOLDEBUG (SAT_DEBUG_RULE_CREATION)
{
- POOL_DEBUG(SAT_DEBUG_RULE_CREATION," %s requires %s\n", solvable2str(pool, s), dep2str(pool, req));
+ POOL_DEBUG(SAT_DEBUG_RULE_CREATION," %s requires %s\n", pool_solvable2str(pool, s), pool_dep2str(pool, req));
for (i = 0; dp[i]; i++)
- POOL_DEBUG(SAT_DEBUG_RULE_CREATION, " provided by %s\n", solvid2str(pool, dp[i]));
+ POOL_DEBUG(SAT_DEBUG_RULE_CREATION, " provided by %s\n", pool_solvid2str(pool, dp[i]));
}
/* add 'requires' dependency */
@@ -624,7 +624,7 @@ solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m)
* XXX: we should really handle this different, looking
* at the name is a bad hack
*/
- if (!strncmp("patch:", id2str(pool, s->name), 6))
+ if (!strncmp("patch:", pool_id2str(pool, s->name), 6))
ispatch = 1;
conp = s->repo->idarraydata + s->conflicts;
/* foreach conflicts of 's' */
@@ -1363,7 +1363,7 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q)
if (rd->flags == REL_EQ && select == SOLVER_SOLVABLE_NAME)
{
#if !defined(DEBIAN_SEMANTICS)
- const char *evr = id2str(pool, rd->evr);
+ const char *evr = pool_id2str(pool, rd->evr);
if (strchr(evr, '-'))
set |= SOLVER_SETEVR;
else
@@ -1527,7 +1527,7 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q)
if (illegal && illegal == POLICY_ILLEGAL_DOWNGRADE && (set & SOLVER_SETEV) != 0)
{
/* it's ok if the EV is different */
- if (evrcmp(pool, is->evr, s->evr, EVRCMP_COMPARE_EVONLY) != 0)
+ if (pool_evrcmp(pool, is->evr, s->evr, EVRCMP_COMPARE_EVONLY) != 0)
illegal = 0;
}
if (illegal)
@@ -2209,7 +2209,7 @@ static void solver_createcleandepsmap(Solver *solv)
continue;
MAPCLR(&im, ip);
#ifdef CLEANDEPSDEBUG
- printf("hello %s\n", solvable2str(pool, s));
+ printf("hello %s\n", pool_solvable2str(pool, s));
#endif
if (s->requires)
{
@@ -2232,7 +2232,7 @@ static void solver_createcleandepsmap(Solver *solv)
if (MAPTST(&im, p))
{
#ifdef CLEANDEPSDEBUG
- printf("%s requires %s\n", solvid2str(pool, ip), solvid2str(pool, p));
+ printf("%s requires %s\n", pool_solvid2str(pool, ip), pool_solvid2str(pool, p));
#endif
queue_push(&iq, p);
}
@@ -2257,7 +2257,7 @@ static void solver_createcleandepsmap(Solver *solv)
if (MAPTST(&im, p))
{
#ifdef CLEANDEPSDEBUG
- printf("%s recommends %s\n", solvid2str(pool, ip), solvid2str(pool, p));
+ printf("%s recommends %s\n", pool_solvid2str(pool, ip), pool_solvid2str(pool, p));
#endif
queue_push(&iq, p);
}
@@ -2284,7 +2284,7 @@ static void solver_createcleandepsmap(Solver *solv)
if (sup)
{
#ifdef CLEANDEPSDEBUG
- printf("%s supplemented\n", solvid2str(pool, ip));
+ printf("%s supplemented\n", pool_solvid2str(pool, ip));
#endif
queue_push(&iq, ip);
}
@@ -2334,7 +2334,7 @@ static void solver_createcleandepsmap(Solver *solv)
ip = queue_shift(&iq);
s = pool->solvables + ip;
#ifdef CLEANDEPSDEBUG
- printf("bye %s\n", solvable2str(pool, s));
+ printf("bye %s\n", pool_solvable2str(pool, s));
#endif
if (s->requires)
{
@@ -2350,7 +2350,7 @@ static void solver_createcleandepsmap(Solver *solv)
if (MAPTST(&userinstalled, p - installed->start))
continue;
#ifdef CLEANDEPSDEBUG
- printf("%s requires %s\n", solvid2str(pool, ip), solvid2str(pool, p));
+ printf("%s requires %s\n", pool_solvid2str(pool, ip), pool_solvid2str(pool, p));
#endif
MAPSET(&im, p);
queue_push(&iq, p);
@@ -2372,7 +2372,7 @@ static void solver_createcleandepsmap(Solver *solv)
if (MAPTST(&userinstalled, p - installed->start))
continue;
#ifdef CLEANDEPSDEBUG
- printf("%s recommends %s\n", solvid2str(pool, ip), solvid2str(pool, p));
+ printf("%s recommends %s\n", pool_solvid2str(pool, ip), pool_solvid2str(pool, p));
#endif
MAPSET(&im, p);
queue_push(&iq, p);
@@ -2401,7 +2401,7 @@ static void solver_createcleandepsmap(Solver *solv)
if (sup)
{
#ifdef CLEANDEPSDEBUG
- printf("%s supplemented\n", solvid2str(pool, ip));
+ printf("%s supplemented\n", pool_solvid2str(pool, ip));
#endif
MAPSET(&im, ip);
queue_push(&iq, ip);
diff --git a/src/solvable.c b/src/solvable.c
index a039836..ef9bd4c 100644
--- a/src/solvable.c
+++ b/src/solvable.c
@@ -27,9 +27,9 @@ pool_solvable2str(Pool *pool, Solvable *s)
{
const char *n, *e, *a;
char *p;
- n = id2str(pool, s->name);
- e = id2str(pool, s->evr);
- a = id2str(pool, s->arch);
+ n = pool_id2str(pool, s->name);
+ e = pool_id2str(pool, s->evr);
+ a = pool_id2str(pool, s->arch);
p = pool_alloctmpspace(pool, strlen(n) + strlen(e) + strlen(a) + 3);
sprintf(p, "%s-%s.%s", n, e, a);
return p;
@@ -215,7 +215,7 @@ solvable_lookup_checksum(Solvable *s, Id keyname, Id *typep)
static inline const char *
evrid2vrstr(Pool *pool, Id evrid)
{
- const char *p, *evr = id2str(pool, evrid);
+ const char *p, *evr = pool_id2str(pool, evrid);
if (!evr)
return evr;
for (p = evr; *p >= '0' && *p <= '9'; p++)
@@ -239,7 +239,7 @@ solvable_get_location(Solvable *s, unsigned int *medianrp)
if (medianrp)
*medianrp = solvable_lookup_num(s, SOLVABLE_MEDIANR, 1);
if (solvable_lookup_void(s, SOLVABLE_MEDIADIR))
- mediadir = id2str(pool, s->arch);
+ mediadir = pool_id2str(pool, s->arch);
else
mediadir = solvable_lookup_str(s, SOLVABLE_MEDIADIR);
if (mediadir)
@@ -247,9 +247,9 @@ solvable_get_location(Solvable *s, unsigned int *medianrp)
if (solvable_lookup_void(s, SOLVABLE_MEDIAFILE))
{
const char *name, *evr, *arch;
- name = id2str(pool, s->name);
+ name = pool_id2str(pool, s->name);
evr = evrid2vrstr(pool, s->evr);
- arch = id2str(pool, s->arch);
+ arch = pool_id2str(pool, s->arch);
/* name-vr.arch.rpm */
loc = pool_alloctmpspace(pool, l + strlen(name) + strlen(evr) + strlen(arch) + 7);
if (mediadir)
@@ -560,5 +560,5 @@ solvable_selfprovidedep(Solvable *s)
return prov;
}
}
- return rel2id(pool, s->name, s->evr, REL_EQ, 1);
+ return pool_rel2id(pool, s->name, s->evr, REL_EQ, 1);
}
diff --git a/src/solver.c b/src/solver.c
index 6f5b98a..2105879 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -149,9 +149,9 @@ makeruledecisions(Solver *solv)
{
Solvable *s = solv->pool->solvables + vv;
if (v < 0)
- POOL_DEBUG(SAT_DEBUG_PROPAGATE, "conflicting %s (assertion)\n", solvable2str(solv->pool, s));
+ POOL_DEBUG(SAT_DEBUG_PROPAGATE, "conflicting %s (assertion)\n", pool_solvable2str(solv->pool, s));
else
- POOL_DEBUG(SAT_DEBUG_PROPAGATE, "installing %s (assertion)\n", solvable2str(solv->pool, s));
+ POOL_DEBUG(SAT_DEBUG_PROPAGATE, "installing %s (assertion)\n", pool_solvable2str(solv->pool, s));
}
continue;
}
@@ -334,9 +334,9 @@ makeruledecisions(Solver *solv)
{
Solvable *s = solv->pool->solvables + vv;
if (v < 0)
- POOL_DEBUG(SAT_DEBUG_PROPAGATE, "conflicting %s (weak assertion)\n", solvable2str(solv->pool, s));
+ POOL_DEBUG(SAT_DEBUG_PROPAGATE, "conflicting %s (weak assertion)\n", pool_solvable2str(solv->pool, s));
else
- POOL_DEBUG(SAT_DEBUG_PROPAGATE, "installing %s (weak assertion)\n", solvable2str(solv->pool, s));
+ POOL_DEBUG(SAT_DEBUG_PROPAGATE, "installing %s (weak assertion)\n", pool_solvable2str(solv->pool, s));
}
continue;
}
@@ -617,9 +617,9 @@ propagate(Solver *solv, int level)
IF_POOLDEBUG (SAT_DEBUG_PROPAGATE)
{
if (p > 0)
- POOL_DEBUG(SAT_DEBUG_PROPAGATE, " -> move w%d to %s\n", (pkg == r->w1 ? 1 : 2), solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_PROPAGATE, " -> move w%d to %s\n", (pkg == r->w1 ? 1 : 2), pool_solvid2str(pool, p));
else
- POOL_DEBUG(SAT_DEBUG_PROPAGATE," -> move w%d to !%s\n", (pkg == r->w1 ? 1 : 2), solvid2str(pool, -p));
+ POOL_DEBUG(SAT_DEBUG_PROPAGATE," -> move w%d to !%s\n", (pkg == r->w1 ? 1 : 2), pool_solvid2str(pool, -p));
}
*rp = *next_rp;
@@ -666,9 +666,9 @@ propagate(Solver *solv, int level)
IF_POOLDEBUG (SAT_DEBUG_PROPAGATE)
{
if (other_watch > 0)
- POOL_DEBUG(SAT_DEBUG_PROPAGATE, " -> decided to install %s\n", solvid2str(pool, other_watch));
+ POOL_DEBUG(SAT_DEBUG_PROPAGATE, " -> decided to install %s\n", pool_solvid2str(pool, other_watch));
else
- POOL_DEBUG(SAT_DEBUG_PROPAGATE, " -> decided to conflict %s\n", solvid2str(pool, -other_watch));
+ POOL_DEBUG(SAT_DEBUG_PROPAGATE, " -> decided to conflict %s\n", pool_solvid2str(pool, -other_watch));
}
} /* foreach rule involving 'pkg' */
@@ -1236,7 +1236,7 @@ selectandinstall(Solver *solv, int level, Queue *dq, int disablerules, Id ruleid
}
p = dq->elements[0];
- POOL_DEBUG(SAT_DEBUG_POLICY, "installing %s\n", solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_POLICY, "installing %s\n", pool_solvid2str(pool, p));
return setpropagatelearn(solv, level, p, disablerules, ruleid);
}
@@ -1596,12 +1596,12 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
olevel = level;
if (solv->cleandepsmap.size && MAPTST(&solv->cleandepsmap, i - installed->start))
{
- POOL_DEBUG(SAT_DEBUG_POLICY, "cleandeps erasing %s\n", solvid2str(pool, i));
+ POOL_DEBUG(SAT_DEBUG_POLICY, "cleandeps erasing %s\n", pool_solvid2str(pool, i));
level = setpropagatelearn(solv, level, -i, disablerules, 0);
}
else
{
- POOL_DEBUG(SAT_DEBUG_POLICY, "keeping %s\n", solvid2str(pool, i));
+ POOL_DEBUG(SAT_DEBUG_POLICY, "keeping %s\n", pool_solvid2str(pool, i));
level = setpropagatelearn(solv, level, i, disablerules, r - solv->rules);
}
if (level == 0)
@@ -1894,9 +1894,9 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
/* simple case, just one package. no need to choose */
p = dq.elements[0];
if (dqs.count)
- POOL_DEBUG(SAT_DEBUG_POLICY, "installing supplemented %s\n", solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_POLICY, "installing supplemented %s\n", pool_solvid2str(pool, p));
else
- POOL_DEBUG(SAT_DEBUG_POLICY, "installing recommended %s\n", solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_POLICY, "installing recommended %s\n", pool_solvid2str(pool, p));
queue_push(&solv->recommendations, p);
level = setpropagatelearn(solv, level, p, 0, 0);
continue; /* back to main loop */
@@ -1916,7 +1916,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
p = dqs.elements[i];
if (solv->decisionmap[p] || !MAPTST(&dqmap, p))
continue;
- POOL_DEBUG(SAT_DEBUG_POLICY, "installing supplemented %s\n", solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_POLICY, "installing supplemented %s\n", pool_solvid2str(pool, p));
queue_push(&solv->recommendations, p);
olevel = level;
level = setpropagatelearn(solv, level, p, 0, 0);
@@ -1967,7 +1967,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
queue_push(&solv->branches, -level);
}
p = dq.elements[0];
- POOL_DEBUG(SAT_DEBUG_POLICY, "installing recommended %s\n", solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_POLICY, "installing recommended %s\n", pool_solvid2str(pool, p));
queue_push(&solv->recommendations, p);
olevel = level;
level = setpropagatelearn(solv, level, p, 0, 0);
@@ -1999,7 +1999,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
continue;
if (solv->droporphanedmap.size && MAPTST(&solv->droporphanedmap, p - solv->installed->start))
continue;
- POOL_DEBUG(SAT_DEBUG_SOLVER, "keeping orphaned %s\n", solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_SOLVER, "keeping orphaned %s\n", pool_solvid2str(pool, p));
level = setpropagatelearn(solv, level, p, 0, 0);
installedone = 1;
if (level < olevel)
@@ -2012,7 +2012,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
p = solv->orphaned.elements[i];
if (solv->decisionmap[p])
continue; /* already decided */
- POOL_DEBUG(SAT_DEBUG_SOLVER, "removing orphaned %s\n", solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_SOLVER, "removing orphaned %s\n", pool_solvid2str(pool, p));
olevel = level;
level = setpropagatelearn(solv, level, -p, 0, 0);
if (level < olevel)
@@ -2035,7 +2035,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
if (solv->branches.elements[i - 1] < 0)
break;
p = solv->branches.elements[i];
- POOL_DEBUG(SAT_DEBUG_SOLVER, "branching with %s\n", solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_SOLVER, "branching with %s\n", pool_solvid2str(pool, p));
queue_empty(&dq);
for (j = i + 1; j < solv->branches.count; j++)
queue_push(&dq, solv->branches.elements[j]);
@@ -2084,7 +2084,7 @@ solver_run_sat(Solver *solv, int disablerules, int doweak)
/* kill old solvable so that we do not loop */
p = solv->branches.elements[lasti];
solv->branches.elements[lasti] = 0;
- POOL_DEBUG(SAT_DEBUG_SOLVER, "minimizing %d -> %d with %s\n", solv->decisionmap[p], lastl, solvid2str(pool, p));
+ POOL_DEBUG(SAT_DEBUG_SOLVER, "minimizing %d -> %d with %s\n", solv->decisionmap[p], lastl, pool_solvid2str(pool, p));
minimizationsteps++;
level = lastl;
@@ -2156,7 +2156,7 @@ removedisabledconflicts(Solver *solv, Queue *removed)
if (r->d < 0 && decisionmap[-p])
{
/* rule is now disabled, remove from decisionmap */
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "removing conflict for package %s[%d]\n", solvid2str(pool, -p), -p);
+ POOL_DEBUG(SAT_DEBUG_SCHUBI, "removing conflict for package %s[%d]\n", pool_solvid2str(pool, -p), -p);
queue_push(removed, -p);
queue_push(removed, decisionmap[-p]);
decisionmap[-p] = 0;
@@ -2219,7 +2219,7 @@ removedisabledconflicts(Solver *solv, Queue *removed)
}
if (new)
{
- POOL_DEBUG(SAT_DEBUG_SCHUBI, "re-conflicting package %s[%d]\n", solvid2str(pool, -new), -new);
+ POOL_DEBUG(SAT_DEBUG_SCHUBI, "re-conflicting package %s[%d]\n", pool_solvid2str(pool, -new), -new);
decisionmap[-new] = -1;
new = 0;
n = 0; /* redo all rules */
diff --git a/src/solver.h b/src/solver.h
index 18c1612..16f6daf 100644
--- a/src/solver.h
+++ b/src/solver.h
@@ -257,7 +257,8 @@ typedef struct _Solver {
#define SOLVER_SETMASK 0x2f000000
/* old API compatibility, do not use in new code */
-#if 1
+#ifdef OBSOLETE_INTERFACE
+
#define SOLVER_INSTALL_SOLVABLE (SOLVER_INSTALL|SOLVER_SOLVABLE)
#define SOLVER_ERASE_SOLVABLE (SOLVER_ERASE|SOLVER_SOLVABLE)
#define SOLVER_INSTALL_SOLVABLE_NAME (SOLVER_INSTALL|SOLVER_SOLVABLE_NAME)
@@ -270,7 +271,6 @@ typedef struct _Solver {
#define SOLVER_NOOBSOLETES_SOLVABLE (SOLVER_NOOBSOLETES|SOLVER_SOLVABLE)
#define SOLVER_NOOBSOLETES_SOLVABLE_NAME (SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_NAME)
#define SOLVER_NOOBSOLETES_SOLVABLE_PROVIDES (SOLVER_NOOBSOLETES|SOLVER_SOLVABLE_PROVIDES)
-#endif
/* backward compatibility */
#define SOLVER_PROBLEM_UPDATE_RULE SOLVER_RULE_UPDATE
@@ -287,6 +287,8 @@ typedef struct _Solver {
#define SOLVER_PROBLEM_DISTUPGRADE_RULE SOLVER_RULE_DISTUPGRADE
#define SOLVER_PROBLEM_INFARCH_RULE SOLVER_RULE_INFARCH
+#endif
+
extern Solver *solver_create(Pool *pool);
extern void solver_free(Solver *solv);
diff --git a/src/solverdebug.c b/src/solverdebug.c
index 4530a7d..94f657e 100644
--- a/src/solverdebug.c
+++ b/src/solverdebug.c
@@ -129,12 +129,12 @@ solver_printruleelement(Solver *solv, int type, Rule *r, Id v)
if (v < 0)
{
s = pool->solvables + -v;
- POOL_DEBUG(type, " !%s [%d]", solvable2str(pool, s), -v);
+ POOL_DEBUG(type, " !%s [%d]", pool_solvable2str(pool, s), -v);
}
else
{
s = pool->solvables + v;
- POOL_DEBUG(type, " %s [%d]", solvable2str(pool, s), v);
+ POOL_DEBUG(type, " %s [%d]", pool_solvable2str(pool, s), v);
}
if (pool->installed && s->repo == pool->installed)
POOL_DEBUG(type, "I");
@@ -268,9 +268,9 @@ solver_printdecisionq(Solver *solv, int type)
{
p = solv->decisionq.elements[i];
if (p > 0)
- POOL_DEBUG(type, "%d %d install %s, ", i, solv->decisionmap[p], solvid2str(pool, p));
+ POOL_DEBUG(type, "%d %d install %s, ", i, solv->decisionmap[p], pool_solvid2str(pool, p));
else
- POOL_DEBUG(type, "%d %d conflict %s, ", i, -solv->decisionmap[-p], solvid2str(pool, -p));
+ POOL_DEBUG(type, "%d %d conflict %s, ", i, -solv->decisionmap[-p], pool_solvid2str(pool, -p));
why = solv->decisionq_why.elements[i];
if (why > 0)
{
@@ -324,29 +324,29 @@ solver_printdecisions(Solver *solv)
switch(type)
{
case SOLVER_TRANSACTION_MULTIINSTALL:
- POOL_DEBUG(SAT_DEBUG_RESULT, " multi install %s", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " multi install %s", pool_solvable2str(pool, s));
break;
case SOLVER_TRANSACTION_MULTIREINSTALL:
- POOL_DEBUG(SAT_DEBUG_RESULT, " multi reinstall %s", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " multi reinstall %s", pool_solvable2str(pool, s));
break;
case SOLVER_TRANSACTION_INSTALL:
- POOL_DEBUG(SAT_DEBUG_RESULT, " install %s", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " install %s", pool_solvable2str(pool, s));
break;
case SOLVER_TRANSACTION_REINSTALL:
- POOL_DEBUG(SAT_DEBUG_RESULT, " reinstall %s", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " reinstall %s", pool_solvable2str(pool, s));
break;
case SOLVER_TRANSACTION_DOWNGRADE:
- POOL_DEBUG(SAT_DEBUG_RESULT, " downgrade %s", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " downgrade %s", pool_solvable2str(pool, s));
break;
case SOLVER_TRANSACTION_CHANGE:
- POOL_DEBUG(SAT_DEBUG_RESULT, " change %s", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " change %s", pool_solvable2str(pool, s));
break;
case SOLVER_TRANSACTION_UPGRADE:
case SOLVER_TRANSACTION_OBSOLETES:
- POOL_DEBUG(SAT_DEBUG_RESULT, " upgrade %s", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " upgrade %s", pool_solvable2str(pool, s));
break;
case SOLVER_TRANSACTION_ERASE:
- POOL_DEBUG(SAT_DEBUG_RESULT, " erase %s", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " erase %s", pool_solvable2str(pool, s));
break;
default:
break;
@@ -369,7 +369,7 @@ solver_printdecisions(Solver *solv)
{
POOL_DEBUG(SAT_DEBUG_RESULT, " (obsoletes");
for (j = 0; j < iq.count; j++)
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s", solvid2str(pool, iq.elements[j]));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s", pool_solvid2str(pool, iq.elements[j]));
POOL_DEBUG(SAT_DEBUG_RESULT, ")");
}
POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
@@ -391,12 +391,12 @@ solver_printdecisions(Solver *solv)
if (solv->decisionmap[solv->recommendations.elements[i]] > 0)
{
if (installed && s->repo == installed)
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s (installed)\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s (installed)\n", pool_solvable2str(pool, s));
else
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s (selected)\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s (selected)\n", pool_solvable2str(pool, s));
}
else
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", pool_solvable2str(pool, s));
}
POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
}
@@ -410,12 +410,12 @@ solver_printdecisions(Solver *solv)
if (solv->decisionmap[solv->suggestions.elements[i]] > 0)
{
if (installed && s->repo == installed)
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s (installed)\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s (installed)\n", pool_solvable2str(pool, s));
else
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s (selected)\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s (selected)\n", pool_solvable2str(pool, s));
}
else
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s\n", pool_solvable2str(pool, s));
}
POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
}
@@ -426,9 +426,9 @@ solver_printdecisions(Solver *solv)
{
s = pool->solvables + solv->orphaned.elements[i];
if (solv->decisionmap[solv->orphaned.elements[i]] > 0)
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s (kept)\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s (kept)\n", pool_solvable2str(pool, s));
else
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s (erased)\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s (erased)\n", pool_solvable2str(pool, s));
}
POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
}
@@ -437,7 +437,7 @@ solver_printdecisions(Solver *solv)
static inline
const char *id2strnone(Pool *pool, Id id)
{
- return !id || id == 1 ? "(none)" : id2str(pool, id);
+ return !id || id == 1 ? "(none)" : pool_id2str(pool, id);
}
void
@@ -482,7 +482,7 @@ solver_printtransaction(Solver *solv)
POOL_DEBUG(SAT_DEBUG_RESULT, "%d vendor changes from '%s' to '%s':\n", cnt, id2strnone(pool, classes.elements[i + 2]), id2strnone(pool, classes.elements[i + 3]));
break;
case SOLVER_TRANSACTION_ARCHCHANGE:
- POOL_DEBUG(SAT_DEBUG_RESULT, "%d arch changes from %s to %s:\n", cnt, id2str(pool, classes.elements[i + 2]), id2str(pool, classes.elements[i + 3]));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "%d arch changes from %s to %s:\n", cnt, pool_id2str(pool, classes.elements[i + 2]), pool_id2str(pool, classes.elements[i + 3]));
break;
default:
class = SOLVER_TRANSACTION_IGNORE;
@@ -504,11 +504,11 @@ solver_printtransaction(Solver *solv)
case SOLVER_TRANSACTION_DOWNGRADED:
case SOLVER_TRANSACTION_UPGRADED:
s2 = pool->solvables + transaction_obs_pkg(trans, p);
- POOL_DEBUG(SAT_DEBUG_RESULT, " - %s -> %s\n", solvable2str(pool, s), solvable2str(pool, s2));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - %s -> %s\n", pool_solvable2str(pool, s), pool_solvable2str(pool, s2));
break;
case SOLVER_TRANSACTION_VENDORCHANGE:
case SOLVER_TRANSACTION_ARCHCHANGE:
- n = id2str(pool, s->name);
+ n = pool_id2str(pool, s->name);
l = strlen(n);
if (l + linel > sizeof(line) - 3)
{
@@ -531,7 +531,7 @@ solver_printtransaction(Solver *solv)
}
break;
default:
- POOL_DEBUG(SAT_DEBUG_RESULT, " - %s\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - %s\n", pool_solvable2str(pool, s));
break;
}
}
@@ -552,49 +552,49 @@ solver_printproblemruleinfo(Solver *solv, Id probr)
switch (solver_ruleinfo(solv, probr, &source, &target, &dep))
{
case SOLVER_RULE_DISTUPGRADE:
- POOL_DEBUG(SAT_DEBUG_RESULT, "%s does not belong to a distupgrade repository\n", solvid2str(pool, source));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "%s does not belong to a distupgrade repository\n", pool_solvid2str(pool, source));
return;
case SOLVER_RULE_INFARCH:
- POOL_DEBUG(SAT_DEBUG_RESULT, "%s has inferior architecture\n", solvid2str(pool, source));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "%s has inferior architecture\n", pool_solvid2str(pool, source));
return;
case SOLVER_RULE_UPDATE:
- POOL_DEBUG(SAT_DEBUG_RESULT, "problem with installed package %s\n", solvid2str(pool, source));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "problem with installed package %s\n", pool_solvid2str(pool, source));
return;
case SOLVER_RULE_JOB:
POOL_DEBUG(SAT_DEBUG_RESULT, "conflicting requests\n");
return;
case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
- POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides requested %s\n", dep2str(pool, dep));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides requested %s\n", pool_dep2str(pool, dep));
return;
case SOLVER_RULE_RPM:
POOL_DEBUG(SAT_DEBUG_RESULT, "some dependency problem\n");
return;
case SOLVER_RULE_RPM_NOT_INSTALLABLE:
- POOL_DEBUG(SAT_DEBUG_RESULT, "package %s is not installable\n", solvid2str(pool, source));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "package %s is not installable\n", pool_solvid2str(pool, source));
return;
case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
- POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides %s needed by %s\n", dep2str(pool, dep), solvid2str(pool, source));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "nothing provides %s needed by %s\n", pool_dep2str(pool, dep), pool_solvid2str(pool, source));
return;
case SOLVER_RULE_RPM_SAME_NAME:
- POOL_DEBUG(SAT_DEBUG_RESULT, "cannot install both %s and %s\n", solvid2str(pool, source), solvid2str(pool, target));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "cannot install both %s and %s\n", pool_solvid2str(pool, source), pool_solvid2str(pool, target));
return;
case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
- POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by %s\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep), pool_solvid2str(pool, target));
return;
case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
- POOL_DEBUG(SAT_DEBUG_RESULT, "package %s obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "package %s obsoletes %s provided by %s\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep), pool_solvid2str(pool, target));
return;
case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
- POOL_DEBUG(SAT_DEBUG_RESULT, "installed package %s obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "installed package %s obsoletes %s provided by %s\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep), pool_solvid2str(pool, target));
return;
case SOLVER_RULE_RPM_IMPLICIT_OBSOLETES:
- POOL_DEBUG(SAT_DEBUG_RESULT, "package %s implicitely obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "package %s implicitely obsoletes %s provided by %s\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep), pool_solvid2str(pool, target));
return;
case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
- POOL_DEBUG(SAT_DEBUG_RESULT, "package %s requires %s, but none of the providers can be installed\n", solvid2str(pool, source), dep2str(pool, dep));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "package %s requires %s, but none of the providers can be installed\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep));
return;
case SOLVER_RULE_RPM_SELF_CONFLICT:
- POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by itself\n", solvid2str(pool, source), dep2str(pool, dep));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "package %s conflicts with %s provided by itself\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep));
return;
case SOLVER_RULE_UNKNOWN:
case SOLVER_RULE_FEATURE:
@@ -659,7 +659,7 @@ solver_printsolution(Solver *solv, Id problem, Id solution)
{
case SOLVER_INSTALL:
if (select == SOLVER_SOLVABLE && solv->installed && pool->solvables[what].repo == solv->installed)
- POOL_DEBUG(SAT_DEBUG_RESULT, " - do not keep %s installed\n", solvid2str(pool, what));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - do not keep %s installed\n", pool_solvid2str(pool, what));
else if (select == SOLVER_SOLVABLE_PROVIDES)
POOL_DEBUG(SAT_DEBUG_RESULT, " - do not install a solvable %s\n", solver_select2str(pool, select, what));
else
@@ -667,7 +667,7 @@ solver_printsolution(Solver *solv, Id problem, Id solution)
break;
case SOLVER_ERASE:
if (select == SOLVER_SOLVABLE && !(solv->installed && pool->solvables[what].repo == solv->installed))
- POOL_DEBUG(SAT_DEBUG_RESULT, " - do not forbid installation of %s\n", solvid2str(pool, what));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - do not forbid installation of %s\n", pool_solvid2str(pool, what));
else if (select == SOLVER_SOLVABLE_PROVIDES)
POOL_DEBUG(SAT_DEBUG_RESULT, " - do not deinstall all solvables %s\n", solver_select2str(pool, select, what));
else
@@ -688,17 +688,17 @@ solver_printsolution(Solver *solv, Id problem, Id solution)
{
s = pool->solvables + rp;
if (solv->installed && s->repo == solv->installed)
- POOL_DEBUG(SAT_DEBUG_RESULT, " - keep %s despite the inferior architecture\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - keep %s despite the inferior architecture\n", pool_solvable2str(pool, s));
else
- POOL_DEBUG(SAT_DEBUG_RESULT, " - install %s despite the inferior architecture\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - install %s despite the inferior architecture\n", pool_solvable2str(pool, s));
}
else if (p == SOLVER_SOLUTION_DISTUPGRADE)
{
s = pool->solvables + rp;
if (solv->installed && s->repo == solv->installed)
- POOL_DEBUG(SAT_DEBUG_RESULT, " - keep obsolete %s\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - keep obsolete %s\n", pool_solvable2str(pool, s));
else
- POOL_DEBUG(SAT_DEBUG_RESULT, " - install %s from excluded repository\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - install %s from excluded repository\n", pool_solvable2str(pool, s));
}
else
{
@@ -709,22 +709,22 @@ solver_printsolution(Solver *solv, Id problem, Id solution)
{
int illegal = policy_is_illegal(solv, s, sd, 0);
if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
- POOL_DEBUG(SAT_DEBUG_RESULT, " - allow downgrade of %s to %s\n", solvable2str(pool, s), solvable2str(pool, sd));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - allow downgrade of %s to %s\n", pool_solvable2str(pool, s), pool_solvable2str(pool, sd));
if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
- POOL_DEBUG(SAT_DEBUG_RESULT, " - allow architecture change of %s to %s\n", solvable2str(pool, s), solvable2str(pool, sd));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - allow architecture change of %s to %s\n", pool_solvable2str(pool, s), pool_solvable2str(pool, sd));
if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
{
if (sd->vendor)
- POOL_DEBUG(SAT_DEBUG_RESULT, " - allow vendor change from '%s' (%s) to '%s' (%s)\n", id2str(pool, s->vendor), solvable2str(pool, s), id2str(pool, sd->vendor), solvable2str(pool, sd));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - allow vendor change from '%s' (%s) to '%s' (%s)\n", pool_id2str(pool, s->vendor), pool_solvable2str(pool, s), pool_id2str(pool, sd->vendor), pool_solvable2str(pool, sd));
else
- POOL_DEBUG(SAT_DEBUG_RESULT, " - allow vendor change from '%s' (%s) to no vendor (%s)\n", id2str(pool, s->vendor), solvable2str(pool, s), solvable2str(pool, sd));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - allow vendor change from '%s' (%s) to no vendor (%s)\n", pool_id2str(pool, s->vendor), pool_solvable2str(pool, s), pool_solvable2str(pool, sd));
}
if (!illegal)
- POOL_DEBUG(SAT_DEBUG_RESULT, " - allow replacement of %s with %s\n", solvable2str(pool, s), solvable2str(pool, sd));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - allow replacement of %s with %s\n", pool_solvable2str(pool, s), pool_solvable2str(pool, sd));
}
else
{
- POOL_DEBUG(SAT_DEBUG_RESULT, " - allow deinstallation of %s\n", solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " - allow deinstallation of %s\n", pool_solvable2str(pool, s));
}
}
}
@@ -773,7 +773,7 @@ solver_printtrivial(Solver *solv)
queue_init(&in);
for (p = 1, s = pool->solvables + p; p < solv->pool->nsolvables; p++, s++)
{
- n = id2str(pool, s->name);
+ n = pool_id2str(pool, s->name);
if (strncmp(n, "patch:", 6) != 0 && strncmp(n, "pattern:", 8) != 0)
continue;
queue_push(&in, p);
@@ -787,7 +787,7 @@ solver_printtrivial(Solver *solv)
solver_trivial_installable(solv, &in, &out);
POOL_DEBUG(SAT_DEBUG_RESULT, "trivial installable status:\n");
for (i = 0; i < in.count; i++)
- POOL_DEBUG(SAT_DEBUG_RESULT, " %s: %d\n", solvid2str(pool, in.elements[i]), out.elements[i]);
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %s: %d\n", pool_solvid2str(pool, in.elements[i]), out.elements[i]);
POOL_DEBUG(SAT_DEBUG_RESULT, "\n");
queue_free(&in);
queue_free(&out);
@@ -799,12 +799,12 @@ solver_select2str(Pool *pool, Id select, Id what)
const char *s;
char *b;
if (select == SOLVER_SOLVABLE)
- return solvid2str(pool, what);
+ return pool_solvid2str(pool, what);
if (select == SOLVER_SOLVABLE_NAME)
- return dep2str(pool, what);
+ return pool_dep2str(pool, what);
if (select == SOLVER_SOLVABLE_PROVIDES)
{
- s = dep2str(pool, what);
+ s = pool_dep2str(pool, what);
b = pool_alloctmpspace(pool, 11 + strlen(s));
sprintf(b, "providing %s", s);
return b;
@@ -815,7 +815,7 @@ solver_select2str(Pool *pool, Id select, Id what)
b = 0;
while ((p = pool->whatprovidesdata[what++]) != 0)
{
- s = solvid2str(pool, p);
+ s = pool_solvid2str(pool, p);
if (b)
b = pool_tmpappend(pool, b, ", ", s);
else
@@ -930,47 +930,47 @@ solver_problemruleinfo2str(Solver *solv, SolverRuleinfo type, Id source, Id targ
switch (type)
{
case SOLVER_RULE_DISTUPGRADE:
- return pool_tmpjoin(pool, solvid2str(pool, source), " does not belong to a distupgrade repository", 0);
+ return pool_tmpjoin(pool, pool_solvid2str(pool, source), " does not belong to a distupgrade repository", 0);
case SOLVER_RULE_INFARCH:
- return pool_tmpjoin(pool, solvid2str(pool, source), " has inferior architecture", 0);
+ return pool_tmpjoin(pool, pool_solvid2str(pool, source), " has inferior architecture", 0);
case SOLVER_RULE_UPDATE:
- return pool_tmpjoin(pool, "problem with installed package ", solvid2str(pool, source), 0);
+ return pool_tmpjoin(pool, "problem with installed package ", pool_solvid2str(pool, source), 0);
case SOLVER_RULE_JOB:
return "conflicting requests";
case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
- return pool_tmpjoin(pool, "nothing provides requested ", dep2str(pool, dep), 0);
+ return pool_tmpjoin(pool, "nothing provides requested ", pool_dep2str(pool, dep), 0);
case SOLVER_RULE_RPM:
return "some dependency problem";
case SOLVER_RULE_RPM_NOT_INSTALLABLE:
- return pool_tmpjoin(pool, "package ", solvid2str(pool, source), " is not installable");
+ return pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), " is not installable");
case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
- s = pool_tmpjoin(pool, "nothing provides ", dep2str(pool, dep), 0);
- return pool_tmpappend(pool, s, " needed by ", solvid2str(pool, source));
+ s = pool_tmpjoin(pool, "nothing provides ", pool_dep2str(pool, dep), 0);
+ return pool_tmpappend(pool, s, " needed by ", pool_solvid2str(pool, source));
case SOLVER_RULE_RPM_SAME_NAME:
- s = pool_tmpjoin(pool, "cannot install both ", solvid2str(pool, source), 0);
- return pool_tmpappend(pool, s, " and ", solvid2str(pool, target));
+ s = pool_tmpjoin(pool, "cannot install both ", pool_solvid2str(pool, source), 0);
+ return pool_tmpappend(pool, s, " and ", pool_solvid2str(pool, target));
case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
- s = pool_tmpjoin(pool, "package ", solvid2str(pool, source), 0);
- s = pool_tmpappend(pool, s, " conflicts with ", dep2str(pool, dep));
- return pool_tmpappend(pool, s, " provided by ", solvid2str(pool, target));
+ s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), 0);
+ s = pool_tmpappend(pool, s, " conflicts with ", pool_dep2str(pool, dep));
+ return pool_tmpappend(pool, s, " provided by ", pool_solvid2str(pool, target));
case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
- s = pool_tmpjoin(pool, "package ", solvid2str(pool, source), 0);
- s = pool_tmpappend(pool, s, " obsoletes ", dep2str(pool, dep));
- return pool_tmpappend(pool, s, " provided by ", solvid2str(pool, target));
+ s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), 0);
+ s = pool_tmpappend(pool, s, " obsoletes ", pool_dep2str(pool, dep));
+ return pool_tmpappend(pool, s, " provided by ", pool_solvid2str(pool, target));
case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
- s = pool_tmpjoin(pool, "installed package ", solvid2str(pool, source), 0);
- s = pool_tmpappend(pool, s, " obsoletes ", dep2str(pool, dep));
- return pool_tmpappend(pool, s, " provided by ", solvid2str(pool, target));
+ s = pool_tmpjoin(pool, "installed package ", pool_solvid2str(pool, source), 0);
+ s = pool_tmpappend(pool, s, " obsoletes ", pool_dep2str(pool, dep));
+ return pool_tmpappend(pool, s, " provided by ", pool_solvid2str(pool, target));
case SOLVER_RULE_RPM_IMPLICIT_OBSOLETES:
- s = pool_tmpjoin(pool, "package ", solvid2str(pool, source), 0);
- s = pool_tmpappend(pool, s, " implicitely obsoletes ", dep2str(pool, dep));
- return pool_tmpappend(pool, s, " provided by ", solvid2str(pool, target));
+ s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), 0);
+ s = pool_tmpappend(pool, s, " implicitely obsoletes ", pool_dep2str(pool, dep));
+ return pool_tmpappend(pool, s, " provided by ", pool_solvid2str(pool, target));
case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
- s = pool_tmpjoin(pool, "package ", solvid2str(pool, source), " requires ");
- return pool_tmpappend(pool, s, dep2str(pool, dep), ", but none of the providers can be installed");
+ s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), " requires ");
+ return pool_tmpappend(pool, s, pool_dep2str(pool, dep), ", but none of the providers can be installed");
case SOLVER_RULE_RPM_SELF_CONFLICT:
- s = pool_tmpjoin(pool, "package ", solvid2str(pool, source), " conflicts with ");
- return pool_tmpappend(pool, s, dep2str(pool, dep), " provided by itself");
+ s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), " conflicts with ");
+ return pool_tmpappend(pool, s, pool_dep2str(pool, dep), " provided by itself");
default:
return "bad problem rule type";
}
@@ -990,24 +990,24 @@ solver_solutionelement2str(Solver *solv, Id p, Id rp)
{
Solvable *s = pool->solvables + rp;
if (solv->installed && s->repo == solv->installed)
- return pool_tmpjoin(pool, "keep ", solvable2str(pool, s), " despite the inferior architecture");
+ return pool_tmpjoin(pool, "keep ", pool_solvable2str(pool, s), " despite the inferior architecture");
else
- return pool_tmpjoin(pool, "install ", solvable2str(pool, s), " despite the inferior architecture");
+ return pool_tmpjoin(pool, "install ", pool_solvable2str(pool, s), " despite the inferior architecture");
}
else if (p == SOLVER_SOLUTION_DISTUPGRADE)
{
Solvable *s = pool->solvables + rp;
if (solv->installed && s->repo == solv->installed)
- return pool_tmpjoin(pool, "keep obsolete ", solvable2str(pool, s), 0);
+ return pool_tmpjoin(pool, "keep obsolete ", pool_solvable2str(pool, s), 0);
else
- return pool_tmpjoin(pool, "install ", solvable2str(pool, s), " from excluded repository");
+ return pool_tmpjoin(pool, "install ", pool_solvable2str(pool, s), " from excluded repository");
}
else if (p > 0 && rp == 0)
- return pool_tmpjoin(pool, "allow deinstallation of ", solvid2str(pool, p), 0);
+ return pool_tmpjoin(pool, "allow deinstallation of ", pool_solvid2str(pool, p), 0);
else if (p > 0 && rp > 0)
{
- const char *sp = solvid2str(pool, p);
- const char *srp = solvid2str(pool, rp);
+ const char *sp = pool_solvid2str(pool, p);
+ const char *srp = pool_solvid2str(pool, rp);
const char *str = pool_tmpjoin(pool, "allow replacement of ", sp, 0);
return pool_tmpappend(pool, str, " with ", srp);
}
@@ -1022,25 +1022,25 @@ policy_illegal2str(Solver *solv, int illegal, Solvable *s, Solvable *rs)
const char *str;
if (illegal == POLICY_ILLEGAL_DOWNGRADE)
{
- str = pool_tmpjoin(pool, "downgrade of ", solvable2str(pool, s), 0);
- return pool_tmpappend(pool, str, " to ", solvable2str(pool, rs));
+ str = pool_tmpjoin(pool, "downgrade of ", pool_solvable2str(pool, s), 0);
+ return pool_tmpappend(pool, str, " to ", pool_solvable2str(pool, rs));
}
if (illegal == POLICY_ILLEGAL_ARCHCHANGE)
{
- str = pool_tmpjoin(pool, "architecture change of ", solvable2str(pool, s), 0);
- return pool_tmpappend(pool, str, " to ", solvable2str(pool, rs));
+ str = pool_tmpjoin(pool, "architecture change of ", pool_solvable2str(pool, s), 0);
+ return pool_tmpappend(pool, str, " to ", pool_solvable2str(pool, rs));
}
if (illegal == POLICY_ILLEGAL_VENDORCHANGE)
{
- str = pool_tmpjoin(pool, "vendor change from '", id2str(pool, s->vendor), "' (");
+ str = pool_tmpjoin(pool, "vendor change from '", pool_id2str(pool, s->vendor), "' (");
if (rs->vendor)
{
- str = pool_tmpappend(pool, str, solvable2str(pool, s), ") to '");
- str = pool_tmpappend(pool, str, id2str(pool, rs->vendor), "' (");
+ str = pool_tmpappend(pool, str, pool_solvable2str(pool, s), ") to '");
+ str = pool_tmpappend(pool, str, pool_id2str(pool, rs->vendor), "' (");
}
else
- str = pool_tmpappend(pool, str, solvable2str(pool, s), ") to no vendor (");
- return pool_tmpappend(pool, str, solvable2str(pool, rs), ")");
+ str = pool_tmpappend(pool, str, pool_solvable2str(pool, s), ") to no vendor (");
+ return pool_tmpappend(pool, str, pool_solvable2str(pool, rs), ")");
}
return "unknown illegal change";
}
diff --git a/src/transaction.c b/src/transaction.c
index 4514f2c..dbce59f 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -50,9 +50,9 @@ obsq_sortcmp(const void *ap, const void *bp, void *dp)
return -1;
if (obs->name == s->name)
return 1;
- return strcmp(id2str(pool, oas->name), id2str(pool, obs->name));
+ return strcmp(pool_id2str(pool, oas->name), pool_id2str(pool, obs->name));
}
- r = evrcmp(pool, oas->evr, obs->evr, EVRCMP_COMPARE);
+ r = pool_evrcmp(pool, oas->evr, obs->evr, EVRCMP_COMPARE);
if (r)
return -r; /* highest version first */
return oa - ob;
@@ -156,7 +156,7 @@ transaction_base_type(Transaction *trans, Id p)
{
if (s->evr == s2->evr && solvable_identical(s, s2))
return SOLVER_TRANSACTION_REINSTALLED;
- r = evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
+ r = pool_evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
if (r < 0)
return SOLVER_TRANSACTION_UPGRADED;
else if (r > 0)
@@ -178,7 +178,7 @@ transaction_base_type(Transaction *trans, Id p)
{
if (s->evr == s2->evr && solvable_identical(s, s2))
return SOLVER_TRANSACTION_REINSTALL;
- r = evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
+ r = pool_evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
if (r > 0)
return SOLVER_TRANSACTION_UPGRADE;
else if (r < 0)
@@ -210,7 +210,7 @@ transaction_type(Transaction *trans, Id p, int mode)
if (!s->repo)
return SOLVER_TRANSACTION_IGNORE;
- n = id2str(pool, s->name);
+ n = pool_id2str(pool, s->name);
if (!strncmp(n, "patch:", 6))
return SOLVER_TRANSACTION_IGNORE;
if (!strncmp(n, "pattern:", 8))
@@ -369,10 +369,10 @@ classify_cmp(const void *ap, const void *bp, void *dp)
return r;
r = a[2] - b[2];
if (r)
- return a[2] && b[2] ? strcmp(id2str(pool, a[2]), id2str(pool, b[2])) : r;
+ return a[2] && b[2] ? strcmp(pool_id2str(pool, a[2]), pool_id2str(pool, b[2])) : r;
r = a[3] - b[3];
if (r)
- return a[3] && b[3] ? strcmp(id2str(pool, a[3]), id2str(pool, b[3])) : r;
+ return a[3] && b[3] ? strcmp(pool_id2str(pool, a[3]), pool_id2str(pool, b[3])) : r;
return 0;
}
@@ -388,10 +388,10 @@ classify_cmp_pkgs(const void *ap, const void *bp, void *dp)
sa = pool->solvables + a;
sb = pool->solvables + b;
if (sa->name != sb->name)
- return strcmp(id2str(pool, sa->name), id2str(pool, sb->name));
+ return strcmp(pool_id2str(pool, sa->name), pool_id2str(pool, sb->name));
if (sa->evr != sb->evr)
{
- int r = evrcmp(pool, sa->evr, sb->evr, EVRCMP_COMPARE);
+ int r = pool_evrcmp(pool, sa->evr, sb->evr, EVRCMP_COMPARE);
if (r)
return r;
}
@@ -652,7 +652,7 @@ transaction_calculate(Transaction *trans, Queue *decisionq, Map *noobsmap)
if ((!installed || s->repo != installed) && p > 0)
{
#if 0
- const char *n = id2str(pool, s->name);
+ const char *n = pool_id2str(pool, s->name);
if (!strncmp(n, "patch:", 6))
continue;
if (!strncmp(n, "pattern:", 8))
@@ -868,7 +868,7 @@ addteedge(struct orderdata *od, int from, int to, int type)
if (from == to)
return 0;
- /* printf("edge %d(%s) -> %d(%s) type %x\n", from, solvid2str(pool, od->tes[from].p), to, solvid2str(pool, od->tes[to].p), type); */
+ /* printf("edge %d(%s) -> %d(%s) type %x\n", from, pool_solvid2str(pool, od->tes[from].p), to, pool_solvid2str(pool, od->tes[to].p), type); */
te = od->tes + from;
for (i = te->edges; od->edgedata[i]; i += 2)
@@ -1034,7 +1034,7 @@ havescripts(Pool *pool, Id solvid)
}
if (!inpre)
continue;
- dep = id2str(pool, req);
+ dep = pool_id2str(pool, req);
if (*dep == '/' && strcmp(dep, "/sbin/ldconfig") != 0)
return 1;
}
@@ -1056,7 +1056,7 @@ addsolvableedges(struct orderdata *od, Solvable *s)
int provbyinst;
#if 0
- printf("addsolvableedges %s\n", solvable2str(pool, s));
+ printf("addsolvableedges %s\n", pool_solvable2str(pool, s));
#endif
p = s - pool->solvables;
queue_init(&reqq);
@@ -1094,7 +1094,7 @@ addsolvableedges(struct orderdata *od, Solvable *s)
{
provbyinst = 1;
#if 0
- printf("IGNORE inst provides %s by %s\n", dep2str(pool, req), solvable2str(pool, s2));
+ printf("IGNORE inst provides %s by %s\n", pool_dep2str(pool, req), pool_solvable2str(pool, s2));
reqq.count = 0; /* provided by package that stays installed */
break;
#else
@@ -1142,7 +1142,7 @@ addsolvableedges(struct orderdata *od, Solvable *s)
if (trans->transaction_installed[reqq.elements[i] - pool->installed->start] == reqq.elements[j])
continue; /* no self edge */
#if 0
- printf("add interrreq uninst->inst edge (%s -> %s -> %s)\n", solvid2str(pool, reqq.elements[i]), dep2str(pool, req), solvid2str(pool, reqq.elements[j]));
+ printf("add interrreq uninst->inst edge (%s -> %s -> %s)\n", pool_solvid2str(pool, reqq.elements[i]), pool_dep2str(pool, req), pool_solvid2str(pool, reqq.elements[j]));
#endif
addedge(od, reqq.elements[i], reqq.elements[j], pre == TYPE_PREREQ ? TYPE_PREREQ_P : TYPE_REQ_P);
}
@@ -1169,14 +1169,14 @@ addsolvableedges(struct orderdata *od, Solvable *s)
if (pool->solvables[p].repo != installed)
{
#if 0
- printf("add inst->inst edge choice %d (%s -> %s -> %s)\n", choice, solvid2str(pool, p), dep2str(pool, req), solvid2str(pool, p2));
+ printf("add inst->inst edge choice %d (%s -> %s -> %s)\n", choice, pool_solvid2str(pool, p), pool_dep2str(pool, req), pool_solvid2str(pool, p2));
#endif
addedge(od, p, p2, pre);
}
else
{
#if 0
- printf("add uninst->inst edge choice %d (%s -> %s -> %s)\n", choice, solvid2str(pool, p), dep2str(pool, req), solvid2str(pool, p2));
+ printf("add uninst->inst edge choice %d (%s -> %s -> %s)\n", choice, pool_solvid2str(pool, p), pool_dep2str(pool, req), pool_solvid2str(pool, p2));
#endif
addedge(od, p, p2, pre == TYPE_PREREQ ? TYPE_PREREQ_P : TYPE_REQ_P);
}
@@ -1204,7 +1204,7 @@ addsolvableedges(struct orderdata *od, Solvable *s)
}
#endif
#if 0
- printf("add uninst->uninst edge choice %d (%s -> %s -> %s)\n", choice, solvid2str(pool, p), dep2str(pool, req), solvid2str(pool, p2));
+ printf("add uninst->uninst edge choice %d (%s -> %s -> %s)\n", choice, pool_solvid2str(pool, p), pool_dep2str(pool, req), pool_solvid2str(pool, p2));
#endif
addedge(od, p2, p, pre == TYPE_PREREQ ? TYPE_PREREQ_P : TYPE_REQ_P);
}
@@ -1229,7 +1229,7 @@ addsolvableedges(struct orderdata *od, Solvable *s)
{
/* deinstall p before installing p2 */
#if 0
- printf("add conflict uninst->inst edge (%s -> %s -> %s)\n", solvid2str(pool, p2), dep2str(pool, con), solvid2str(pool, p));
+ printf("add conflict uninst->inst edge (%s -> %s -> %s)\n", pool_solvid2str(pool, p2), pool_dep2str(pool, con), pool_solvid2str(pool, p));
#endif
addedge(od, p2, p, TYPE_CON);
}
@@ -1240,7 +1240,7 @@ addsolvableedges(struct orderdata *od, Solvable *s)
{
/* deinstall p2 before installing p */
#if 0
- printf("add conflict uninst->inst edge (%s -> %s -> %s)\n", solvid2str(pool, p), dep2str(pool, con), solvid2str(pool, p2));
+ printf("add conflict uninst->inst edge (%s -> %s -> %s)\n", pool_solvid2str(pool, p), pool_dep2str(pool, con), pool_solvid2str(pool, p2));
#endif
addedge(od, p, p2, TYPE_CON);
}
@@ -1269,7 +1269,7 @@ addsolvableedges(struct orderdata *od, Solvable *s)
{
/* deinstall/update p before installing p2 */
#if 0
- printf("add trigger uninst->inst edge (%s -> %s -> %s)\n", solvid2str(pool, p2), dep2str(pool, tri), solvid2str(pool, p));
+ printf("add trigger uninst->inst edge (%s -> %s -> %s)\n", pool_solvid2str(pool, p2), pool_dep2str(pool, tri), pool_solvid2str(pool, p));
#endif
addedge(od, p2, p, TYPE_CON);
}
@@ -1347,9 +1347,9 @@ breakcycle(struct orderdata *od, Id *cycle)
{
te = od->tes + cycle[k];
if ((od->edgedata[cycle[k + 1] + 1] & TYPE_BROKEN) != 0)
- POOL_DEBUG(SAT_DEBUG_STATS, "%s ##%x##> ", solvid2str(pool, te->p), od->edgedata[cycle[k + 1] + 1]);
+ POOL_DEBUG(SAT_DEBUG_STATS, "%s ##%x##> ", pool_solvid2str(pool, te->p), od->edgedata[cycle[k + 1] + 1]);
else
- POOL_DEBUG(SAT_DEBUG_STATS, "%s --%x--> ", solvid2str(pool, te->p), od->edgedata[cycle[k + 1] + 1]);
+ POOL_DEBUG(SAT_DEBUG_STATS, "%s --%x--> ", pool_solvid2str(pool, te->p), od->edgedata[cycle[k + 1] + 1]);
}
POOL_DEBUG(SAT_DEBUG_STATS, "\n");
}
@@ -1366,21 +1366,21 @@ dump_tes(struct orderdata *od)
for (i = 1, te = od->tes + i; i < od->ntes; i++, te++)
{
Solvable *s = pool->solvables + te->p;
- POOL_DEBUG(SAT_DEBUG_RESULT, "TE %4d: %c%s\n", i, s->repo == pool->installed ? '-' : '+', solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, "TE %4d: %c%s\n", i, s->repo == pool->installed ? '-' : '+', pool_solvable2str(pool, s));
if (s->repo != pool->installed)
{
queue_empty(&obsq);
transaction_all_obs_pkgs(od->trans, te->p, &obsq);
for (j = 0; j < obsq.count; j++)
- POOL_DEBUG(SAT_DEBUG_RESULT, " -%s\n", solvid2str(pool, obsq.elements[j]));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " -%s\n", pool_solvid2str(pool, obsq.elements[j]));
}
for (j = te->edges; od->edgedata[j]; j += 2)
{
te2 = od->tes + od->edgedata[j];
if ((od->edgedata[j + 1] & TYPE_BROKEN) == 0)
- POOL_DEBUG(SAT_DEBUG_RESULT, " --%x--> TE %4d: %s\n", od->edgedata[j + 1], od->edgedata[j], solvid2str(pool, te2->p));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " --%x--> TE %4d: %s\n", od->edgedata[j + 1], od->edgedata[j], pool_solvid2str(pool, te2->p));
else
- POOL_DEBUG(SAT_DEBUG_RESULT, " ##%x##> TE %4d: %s\n", od->edgedata[j + 1], od->edgedata[j], solvid2str(pool, te2->p));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " ##%x##> TE %4d: %s\n", od->edgedata[j + 1], od->edgedata[j], pool_solvid2str(pool, te2->p));
}
}
}
@@ -1427,7 +1427,7 @@ addcycleedges(struct orderdata *od, Id *cycle, Queue *todo)
#if 0
printf("addcycleedges\n");
for (i = 0; (j = cycle[i]) != 0; i++)
- printf("cycle %s\n", solvid2str(pool, od->tes[j].p));
+ printf("cycle %s\n", pool_solvid2str(pool, od->tes[j].p));
#endif
/* first add all the tail cycle edges */
@@ -1475,7 +1475,7 @@ addcycleedges(struct orderdata *od, Id *cycle, Queue *todo)
/* We found an edge to the cycle. Add an extra edge to the tail */
/* the TE was not reachable, so we're not creating a new cycle! */
#if 0
- printf("adding TO TAIL cycle edge %d->%d %s->%s!\n", i, tail, solvid2str(pool, od->tes[i].p), solvid2str(pool, od->tes[tail].p));
+ printf("adding TO TAIL cycle edge %d->%d %s->%s!\n", i, tail, pool_solvid2str(pool, od->tes[i].p), pool_solvid2str(pool, od->tes[tail].p));
#endif
j -= te->edges; /* in case we move */
addteedge(od, i, tail, TYPE_CYCLETAIL);
@@ -1522,7 +1522,7 @@ addcycleedges(struct orderdata *od, Id *cycle, Queue *todo)
if (od->tes[k].mark == -1)
{
#if 0
- printf("adding FROM HEAD cycle edge %d->%d %s->%s [%s]!\n", head, k, solvid2str(pool, od->tes[head].p), solvid2str(pool, od->tes[k].p), solvid2str(pool, od->tes[cycle[i]].p));
+ printf("adding FROM HEAD cycle edge %d->%d %s->%s [%s]!\n", head, k, pool_solvid2str(pool, od->tes[head].p), pool_solvid2str(pool, od->tes[k].p), pool_solvid2str(pool, od->tes[cycle[i]].p));
#endif
addteedge(od, head, k, TYPE_CYCLEHEAD);
od->tes[k].mark = -2; /* no need to add that one again */
@@ -1826,7 +1826,7 @@ transaction_order(Transaction *trans, int flags)
te = od.tes + i;
queue_push(tr, te->p);
#if 0
-printf("do %s [%d]\n", solvid2str(pool, te->p), temedianr[i]);
+printf("do %s [%d]\n", pool_solvid2str(pool, te->p), temedianr[i]);
#endif
s = pool->solvables + te->p;
for (j = te->edges; od.invedgedata[j]; j++)
@@ -1837,7 +1837,7 @@ printf("do %s [%d]\n", solvid2str(pool, te->p), temedianr[i]);
{
Solvable *s = pool->solvables + te2->p;
#if 0
-printf("free %s [%d]\n", solvid2str(pool, te2->p), temedianr[od.invedgedata[j]]);
+printf("free %s [%d]\n", pool_solvid2str(pool, te2->p), temedianr[od.invedgedata[j]]);
#endif
if (installed && s->repo == installed)
queue_push(&uninstq, od.invedgedata[j]);
@@ -1992,7 +1992,7 @@ transaction_check_pkg(Transaction *trans, Id tepkg, Id pkg, Map *ins, Map *seen,
MAPSET(seen, pkg);
s = pool->solvables + pkg;
#if 0
- printf("- %*s%c%s\n", depth * 2, "", s->repo == pool->installed ? '-' : '+', solvable2str(pool, s));
+ printf("- %*s%c%s\n", depth * 2, "", s->repo == pool->installed ? '-' : '+', pool_solvable2str(pool, s));
#endif
if (s->requires)
{
@@ -2008,7 +2008,7 @@ transaction_check_pkg(Transaction *trans, Id tepkg, Id pkg, Map *ins, Map *seen,
}
if (onlyprereq && !inpre)
continue;
- if (!strncmp(id2str(pool, req), "rpmlib(", 7))
+ if (!strncmp(pool_id2str(pool, req), "rpmlib(", 7))
continue;
good = 0;
/* first check kept packages, then freshly installed, then not yet uninstalled */
@@ -2045,7 +2045,7 @@ transaction_check_pkg(Transaction *trans, Id tepkg, Id pkg, Map *ins, Map *seen,
}
if (!good)
{
- POOL_DEBUG(SAT_DEBUG_RESULT, " %c%s: nothing provides %s needed by %c%s\n", pool->solvables[tepkg].repo == pool->installed ? '-' : '+', solvid2str(pool, tepkg), dep2str(pool, req), s->repo == pool->installed ? '-' : '+', solvable2str(pool, s));
+ POOL_DEBUG(SAT_DEBUG_RESULT, " %c%s: nothing provides %s needed by %c%s\n", pool->solvables[tepkg].repo == pool->installed ? '-' : '+', pool_solvid2str(pool, tepkg), pool_dep2str(pool, req), s->repo == pool->installed ? '-' : '+', pool_solvable2str(pool, s));
}
}
}
diff --git a/tools/common_write.c b/tools/common_write.c
index 7666407..186caf5 100644
--- a/tools/common_write.c
+++ b/tools/common_write.c
@@ -64,7 +64,7 @@ keyfilter_solv(Repo *data, Repokey *key, void *kfdata)
for (i = 0; verticals[i]; i++)
if (key->name == verticals[i])
return KEY_STORAGE_VERTICAL_OFFSET;
- keyname = id2str(data->pool, key->name);
+ keyname = pool_id2str(data->pool, key->name);
for (i = 0; languagetags[i] != 0; i++)
if (!strncmp(keyname, languagetags[i], strlen(languagetags[i])))
return KEY_STORAGE_VERTICAL_OFFSET;
@@ -84,7 +84,7 @@ keyfilter_attr(Repo *data, Repokey *key, void *kfdata)
for (i = 0; verticals[i]; i++)
if (key->name == verticals[i])
return KEY_STORAGE_VERTICAL_OFFSET;
- keyname = id2str(data->pool, key->name);
+ keyname = pool_id2str(data->pool, key->name);
for (i = 0; languagetags[i] != 0; i++)
if (!strncmp(keyname, languagetags[i], strlen(languagetags[i])))
return KEY_STORAGE_VERTICAL_OFFSET;
@@ -99,13 +99,13 @@ keyfilter_language(Repo *repo, Repokey *key, void *kfdata)
char *lang = kfdata;
int i;
- name = id2str(repo->pool, key->name);
+ name = pool_id2str(repo->pool, key->name);
p = strrchr(name, ':');
if (!p || strcmp(p + 1, lang) != 0)
return KEY_STORAGE_DROPPED;
for (i = 0; verticals[i]; i++)
{
- const char *vname = id2str(pool, verticals[i]);
+ const char *vname = pool_id2str(pool, verticals[i]);
if (!strncmp(name, vname, p - name) && vname[p - name] == 0)
return KEY_STORAGE_VERTICAL_OFFSET;
}
@@ -151,7 +151,7 @@ keyfilter_other(Repo *repo, Repokey *key, void *kfdata)
if (key->name == SOLVABLE_FILELIST || key->name == SOLVABLE_DISKUSAGE)
return KEY_STORAGE_DROPPED;
- name = id2str(repo->pool, key->name);
+ name = pool_id2str(repo->pool, key->name);
p = strrchr(name, ':');
if (p)
{
@@ -229,7 +229,7 @@ tool_write(Repo *repo, const char *basename, const char *attrname)
{
for (j = 1, key = data->keys + j; j < data->nkeys; j++, key++)
{
- const char *keyname = id2str(repo->pool, key->name);
+ const char *keyname = pool_id2str(repo->pool, key->name);
if (key->name == SOLVABLE_DISKUSAGE)
has_DU = 1;
if (key->name == SOLVABLE_FILELIST)
diff --git a/tools/dumpsolv.c b/tools/dumpsolv.c
index 77a5a35..91848b7 100644
--- a/tools/dumpsolv.c
+++ b/tools/dumpsolv.c
@@ -30,7 +30,7 @@ dump_repodata(Repo *repo)
unsigned int j;
printf("\nrepodata %d has %d keys, %d schemata\n", i + 1, data->nkeys - 1, data->nschemata - 1);
for (j = 1; j < data->nkeys; j++)
- printf(" %s (type %s size %d storage %d)\n", id2str(repo->pool, data->keys[j].name), id2str(repo->pool, data->keys[j].type), data->keys[j].size, data->keys[j].storage);
+ printf(" %s (type %s size %d storage %d)\n", pool_id2str(repo->pool, data->keys[j].name), pool_id2str(repo->pool, data->keys[j].type), data->keys[j].size, data->keys[j].storage);
if (data->localpool)
printf(" localpool has %d strings, size is %d\n", data->spool.nstrings, data->spool.sstrings);
if (data->dirpool.ndirs)
@@ -52,7 +52,7 @@ printids(Repo *repo, char *kind, Offset ido)
printf("%s:\n", kind);
ids = repo->idarraydata + ido;
while((id = *ids++) != 0)
- printf(" %s\n", dep2str(pool, id));
+ printf(" %s\n", pool_dep2str(pool, id));
}
#endif
@@ -63,7 +63,7 @@ dump_attr(Repo *repo, Repodata *data, Repokey *key, KeyValue *kv)
KeyValue *kvp;
int indent = 0;
- keyname = id2str(repo->pool, key->name);
+ keyname = pool_id2str(repo->pool, key->name);
for (kvp = kv; (kvp = kvp->parent) != 0; indent += 2)
printf(" ");
switch(key->type)
@@ -72,11 +72,11 @@ dump_attr(Repo *repo, Repodata *data, Repokey *key, KeyValue *kv)
if (data && data->localpool)
kv->str = stringpool_id2str(&data->spool, kv->id);
else
- kv->str = id2str(repo->pool, kv->id);
+ kv->str = pool_id2str(repo->pool, kv->id);
printf("%s: %s\n", keyname, kv->str);
break;
case REPOKEY_TYPE_CONSTANTID:
- printf("%s: %s\n", keyname, dep2str(repo->pool, kv->id));
+ printf("%s: %s\n", keyname, pool_dep2str(repo->pool, kv->id));
break;
case REPOKEY_TYPE_IDARRAY:
if (!kv->entry)
@@ -84,7 +84,7 @@ dump_attr(Repo *repo, Repodata *data, Repokey *key, KeyValue *kv)
if (data && data->localpool)
printf(" %s\n", stringpool_id2str(&data->spool, kv->id));
else
- printf(" %s\n", dep2str(repo->pool, kv->id));
+ printf(" %s\n", pool_dep2str(repo->pool, kv->id));
break;
case REPOKEY_TYPE_STR:
printf("%s: %s\n", keyname, kv->str);
@@ -92,7 +92,7 @@ dump_attr(Repo *repo, Repodata *data, Repokey *key, KeyValue *kv)
case REPOKEY_TYPE_MD5:
case REPOKEY_TYPE_SHA1:
case REPOKEY_TYPE_SHA256:
- printf("%s: %s (%s)\n", keyname, repodata_chk2str(data, key->type, (unsigned char *)kv->str), id2str(repo->pool, key->type));
+ printf("%s: %s (%s)\n", keyname, repodata_chk2str(data, key->type, (unsigned char *)kv->str), pool_id2str(repo->pool, key->type));
break;
case REPOKEY_TYPE_VOID:
printf("%s: (void)\n", keyname);
@@ -224,7 +224,7 @@ tryme (Repo *repo, Id p, Id keyname, const char *match, int flags)
if (di.data && di.data->localpool)
di.kv.str = stringpool_id2str(&di.data->spool, di.kv.id);
else
- di.kv.str = id2str(repo->pool, di.kv.id);
+ di.kv.str = pool_id2str(repo->pool, di.kv.id);
break;
case REPOKEY_TYPE_STR:
case REPOKEY_TYPE_DIRSTRARRAY:
@@ -234,7 +234,7 @@ tryme (Repo *repo, Id p, Id keyname, const char *match, int flags)
}
fprintf (stdout, "found: %d:%s %d %s %d %d %d\n",
di.solvid,
- id2str(repo->pool, di.key->name),
+ pool_id2str(repo->pool, di.key->name),
di.kv.id,
di.kv.str, di.kv.num, di.kv.num2, di.kv.eof);
}
@@ -310,9 +310,9 @@ int main(int argc, char **argv)
printf("solvable %d (%d):\n", n, i);
#if 0
if (s->name || s->evr || s->arch)
- printf("name: %s %s %s\n", id2str(pool, s->name), id2str(pool, s->evr), id2str(pool, s->arch));
+ printf("name: %s %s %s\n", pool_id2str(pool, s->name), pool_id2str(pool, s->evr), pool_id2str(pool, s->arch));
if (s->vendor)
- printf("vendor: %s\n", id2str(pool, s->vendor));
+ printf("vendor: %s\n", pool_id2str(pool, s->vendor));
printids(repo, "provides", s->provides);
printids(repo, "obsoletes", s->obsoletes);
printids(repo, "conflicts", s->conflicts);
diff --git a/tools/findfileconflicts.c b/tools/findfileconflicts.c
index a7286ab..9c5a1a5 100644
--- a/tools/findfileconflicts.c
+++ b/tools/findfileconflicts.c
@@ -50,7 +50,7 @@ int main()
pool_findfileconflicts(pool, &todo, 0, &conflicts, &iterate_handle, (void *)&state);
queue_free(&todo);
for (i = 0; i < conflicts.count; i += 5)
- printf("%s: %s[%s] %s[%s]\n", id2str(pool, conflicts.elements[i]), solvid2str(pool, conflicts.elements[i + 1]), id2str(pool, conflicts.elements[i + 2]), solvid2str(pool, conflicts.elements[i + 3]), id2str(pool, conflicts.elements[i + 4]));
+ printf("%s: %s[%s] %s[%s]\n", pool_id2str(pool, conflicts.elements[i]), pool_solvid2str(pool, conflicts.elements[i + 1]), pool_id2str(pool, conflicts.elements[i + 2]), pool_solvid2str(pool, conflicts.elements[i + 3]), pool_id2str(pool, conflicts.elements[i + 4]));
if (conflicts.count)
{
Queue job;
diff --git a/tools/installcheck.c b/tools/installcheck.c
index f189e9c..7d9e286 100644
--- a/tools/installcheck.c
+++ b/tools/installcheck.c
@@ -136,8 +136,8 @@ main(int argc, char **argv)
}
pool_addfileprovides(pool);
pool_createwhatprovides(pool);
- rpmid = str2id(pool, "rpm", 0);
- rpmarch = str2id(pool, arch, 0);
+ rpmid = pool_str2id(pool, "rpm", 0);
+ rpmarch = pool_str2id(pool, arch, 0);
rpmrel = 0;
#ifndef DEBIAN
if (rpmid && rpmarch)
@@ -149,7 +149,7 @@ main(int argc, char **argv)
break;
}
if (p < pool->nsolvables)
- rpmrel = rel2id(pool, rpmid, rpmarch, REL_ARCH, 1);
+ rpmrel = pool_rel2id(pool, rpmid, rpmarch, REL_ARCH, 1);
}
#endif
@@ -226,7 +226,7 @@ main(int argc, char **argv)
}
#if 0
Solvable *s = pool->solvables + p;
- if (!strcmp(id2str(pool, s->name), "libusb-compat-devel"))
+ if (!strcmp(pool_id2str(pool, s->name), "libusb-compat-devel"))
{
cand.elements[j++] = p;
continue;
@@ -256,7 +256,7 @@ main(int argc, char **argv)
ptr;
ptr = strtok_r(NULL, " ", &save))
{
- if (*ptr && strstr(solvid2str(pool, p), ptr))
+ if (*ptr && strstr(pool_solvid2str(pool, p), ptr))
{
match = 1;
break;
@@ -289,7 +289,7 @@ main(int argc, char **argv)
Solvable *s2;
status = 1;
- printf("can't install %s:\n", solvable2str(pool, s));
+ printf("can't install %s:\n", pool_solvable2str(pool, s));
while ((problem = solver_next_problem(solv, problem)) != 0)
{
solver_findallproblemrules(solv, problem, &rids);
@@ -309,29 +309,29 @@ main(int argc, char **argv)
dep = rinfo.elements[k + 3];
switch (rinfo.elements[k])
{
- case SOLVER_PROBLEM_DISTUPGRADE_RULE:
+ case SOLVER_RULE_DISTUPGRADE:
break;
- case SOLVER_PROBLEM_INFARCH_RULE:
+ case SOLVER_RULE_INFARCH:
s = pool_id2solvable(pool, source);
- printf(" %s has inferior architecture\n", solvable2str(pool, s));
+ printf(" %s has inferior architecture\n", pool_solvable2str(pool, s));
break;
- case SOLVER_PROBLEM_UPDATE_RULE:
+ case SOLVER_RULE_UPDATE:
break;
- case SOLVER_PROBLEM_JOB_RULE:
+ case SOLVER_RULE_JOB:
break;
- case SOLVER_PROBLEM_RPM_RULE:
+ case SOLVER_RULE_RPM:
printf(" some dependency problem\n");
break;
- case SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP:
- printf(" nothing provides requested %s\n", dep2str(pool, dep));
+ case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
+ printf(" nothing provides requested %s\n", pool_dep2str(pool, dep));
break;
- case SOLVER_PROBLEM_NOT_INSTALLABLE:
+ case SOLVER_RULE_RPM_NOT_INSTALLABLE:
s = pool_id2solvable(pool, source);
- printf(" package %s is not installable\n", solvable2str(pool, s));
+ printf(" package %s is not installable\n", pool_solvable2str(pool, s));
break;
- case SOLVER_PROBLEM_NOTHING_PROVIDES_DEP:
+ case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
s = pool_id2solvable(pool, source);
- printf(" nothing provides %s needed by %s\n", dep2str(pool, dep), solvable2str(pool, s));
+ printf(" nothing provides %s needed by %s\n", pool_dep2str(pool, dep), pool_solvable2str(pool, s));
if (ISRELDEP(dep))
{
Reldep *rd = GETRELDEP(pool, dep);
@@ -339,32 +339,32 @@ main(int argc, char **argv)
{
Id rp, rpp;
FOR_PROVIDES(rp, rpp, rd->name)
- printf(" (we have %s)\n", solvable2str(pool, pool->solvables + rp));
+ printf(" (we have %s)\n", pool_solvable2str(pool, pool->solvables + rp));
}
}
break;
- case SOLVER_PROBLEM_SAME_NAME:
+ case SOLVER_RULE_RPM_SAME_NAME:
s = pool_id2solvable(pool, source);
s2 = pool_id2solvable(pool, target);
- printf(" cannot install both %s and %s\n", solvable2str(pool, s), solvable2str(pool, s2));
+ printf(" cannot install both %s and %s\n", pool_solvable2str(pool, s), pool_solvable2str(pool, s2));
break;
- case SOLVER_PROBLEM_PACKAGE_CONFLICT:
+ case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
s = pool_id2solvable(pool, source);
s2 = pool_id2solvable(pool, target);
- printf(" package %s conflicts with %s provided by %s\n", solvable2str(pool, s), dep2str(pool, dep), solvable2str(pool, s2));
+ printf(" package %s conflicts with %s provided by %s\n", pool_solvable2str(pool, s), pool_dep2str(pool, dep), pool_solvable2str(pool, s2));
break;
- case SOLVER_PROBLEM_PACKAGE_OBSOLETES:
+ case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
s = pool_id2solvable(pool, source);
s2 = pool_id2solvable(pool, target);
- printf(" package %s obsoletes %s provided by %s\n", solvable2str(pool, s), dep2str(pool, dep), solvable2str(pool, s2));
+ printf(" package %s obsoletes %s provided by %s\n", pool_solvable2str(pool, s), pool_dep2str(pool, dep), pool_solvable2str(pool, s2));
break;
- case SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE:
+ case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
s = pool_id2solvable(pool, source);
- printf(" package %s requires %s, but none of the providers can be installed\n", solvable2str(pool, s), dep2str(pool, dep));
+ printf(" package %s requires %s, but none of the providers can be installed\n", pool_solvable2str(pool, s), pool_dep2str(pool, dep));
break;
- case SOLVER_PROBLEM_SELF_CONFLICT:
+ case SOLVER_RULE_RPM_SELF_CONFLICT:
s = pool_id2solvable(pool, source);
- printf(" package %s conflicts with %s provided by itself\n", solvable2str(pool, s), dep2str(pool, dep));
+ printf(" package %s conflicts with %s provided by itself\n", pool_solvable2str(pool, s), pool_dep2str(pool, dep));
break;
}
}
@@ -374,7 +374,7 @@ main(int argc, char **argv)
#if 0
else
{
- if (!strcmp(id2str(pool, s->name), "libusb-compat-devel"))
+ if (!strcmp(pool_id2str(pool, s->name), "libusb-compat-devel"))
{
solver_printdecisions(solv);
}
diff --git a/tools/patchcheck.c b/tools/patchcheck.c
index 5a27525..c107c6c 100644
--- a/tools/patchcheck.c
+++ b/tools/patchcheck.c
@@ -39,7 +39,7 @@ showproblems(Solver *solv, Solvable *s, Queue *cand, Queue *badguys)
queue_init(&rids);
queue_init(&rinfo);
- printf("can't install %s:\n", solvable2str(pool, s));
+ printf("can't install %s:\n", pool_solvable2str(pool, s));
while ((problem = solver_next_problem(solv, problem)) != 0)
{
solver_findallproblemrules(solv, problem, &rids);
@@ -58,13 +58,13 @@ showproblems(Solver *solv, Solvable *s, Queue *cand, Queue *badguys)
dep = rinfo.elements[k + 3];
switch (rinfo.elements[k])
{
- case SOLVER_PROBLEM_DISTUPGRADE_RULE:
+ case SOLVER_RULE_DISTUPGRADE:
break;
- case SOLVER_PROBLEM_INFARCH_RULE:
- printf(" %s has inferior architecture\n", solvid2str(pool, source));
+ case SOLVER_RULE_INFARCH:
+ printf(" %s has inferior architecture\n", pool_solvid2str(pool, source));
break;
- case SOLVER_PROBLEM_UPDATE_RULE:
- printf(" update rule for %s\n", solvid2str(pool, source));
+ case SOLVER_RULE_UPDATE:
+ printf(" update rule for %s\n", pool_solvid2str(pool, source));
if (badguys)
queue_pushunique(badguys, source);
if (!cand)
@@ -88,19 +88,19 @@ showproblems(Solver *solv, Solvable *s, Queue *cand, Queue *badguys)
cand->elements[l] = -source;
}
break;
- case SOLVER_PROBLEM_JOB_RULE:
+ case SOLVER_RULE_JOB:
break;
- case SOLVER_PROBLEM_RPM_RULE:
+ case SOLVER_RULE_RPM:
printf(" some dependency problem\n");
break;
- case SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP:
- printf(" nothing provides requested %s\n", dep2str(pool, dep));
+ case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
+ printf(" nothing provides requested %s\n", pool_dep2str(pool, dep));
break;
- case SOLVER_PROBLEM_NOT_INSTALLABLE:
- printf(" package %s is not installable\n", solvid2str(pool, source));
+ case SOLVER_RULE_RPM_NOT_INSTALLABLE:
+ printf(" package %s is not installable\n", pool_solvid2str(pool, source));
break;
- case SOLVER_PROBLEM_NOTHING_PROVIDES_DEP:
- printf(" nothing provides %s needed by %s\n", dep2str(pool, dep), solvid2str(pool, source));
+ case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
+ printf(" nothing provides %s needed by %s\n", pool_dep2str(pool, dep), pool_solvid2str(pool, source));
if (ISRELDEP(dep))
{
Reldep *rd = GETRELDEP(pool, dep);
@@ -108,24 +108,24 @@ showproblems(Solver *solv, Solvable *s, Queue *cand, Queue *badguys)
{
Id rp, rpp;
FOR_PROVIDES(rp, rpp, rd->name)
- printf(" (we have %s)\n", solvid2str(pool, rp));
+ printf(" (we have %s)\n", pool_solvid2str(pool, rp));
}
}
break;
- case SOLVER_PROBLEM_SAME_NAME:
- printf(" cannot install both %s and %s\n", solvid2str(pool, source), solvid2str(pool, target));
+ case SOLVER_RULE_RPM_SAME_NAME:
+ printf(" cannot install both %s and %s\n", pool_solvid2str(pool, source), pool_solvid2str(pool, target));
break;
- case SOLVER_PROBLEM_PACKAGE_CONFLICT:
- printf(" package %s conflicts with %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
+ case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
+ printf(" package %s conflicts with %s provided by %s\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep), pool_solvid2str(pool, target));
break;
- case SOLVER_PROBLEM_PACKAGE_OBSOLETES:
- printf(" package %s obsoletes %s provided by %s\n", solvid2str(pool, source), dep2str(pool, dep), solvid2str(pool, target));
+ case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
+ printf(" package %s obsoletes %s provided by %s\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep), pool_solvid2str(pool, target));
break;
- case SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE:
- printf(" package %s requires %s, but none of the providers can be installed\n", solvid2str(pool, source), dep2str(pool, dep));
+ case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
+ printf(" package %s requires %s, but none of the providers can be installed\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep));
break;
- case SOLVER_PROBLEM_SELF_CONFLICT:
- printf(" package %s conflicts with %s provided by itself\n", solvid2str(pool, source), dep2str(pool, dep));
+ case SOLVER_RULE_RPM_SELF_CONFLICT:
+ printf(" package %s conflicts with %s provided by itself\n", pool_solvid2str(pool, source), pool_dep2str(pool, dep));
break;
}
}
@@ -148,7 +148,7 @@ toinst(Solver *solv, Repo *repo, Repo *instrepo)
if (p < 0 || p == SYSTEMSOLVABLE)
continue;
- /* printf(" toinstall %s\n", solvid2str(pool, p));*/
+ /* printf(" toinstall %s\n", pool_solvid2str(pool, p));*/
/* oh my! */
pool->solvables[p].repo = instrepo;
}
@@ -162,7 +162,7 @@ dump_instrepo(Repo *instrepo, Pool *pool)
printf("instrepo..\n");
FOR_REPO_SOLVABLES(instrepo, p, s)
- printf(" %s\n", solvable2str(pool, s));
+ printf(" %s\n", pool_solvable2str(pool, s));
printf("done.\n");
}
@@ -199,7 +199,7 @@ typedef struct {
Repo *instrepo;
} context_t;
-#define SHOW_PATCH(c) if (!(c)->shown++) printf("%s:\n", solvable2str(pool, s));
+#define SHOW_PATCH(c) if (!(c)->shown++) printf("%s:\n", pool_solvable2str(pool, s));
#define PERF_DEBUGGING 0
static Pool *pool;
@@ -218,7 +218,7 @@ test_all_old_patches_included(context_t *c, Id pid)
if (!s2->conflicts)
continue;
- if (evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE) <= 0)
+ if (pool_evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE) <= 0)
continue;
conp2 = s2->repo->idarraydata + s2->conflicts;
while ((con2 = *conp2++) != 0)
@@ -239,16 +239,16 @@ test_all_old_patches_included(context_t *c, Id pid)
if (!con)
{
SHOW_PATCH(c);
- printf(" %s contained %s\n", solvable2str(pool, s2), dep2str(pool, rd2->name));
+ printf(" %s contained %s\n", pool_solvable2str(pool, s2), pool_dep2str(pool, rd2->name));
}
else
{
- if (evrcmp(pool, rd->evr, rd2->evr, EVRCMP_COMPARE) < 0)
+ if (pool_evrcmp(pool, rd->evr, rd2->evr, EVRCMP_COMPARE) < 0)
{
SHOW_PATCH(c);
printf(" %s required newer version %s-%s of %s-%s\n",
- solvable2str(pool, s2), dep2str(pool, rd2->name), dep2str(pool, rd2->evr),
- dep2str(pool, rd->name), dep2str(pool, rd->evr));
+ pool_solvable2str(pool, s2), pool_dep2str(pool, rd2->name), pool_dep2str(pool, rd2->evr),
+ pool_dep2str(pool, rd->name), pool_dep2str(pool, rd->evr));
}
}
@@ -283,9 +283,9 @@ test_all_packages_installable(context_t *c, Id pid)
/* also set up some minimal system */
queue_push(&job, SOLVER_INSTALL|SOLVER_SOLVABLE_PROVIDES|SOLVER_WEAK);
- queue_push(&job, str2id(pool, "rpm", 1));
+ queue_push(&job, pool_str2id(pool, "rpm", 1));
queue_push(&job, SOLVER_INSTALL|SOLVER_SOLVABLE_PROVIDES|SOLVER_WEAK);
- queue_push(&job, str2id(pool, "aaa_base", 1));
+ queue_push(&job, pool_str2id(pool, "aaa_base", 1));
solv = solver_create(pool);
solv->dontinstallrecommended = 0;
@@ -315,7 +315,7 @@ test_all_packages_installable(context_t *c, Id pid)
queue_push(&job, i);
}
}
- queue_push(&job, SOLVER_INSTALL_SOLVABLE);
+ queue_push(&job, SOLVER_INSTALL|SOLVER_SOLVABLE);
queue_push(&job, pid);
solv = solver_create(pool);
/*solv->dontinstallrecommended = 1;*/
@@ -361,7 +361,7 @@ test_can_upgrade_all_packages(context_t *c, Id pid)
Solvable *s = pool->solvables + p;
if (!s->repo)
continue;
- if (strchr(id2str(pool, s->name), ':'))
+ if (strchr(pool_id2str(pool, s->name), ':'))
continue; /* only packages, please */
if (!pool_installable(pool, s))
continue;
@@ -415,7 +415,7 @@ test_can_upgrade_all_packages(context_t *c, Id pid)
queue_push(&job, i);
}
}
- queue_push(&job, SOLVER_INSTALL_SOLVABLE);
+ queue_push(&job, SOLVER_INSTALL|SOLVER_SOLVABLE);
queue_push(&job, pid);
solv = solver_create(pool);
solv->dontinstallrecommended = 1;
@@ -464,13 +464,13 @@ test_no_ga_package_fulfills_dependency(context_t *c, Id pid)
{
Solvable *s2 = pool_id2solvable(pool, rp);
if (rp < c->updatestart
- && evrcmp(pool, rd->evr, s2->evr, EVRCMP_COMPARE) < 0
+ && pool_evrcmp(pool, rd->evr, s2->evr, EVRCMP_COMPARE) < 0
&& pool_match_nevr_rel(pool, s2, rd->name)
)
{
SHOW_PATCH(c);
printf(" conflict %s < %s satisfied by non-updated package %s\n",
- dep2str(pool, rd->name), dep2str(pool, rd->evr), solvable2str(pool, s2));
+ pool_dep2str(pool, rd->name), pool_dep2str(pool, rd->evr), pool_solvable2str(pool, s2));
break;
}
}
@@ -577,7 +577,7 @@ main(int argc, char **argv)
continue;
if (!pool_installable(pool, s))
continue;
- pname = id2str(pool, s->name);
+ pname = pool_id2str(pool, s->name);
if (strncmp(pname, "patch:", 6) != 0)
continue;
@@ -590,7 +590,7 @@ main(int argc, char **argv)
l = strlen(pname + 6);
if (mypatch[l] != '-')
continue;
- if (strcmp(mypatch + l + 1, id2str(pool, s->evr)) != 0)
+ if (strcmp(mypatch + l + 1, pool_id2str(pool, s->evr)) != 0)
continue;
}
}
@@ -599,7 +599,7 @@ main(int argc, char **argv)
FOR_PROVIDES(p, pp, s->name)
{
Solvable *s2 = pool->solvables + p;
- if (evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE) < 0)
+ if (pool_evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE) < 0)
break;
}
if (p) {
@@ -612,7 +612,7 @@ main(int argc, char **argv)
continue;
#if 0
- printf("testing patch %s-%s\n", pname + 6, id2str(pool, s->evr));
+ printf("testing patch %s-%s\n", pname + 6, pool_id2str(pool, s->evr));
#endif
test_all_old_patches_included(&c, pid);
diff --git a/tools/repomdxml2solv.c b/tools/repomdxml2solv.c
index 854d790..e59716e 100644
--- a/tools/repomdxml2solv.c
+++ b/tools/repomdxml2solv.c
@@ -42,7 +42,7 @@ doquery(Pool *pool, Repo *repo, const char *query)
qp = strchr(query, ':');
if (qp)
{
- type = strn2id(pool, query, qp - query, 0);
+ type = pool_strn2id(pool, query, qp - query, 0);
if (!type)
exit(0);
qp++;
@@ -50,7 +50,7 @@ doquery(Pool *pool, Repo *repo, const char *query)
else
qp = query;
snprintf(qbuf, sizeof(qbuf), "repository:repomd:%s", qp);
- id = str2id(pool, qbuf, 0);
+ id = pool_str2id(pool, qbuf, 0);
if (!id)
exit(0);
dataiterator_init(&di, pool, repo, SOLVID_META, id, 0, 0);
@@ -67,7 +67,7 @@ doquery(Pool *pool, Repo *repo, const char *query)
{
case REPOKEY_TYPE_ID:
case REPOKEY_TYPE_CONSTANTID:
- printf("%s\n", id2str(pool, di.kv.id));
+ printf("%s\n", pool_id2str(pool, di.kv.id));
break;
case REPOKEY_TYPE_STR:
printf("%s\n", di.kv.str);
diff --git a/tools/susetags2solv.c b/tools/susetags2solv.c
index a10adb3..b97d778 100644
--- a/tools/susetags2solv.c
+++ b/tools/susetags2solv.c
@@ -48,7 +48,7 @@ doquery(Pool *pool, Repo *repo, const char *arg)
Id id;
snprintf(qbuf, sizeof(qbuf), "susetags:%s", arg);
- id = str2id(pool, qbuf, 0);
+ id = pool_str2id(pool, qbuf, 0);
if (!id)
return;
str = repo_lookup_str(repo, SOLVID_META, id);