diff options
-rw-r--r-- | src/repo.c | 16 | ||||
-rw-r--r-- | src/repodata.c | 20 |
2 files changed, 12 insertions, 24 deletions
@@ -838,7 +838,9 @@ repo_matchvalue(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValu } -static Repokey solvablekeys[RPM_RPMDBID - SOLVABLE_NAME + 1] = { +/* list of all keys we store in the solvable */ +/* also used in the dataiterator code in repodata.c */ +Repokey repo_solvablekeys[RPM_RPMDBID - SOLVABLE_NAME + 1] = { { SOLVABLE_NAME, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_ARCH, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, { SOLVABLE_EVR, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, @@ -864,7 +866,7 @@ domatch_idarray(Solvable *s, Id keyname, struct matchdata *md, Id *ida) { kv.id = *ida; kv.eof = ida[1] ? 0 : 1; - repo_matchvalue(md, s, 0, solvablekeys + (keyname - SOLVABLE_NAME), &kv); + repo_matchvalue(md, s, 0, repo_solvablekeys + (keyname - SOLVABLE_NAME), &kv); kv.entry++; } } @@ -906,7 +908,7 @@ repo_search_md(Repo *repo, Id p, Id keyname, struct matchdata *md) if (s->name) { kv.id = s->name; - repo_matchvalue(md, s, 0, solvablekeys + 0, &kv); + repo_matchvalue(md, s, 0, repo_solvablekeys + 0, &kv); } if (keyname || md->stop > SEARCH_NEXT_KEY) return; @@ -914,7 +916,7 @@ repo_search_md(Repo *repo, Id p, Id keyname, struct matchdata *md) if (s->arch) { kv.id = s->arch; - repo_matchvalue(md, s, 0, solvablekeys + 1, &kv); + repo_matchvalue(md, s, 0, repo_solvablekeys + 1, &kv); } if (keyname || md->stop > SEARCH_NEXT_KEY) return; @@ -922,7 +924,7 @@ repo_search_md(Repo *repo, Id p, Id keyname, struct matchdata *md) if (s->evr) { kv.id = s->evr; - repo_matchvalue(md, s, 0, solvablekeys + 2, &kv); + repo_matchvalue(md, s, 0, repo_solvablekeys + 2, &kv); } if (keyname || md->stop > SEARCH_NEXT_KEY) return; @@ -930,7 +932,7 @@ repo_search_md(Repo *repo, Id p, Id keyname, struct matchdata *md) if (s->vendor) { kv.id = s->vendor; - repo_matchvalue(md, s, 0, solvablekeys + 3, &kv); + repo_matchvalue(md, s, 0, repo_solvablekeys + 3, &kv); } if (keyname || md->stop > SEARCH_NEXT_KEY) return; @@ -978,7 +980,7 @@ repo_search_md(Repo *repo, Id p, Id keyname, struct matchdata *md) if (repo->rpmdbid) { kv.num = repo->rpmdbid[p - repo->start]; - repo_matchvalue(md, s, 0, solvablekeys + (RPM_RPMDBID - SOLVABLE_NAME), &kv); + repo_matchvalue(md, s, 0, repo_solvablekeys + (RPM_RPMDBID - SOLVABLE_NAME), &kv); } if (keyname || md->stop > SEARCH_NEXT_KEY) return; diff --git a/src/repodata.c b/src/repodata.c index 147713e..a912842 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -986,22 +986,6 @@ repodata_setpos_kv(Repodata *data, KeyValue *kv) * data iterator functions */ -static Repokey solvablekeys[RPM_RPMDBID - SOLVABLE_NAME + 1] = { - { SOLVABLE_NAME, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_ARCH, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_EVR, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_VENDOR, REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_PROVIDES, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_OBSOLETES, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_CONFLICTS, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_REQUIRES, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_RECOMMENDS, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_SUGGESTS, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_SUPPLEMENTS, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, - { SOLVABLE_ENHANCES, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE }, - { RPM_RPMDBID, REPOKEY_TYPE_U32, 0, KEY_STORAGE_SOLVABLE }, -}; - static inline Id * solvabledata_fetch(Solvable *s, KeyValue *kv, Id keyname) { @@ -1376,7 +1360,9 @@ dataiterator_step(Dataiterator *di) di->repodataid = 1; /* reset repodata iterator */ if (di->solvid > 0 && !(di->flags & SEARCH_NO_STORAGE_SOLVABLE) && (!di->keyname || (di->keyname >= SOLVABLE_NAME && di->keyname <= RPM_RPMDBID)) && di->nparents - di->rootlevel == di->nkeynames) { - di->key = solvablekeys + (di->keyname ? di->keyname - SOLVABLE_NAME : 0); + extern Repokey repo_solvablekeys[RPM_RPMDBID - SOLVABLE_NAME + 1]; + + di->key = repo_solvablekeys + (di->keyname ? di->keyname - SOLVABLE_NAME : 0); di->data = 0; goto di_entersolvablekey; } |