if (data)
{
map_init(&providedids, pool->ss.nstrings);
- repodata_search(data, REPOENTRY_META, REPOSITORY_ADDEDFILEPROVIDES, addfileprovides_setid_cb, &providedids);
+ repodata_search(data, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, addfileprovides_setid_cb, &providedids);
for (i = 0; i < cbd->nfiles; i++)
if (!MAPTST(&providedids, cbd->ids[i]))
break;
#define SEARCH_FILES (1<<13)
/* Internal */
-#define SEARCH_THISENTRY (1<<31)
+#define SEARCH_THISSOLVID (1<<31)
/* standard flags used in the repo_add functions */
/* iterators/filters */
Id keyname;
Id repodataid;
- Id entry;
+ Id solvid;
Id repoid;
/* recursion data */
switch(key->type)
{
case REPOKEY_TYPE_ID:
- repodata_set_id(stubdata->data, REPOENTRY_META, key->name, kv->id);
+ repodata_set_id(stubdata->data, SOLVID_META, key->name, kv->id);
break;
case REPOKEY_TYPE_CONSTANTID:
- repodata_set_constantid(stubdata->data, REPOENTRY_META, key->name, kv->id);
+ repodata_set_constantid(stubdata->data, SOLVID_META, key->name, kv->id);
break;
case REPOKEY_TYPE_STR:
- repodata_set_str(stubdata->data, REPOENTRY_META, key->name, kv->str);
+ repodata_set_str(stubdata->data, SOLVID_META, key->name, kv->str);
break;
case REPOKEY_TYPE_VOID:
- repodata_set_void(stubdata->data, REPOENTRY_META, key->name);
+ repodata_set_void(stubdata->data, SOLVID_META, key->name);
break;
case REPOKEY_TYPE_NUM:
- repodata_set_num(stubdata->data, REPOENTRY_META, key->name, kv->num);
+ repodata_set_num(stubdata->data, SOLVID_META, key->name, kv->num);
break;
case REPOKEY_TYPE_IDARRAY:
- repodata_add_idarray(stubdata->data, REPOENTRY_META, key->name, kv->id);
+ repodata_add_idarray(stubdata->data, SOLVID_META, key->name, kv->id);
if (key->name == REPOSITORY_KEYS)
{
if (!stubdata->xkeyname)
case REPOKEY_TYPE_MD5:
case REPOKEY_TYPE_SHA1:
case REPOKEY_TYPE_SHA256:
- repodata_set_checksum(stubdata->data, REPOENTRY_META, key->name, key->type, kv->str);
+ repodata_set_checksum(stubdata->data, SOLVID_META, key->name, key->type, kv->str);
break;
default:
return SEARCH_NEXT_KEY;
struct create_stub_data stubdata;
/* got some */
memset(&stubdata, 0, sizeof(stubdata));
- repodata_search(&data, REPOENTRY_META, REPOSITORY_EXTERNAL, create_stub_cb, &stubdata);
+ repodata_search(&data, SOLVID_META, REPOSITORY_EXTERNAL, create_stub_cb, &stubdata);
}
return 0;
}
unsigned char *dp = data->incoredata;
if (!dp)
return 0;
- if (entry == REPOENTRY_META) /* META */
+ if (entry == SOLVID_META) /* META */
dp += 1;
- else if (entry == REPOENTRY_POS) /* META */
+ else if (entry == SOLVID_POS) /* META */
{
Pool *pool = data->repo->pool;
if (data->repo != pool->pos.repo)
if (!maybe_load_repodata(data, keyname))
return;
- if (entry == REPOENTRY_SUBSCHEMA)
+ if (entry == SOLVID_SUBSCHEMA)
{
struct subschema_data *subd = cbdata;
cbdata = subd->cbdata;
if (stop)
break;
if (!keyname)
- repodata_search(data, REPOENTRY_SUBSCHEMA, 0, callback, &subd);
+ repodata_search(data, SOLVID_SUBSCHEMA, 0, callback, &subd);
ddp = data_skip_schema(data, ddp, schema);
nentries--;
kv.entry++;
memset(di, 0, sizeof(*di));
di->repo = repo;
di->keyname = keyname;
- di->entry = p;
+ di->solvid = p;
di->pool = repo->pool;
if (p)
- flags |= SEARCH_THISENTRY;
+ flags |= SEARCH_THISSOLVID;
di->flags = flags;
if (repo)
di->repoid = -1;
if (match)
datamatcher_init(&di->matcher, di->pool, match, flags);
- if (p == REPOENTRY_POS)
+ if (p == SOLVID_POS)
{
di->repo = di->pool->pos.repo;
di->data = di->repo->repodata + di->pool->pos.repodataid;
/* FALLTHROUGH */
case di_nextsolvable:
- if (!(di->flags & SEARCH_THISENTRY))
+ if (!(di->flags & SEARCH_THISSOLVID))
{
- if (di->entry < 0)
- di->entry = di->repo->start;
+ if (di->solvid < 0)
+ di->solvid = di->repo->start;
else
- di->entry++;
- for (; di->entry < di->repo->end; di->entry++)
+ di->solvid++;
+ for (; di->solvid < di->repo->end; di->solvid++)
{
- if (di->pool->solvables[di->entry].repo == di->repo)
+ if (di->pool->solvables[di->solvid].repo == di->repo)
goto di_entersolvable;
}
}
return 0;
case di_enterrepo: di_enterrepo:
- if (!(di->flags & SEARCH_THISENTRY))
- di->entry = di->repo->start;
+ if (!(di->flags & SEARCH_THISSOLVID))
+ di->solvid = di->repo->start;
/* FALLTHROUGH */
case di_entersolvable: di_entersolvable:
if (di->repodataid >= 0)
{
di->repodataid = 0;
- if (di->entry > 0 && (!di->keyname || (di->keyname >= SOLVABLE_NAME && di->keyname <= RPM_RPMDBID)))
+ if (di->solvid > 0 && (!di->keyname || (di->keyname >= SOLVABLE_NAME && di->keyname <= RPM_RPMDBID)))
{
di->key = solvablekeys + (di->keyname ? di->keyname - SOLVABLE_NAME : 0);
di->data = 0;
di->data = di->repo->repodata + di->repodataid;
if (!maybe_load_repodata(di->data, di->keyname))
goto di_nextrepodata;
- di->dp = entry2data(di->data, di->entry, &schema);
+ di->dp = entry2data(di->data, di->solvid, &schema);
if (!di->dp)
goto di_nextrepodata;
di->keyp = di->data->schemadata + di->data->schemata[schema];
/* FALLTHROUGH */
case di_entersolvablekey: di_entersolvablekey:
- di->idp = solvabledata_fetch(di->pool->solvables + di->entry, &di->kv, di->key->name);
+ di->idp = solvabledata_fetch(di->pool->solvables + di->solvid, &di->kv, di->key->name);
if (!di->idp || !di->idp[0])
goto di_nextsolvablekey;
di->kv.id = di->idp[0];
{
di->repo = s->repo;
di->repoid = -1;
- di->entry = s - di->pool->solvables;
+ di->solvid = s - di->pool->solvables;
di->state = di_entersolvable;
}
static inline Id **
repodata_get_attrp(Repodata *data, Id handle)
{
- if (handle == REPOENTRY_META)
+ if (handle == SOLVID_META)
{
if (!data->xattrs)
{
} Repodata;
-#define REPOENTRY_META -1
-#define REPOENTRY_POS -2
-#define REPOENTRY_SUBSCHEMA -3 /* internal! */
+#define SOLVID_META -1
+#define SOLVID_POS -2
+#define SOLVID_SUBSCHEMA -3 /* internal! */
/*-----
* management functions
}
sat_free(keyarray);
repodata_set_str(info, h, REPOSITORY_LOCATION, location);
- repodata_add_flexarray(info, REPOENTRY_META, REPOSITORY_EXTERNAL, h);
+ repodata_add_flexarray(info, SOLVID_META, REPOSITORY_EXTERNAL, h);
}
int
{
kd.haveaddedfileprovides = 1;
for (i = 0; addedfileprovides[i]; i++)
- repodata_add_idarray(info, REPOENTRY_META, REPOSITORY_ADDEDFILEPROVIDES, addedfileprovides[i]);
+ repodata_add_idarray(info, SOLVID_META, REPOSITORY_ADDEDFILEPROVIDES, addedfileprovides[i]);
}
sat_free(addedfileprovides);
if (data->dirpool.ndirs)
printf(" localpool has %d directories\n", data->dirpool.ndirs);
printf("\n");
- repodata_search(data, REPOENTRY_META, 0, dump_repoattrs_cb, 0);
+ repodata_search(data, SOLVID_META, 0, dump_repoattrs_cb, 0);
}
printf("\n");
}
{
FILE *fp = 0;
printf("LOADCALLBACK\n");
- const char *location = repodata_lookup_str(data, REPOENTRY_META, REPOSITORY_LOCATION);
+ const char *location = repodata_lookup_str(data, SOLVID_META, REPOSITORY_LOCATION);
printf("loc %s\n", location);
if (location && with_attr)
{
loadcallback (Pool *pool, Repodata *data, void *vdata)
{
FILE *fp = 0;
- const char *location = repodata_lookup_str(data, REPOENTRY_META, REPOSITORY_LOCATION);
+ const char *location = repodata_lookup_str(data, SOLVID_META, REPOSITORY_LOCATION);
if (location)
{
fprintf(stderr, "Loading SOLV file %s\n", location);
/* now commit all handles */
for (i = 0; i < pd.nhandles; i++)
- repodata_add_flexarray(pd.data, REPOENTRY_META, REPOSITORY_DELTAINFO, pd.handles[i]);
+ repodata_add_flexarray(pd.data, SOLVID_META, REPOSITORY_DELTAINFO, pd.handles[i]);
sat_free(pd.handles);
if (!(flags & REPO_NO_INTERNALIZE))
if (*p)
*p++ = 0;
if (*value)
- repo_add_poolstr_array(pd->repo, REPOENTRY_META, REPOSITORY_UPDATES, value);
+ repo_add_poolstr_array(pd->repo, SOLVID_META, REPOSITORY_UPDATES, value);
value = p;
}
free(fvalue);
case STATE_START: break;
case STATE_REPOMD:
if (pd->timestamp > 0)
- repodata_set_num(pd->data, REPOENTRY_META, REPOSITORY_TIMESTAMP, pd->timestamp);
+ repodata_set_num(pd->data, SOLVID_META, REPOSITORY_TIMESTAMP, pd->timestamp);
break;
case STATE_DATA: break;
case STATE_LOCATION: break;
{
int expire = atoi(pd->content);
if (expire > 0)
- repodata_set_num(pd->data, REPOENTRY_META, REPOSITORY_EXPIRE, expire);
+ repodata_set_num(pd->data, SOLVID_META, REPOSITORY_EXPIRE, expire);
break;
}
case STATE_PRODUCT:
if (pd->content)
- repodata_add_poolstr_array(pd->data, REPOENTRY_META, REPOSITORY_PRODUCTS, pd->content);
+ repodata_add_poolstr_array(pd->data, SOLVID_META, REPOSITORY_PRODUCTS, pd->content);
break;
case STATE_KEYWORD:
if (pd->content)
- repodata_add_poolstr_array(pd->data, REPOENTRY_META, REPOSITORY_KEYWORDS, pd->content);
+ repodata_add_poolstr_array(pd->data, SOLVID_META, REPOSITORY_KEYWORDS, pd->content);
break;
case STATE_SUSEINFO: break;
case STATE_PRODUCTS: break;
exit(1);
}
mkrpmdbcookie(&packagesstat, newcookie);
- repodata_set_bin_checksum(data, REPOENTRY_META, REPOSITORY_RPMDBCOOKIE, REPOKEY_TYPE_SHA256, newcookie);
+ repodata_set_bin_checksum(data, SOLVID_META, REPOSITORY_RPMDBCOOKIE, REPOKEY_TYPE_SHA256, newcookie);
if (ref)
- oldcookie = repo_lookup_bin_checksum(ref, REPOENTRY_META, REPOSITORY_RPMDBCOOKIE, &oldcookietype);
+ oldcookie = repo_lookup_bin_checksum(ref, SOLVID_META, REPOSITORY_RPMDBCOOKIE, &oldcookietype);
if (!ref || !oldcookie || oldcookietype != REPOKEY_TYPE_SHA256 || memcmp(oldcookie, newcookie, 32) != 0)
{
Id *pkgids;
/* collect all other data from all repodatas */
/* XXX: merge arrays of equal keys? */
for (j = 0, data = repo->repodata; j < repo->nrepodata; j++, data++)
- repodata_search(data, REPOENTRY_META, 0, repo_write_cb_needed, &cbdata);
+ repodata_search(data, SOLVID_META, 0, repo_write_cb_needed, &cbdata);
sp = cbdata.sp;
/* add solvables if needed */
if (repo->nsolvables)
#if 1
for (j = 0, data = repo->repodata; j < repo->nrepodata; j++, data++)
- repodata_search(data, REPOENTRY_META, 0, repo_write_cb_adddata, &cbdata);
+ repodata_search(data, SOLVID_META, 0, repo_write_cb_adddata, &cbdata);
#endif
if (xd->len - cbdata.lastlen > cbdata.maxdata)