2 * Copyright (c) 2007, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
13 #include <sys/types.h>
22 #include "repo_solv.h"
23 #include "repo_write.h"
25 static char *verticals[] = {
35 static unsigned char *filter;
39 create_filter(Pool *pool)
43 for (s = verticals; *s; s++)
45 id = str2id(pool, *s, 1);
48 filter = sat_realloc(filter, id + 16);
49 memset(filter + nfilter, 0, id + 16 - nfilter);
57 keyfilter(Repo *data, Repokey *key, void *kfdata)
59 if (key->name < nfilter && filter[key->name])
60 return KEY_STORAGE_VERTICAL_OFFSET;
61 return KEY_STORAGE_INCORE;
65 main(int argc, char **argv)
67 Pool *pool = pool_create();
70 repo = repo_create(pool, "");
75 if ((fp = fopen(*argv, "r")) == NULL)
80 repo_add_solv(repo, fp);
85 repo_write(repo, stdout, keyfilter, 0);