From: Michael Schroeder Date: Mon, 13 Oct 2008 12:03:04 +0000 (+0000) Subject: - change entry back to better name solvid X-Git-Tag: BASE-SuSE-Code-12_1-Branch~461 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4385f9ff9404d65d5bf57c35e2a24488c41b436;p=platform%2Fupstream%2Flibsolv.git - change entry back to better name solvid --- diff --git a/src/pool.c b/src/pool.c index 57014d0..f954b82 100644 --- a/src/pool.c +++ b/src/pool.c @@ -885,7 +885,7 @@ pool_addfileprovides_search(Pool *pool, struct addfileprovides_cbdata *cbd, stru 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; diff --git a/src/repo.h b/src/repo.h index 2aed77d..a0e20b3 100644 --- a/src/repo.h +++ b/src/repo.h @@ -177,7 +177,7 @@ typedef struct _KeyValue { #define SEARCH_FILES (1<<13) /* Internal */ -#define SEARCH_THISENTRY (1<<31) +#define SEARCH_THISSOLVID (1<<31) /* standard flags used in the repo_add functions */ @@ -254,7 +254,7 @@ typedef struct _Dataiterator /* iterators/filters */ Id keyname; Id repodataid; - Id entry; + Id solvid; Id repoid; /* recursion data */ diff --git a/src/repo_solv.c b/src/repo_solv.c index 3a01795..518378c 100644 --- a/src/repo_solv.c +++ b/src/repo_solv.c @@ -442,22 +442,22 @@ create_stub_cb(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue 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) @@ -480,7 +480,7 @@ create_stub_cb(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue 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; @@ -1328,7 +1328,7 @@ printf("=> %s %s %p\n", id2str(pool, keys[key].name), id2str(pool, keys[key].typ 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; } diff --git a/src/repodata.c b/src/repodata.c index 2e17137..6201928 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -449,9 +449,9 @@ entry2data(Repodata *data, Id entry, Id *schemap) 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) @@ -632,7 +632,7 @@ repodata_search(Repodata *data, Id entry, Id keyname, int (*callback)(void *cbda if (!maybe_load_repodata(data, keyname)) return; - if (entry == REPOENTRY_SUBSCHEMA) + if (entry == SOLVID_SUBSCHEMA) { struct subschema_data *subd = cbdata; cbdata = subd->cbdata; @@ -696,7 +696,7 @@ repodata_search(Repodata *data, Id entry, Id keyname, int (*callback)(void *cbda 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++; @@ -952,16 +952,16 @@ dataiterator_init(Dataiterator *di, Repo *repo, Id p, Id keyname, const char *ma 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; @@ -1027,15 +1027,15 @@ dataiterator_step(Dataiterator *di) /* 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; } } @@ -1058,15 +1058,15 @@ dataiterator_step(Dataiterator *di) 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; @@ -1079,7 +1079,7 @@ dataiterator_step(Dataiterator *di) 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]; @@ -1183,7 +1183,7 @@ dataiterator_step(Dataiterator *di) /* 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]; @@ -1241,7 +1241,7 @@ dataiterator_jump_to_solvable(Dataiterator *di, Solvable *s) { di->repo = s->repo; di->repoid = -1; - di->entry = s - di->pool->solvables; + di->solvid = s - di->pool->solvables; di->state = di_entersolvable; } @@ -1862,7 +1862,7 @@ repodata_new_handle(Repodata *data) static inline Id ** repodata_get_attrp(Repodata *data, Id handle) { - if (handle == REPOENTRY_META) + if (handle == SOLVID_META) { if (!data->xattrs) { diff --git a/src/repodata.h b/src/repodata.h index 17c41a2..87e78dd 100644 --- a/src/repodata.h +++ b/src/repodata.h @@ -94,9 +94,9 @@ typedef struct _Repodata { } 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 diff --git a/tools/common_write.c b/tools/common_write.c index 37d534b..bb4bd19 100644 --- a/tools/common_write.c +++ b/tools/common_write.c @@ -187,7 +187,7 @@ write_info(Repo *repo, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void } 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 @@ -209,7 +209,7 @@ tool_write(Repo *repo, const char *basename, const char *attrname) { 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); diff --git a/tools/dumpsolv.c b/tools/dumpsolv.c index a5314f3..211ebcf 100644 --- a/tools/dumpsolv.c +++ b/tools/dumpsolv.c @@ -46,7 +46,7 @@ dump_repodata (Repo *repo) 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"); } @@ -182,7 +182,7 @@ loadcallback (Pool *pool, Repodata *data, void *vdata) { 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) { diff --git a/tools/mergesolv.c b/tools/mergesolv.c index 7492b5c..87a3295 100644 --- a/tools/mergesolv.c +++ b/tools/mergesolv.c @@ -37,7 +37,7 @@ static FILE * 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); diff --git a/tools/repo_deltainfoxml.c b/tools/repo_deltainfoxml.c index 4fd233f..5f22859 100644 --- a/tools/repo_deltainfoxml.c +++ b/tools/repo_deltainfoxml.c @@ -598,7 +598,7 @@ repo_add_deltainfoxml(Repo *repo, FILE *fp, int flags) /* 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)) diff --git a/tools/repo_repomdxml.c b/tools/repo_repomdxml.c index 0f371eb..05c10a6 100644 --- a/tools/repo_repomdxml.c +++ b/tools/repo_repomdxml.c @@ -210,7 +210,7 @@ startElement(void *userData, const char *name, const char **atts) 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); @@ -259,7 +259,7 @@ endElement(void *userData, const char *name) 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; @@ -281,16 +281,16 @@ endElement(void *userData, const char *name) { 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; diff --git a/tools/repo_rpmdb.c b/tools/repo_rpmdb.c index 25157ff..f5c74d3 100644 --- a/tools/repo_rpmdb.c +++ b/tools/repo_rpmdb.c @@ -1246,10 +1246,10 @@ repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags) 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; diff --git a/tools/repo_write.c b/tools/repo_write.c index f2a4469..0e4165f 100644 --- a/tools/repo_write.c +++ b/tools/repo_write.c @@ -1356,7 +1356,7 @@ for (i = 1; i < cbdata.nmykeys; i++) /* 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) @@ -1582,7 +1582,7 @@ fprintf(stderr, "dir %d used %d\n", i, cbdata.dirused ? cbdata.dirused[i] : 1); #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)