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>
26 #include "solv_xfopen.h"
27 #include "common_write.h"
33 fprintf(stderr, "\nUsage:\n"
34 "mdk2solv [-i <infoxml>]\n"
35 " reads a 'synthesis' repository from <stdin> and writes a .solv file to <stdout>\n"
36 " -i : info.xml file for extra attributes\n"
37 " -f : files.xml file for extra attributes\n"
38 " -h : print help & exit\n"
44 main(int argc, char **argv)
48 char *infofile = 0, *filesfile = 0;
51 while ((c = getopt(argc, argv, "hi:f:")) >= 0)
70 repo = repo_create(pool, "<stdin>");
71 if (repo_add_mdk(repo, stdin, REPO_NO_INTERNALIZE))
73 fprintf(stderr, "mdk2solv: %s\n", pool_errstr(pool));
78 FILE *fp = solv_xfopen(infofile, "r");
84 if (repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE))
86 fprintf(stderr, "mdk2solv: %s\n", pool_errstr(pool));
93 FILE *fp = solv_xfopen(filesfile, "r");
99 if (repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE))
101 fprintf(stderr, "mdk2solv: %s\n", pool_errstr(pool));
106 repo_internalize(repo);
107 tool_write(repo, 0, 0);