};
#endif
+static Id verticals[] = {
+ SOLVABLE_AUTHORS,
+ SOLVABLE_DESCRIPTION,
+ SOLVABLE_MESSAGEDEL,
+ SOLVABLE_MESSAGEINS,
+ SOLVABLE_EULA,
+ SOLVABLE_DISKUSAGE,
+ SOLVABLE_FILELIST,
+ 0
+};
+
+static char *languagetags[] = {
+ "solvable:summary:",
+ "solvable:description:",
+ "solvable:messageins:",
+ "solvable:messagedel:",
+ "solvable:eula:",
+ 0
+};
+
+int
+repo_write_stdkeyfilter(Repo *repo, Repokey *key, void *kfdata)
+{
+ const char *keyname;
+ int i;
+
+ for (i = 0; verticals[i]; i++)
+ if (key->name == verticals[i])
+ return KEY_STORAGE_VERTICAL_OFFSET;
+ keyname = 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;
+ return KEY_STORAGE_INCORE;
+}
+
/*
* Repo
*/
for (j = 1; j < data->nkeys; j++, n++)
{
key = data->keys + j;
+ if (key->name == REPOSITORY_SOLVABLES && key->type == REPOKEY_TYPE_FLEXARRAY)
+ {
+ cbdata.keymap[n] = cbdata.keymap[key->name];
+ continue;
+ }
/* see if we already had this one, should use hash for fast miss */
for (k = 0; k < cbdata.nmykeys; k++)
{
/* 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, SOLVID_META, 0, SEARCH_SUB|SEARCH_ARRAYSENTINEL, repo_write_cb_needed, &cbdata);
+ {
+ if (!repodataused[j])
+ continue;
+ repodata_search(data, SOLVID_META, 0, SEARCH_SUB|SEARCH_ARRAYSENTINEL, 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, SOLVID_META, 0, SEARCH_SUB|SEARCH_ARRAYSENTINEL, repo_write_cb_adddata, &cbdata);
+ {
+ if (!repodataused[j])
+ continue;
+ repodata_search(data, SOLVID_META, 0, SEARCH_SUB|SEARCH_ARRAYSENTINEL, repo_write_cb_adddata, &cbdata);
+ }
#endif
if (xd->len - cbdata.lastlen > cbdata.maxdata)
#include <stdio.h>
-#include "pool.h"
#include "repo.h"
-/* Describes a repodata file */
-typedef struct _Repodatafile
-{
- /* These have the same meaning as the equally named fields in
- Repodata. */
- char *location;
- char *checksum;
- unsigned int nchecksum;
- unsigned int checksumtype;
- struct _Repokey *keys;
- unsigned int nkeys;
- Id *addedfileprovides;
- unsigned char *rpmdbcookie;
-} Repodatafile;
-
void repo_write(Repo *repo, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata, Id **keyarrayp);
+int repo_write_stdkeyfilter(Repo *repo, Repokey *key, void *kfdata);
#endif