Imported Upstream version 0.6.7
[platform/upstream/libsolv.git] / tools / comps2solv.c
1 /*
2  * Copyright (c) 2012, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 /*
9  * comps2solv.c
10  * 
11  * parse Fedora Comps type xml and write out .solv file
12  *
13  * reads from stdin
14  * writes to stdout
15  */
16
17 #include <sys/types.h>
18 #include <limits.h>
19 #include <fcntl.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <string.h>
23
24 #include "pool.h"
25 #include "repo.h"
26 #include "repo_comps.h"
27 #include "common_write.h"
28
29 int
30 main(int argc, char **argv)
31 {
32   Pool *pool = pool_create();
33   Repo *repo = repo_create(pool, "<stdin>");
34   if (repo_add_comps(repo, stdin, 0))
35     {
36       fprintf(stderr, "comps2solv: %s\n", pool_errstr(pool));
37       exit(1);
38     }
39   tool_write(repo, 0, 0);
40   pool_free(pool);
41   exit(0);
42 }