2 * Copyright (c) 2012, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
11 * parse Mandriva/Mageie synthesis file
17 #include <sys/types.h>
28 #include "solv_xfopen.h"
29 #include "common_write.h"
35 fprintf(stderr, "\nUsage:\n"
36 "mdk2solv [-i <infoxml>]\n"
37 " reads a 'synthesis' repository from <stdin> and writes a .solv file to <stdout>\n"
38 " -i : info.xml file for extra attributes\n"
39 " -f : files.xml file for extra attributes\n"
40 " -h : print help & exit\n"
46 main(int argc, char **argv)
50 char *infofile = 0, *filesfile = 0;
53 while ((c = getopt(argc, argv, "hi:f:")) >= 0)
72 repo = repo_create(pool, "<stdin>");
73 if (repo_add_mdk(repo, stdin, REPO_NO_INTERNALIZE))
75 fprintf(stderr, "mdk2solv: %s\n", pool_errstr(pool));
80 FILE *fp = solv_xfopen(infofile, "r");
86 if (repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE))
88 fprintf(stderr, "mdk2solv: %s\n", pool_errstr(pool));
95 FILE *fp = solv_xfopen(filesfile, "r");
101 if (repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE))
103 fprintf(stderr, "mdk2solv: %s\n", pool_errstr(pool));
108 repo_internalize(repo);
109 tool_write(repo, 0, 0);