Imported Upstream version 0.7.19
[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 <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21
22 #include "pool.h"
23 #include "repo.h"
24 #include "repo_comps.h"
25 #include "common_write.h"
26
27 int
28 main(int argc, char **argv)
29 {
30   Pool *pool = pool_create();
31   Repo *repo = repo_create(pool, "<stdin>");
32   if (repo_add_comps(repo, stdin, 0))
33     {
34       fprintf(stderr, "comps2solv: %s\n", pool_errstr(pool));
35       exit(1);
36     }
37   tool_write(repo, stdout);
38   pool_free(pool);
39   exit(0);
40 }