summaryrefslogtreecommitdiff
path: root/tools/mdk2solv.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-03-30 19:20:31 +0200
committerMichael Schroeder <mls@suse.de>2012-03-30 19:20:31 +0200
commit7609adb10abd3e602f40f448767556177aac7e68 (patch)
tree513d651c115c4ecec9d211d462554e9e03002626 /tools/mdk2solv.c
parent8621f7de539e074fa9d59b8f1daa9aef9420886b (diff)
downloadlibsolv-7609adb10abd3e602f40f448767556177aac7e68.tar.gz
libsolv-7609adb10abd3e602f40f448767556177aac7e68.tar.bz2
libsolv-7609adb10abd3e602f40f448767556177aac7e68.zip
- also implement files.xml parsing for m&m
Diffstat (limited to 'tools/mdk2solv.c')
-rw-r--r--tools/mdk2solv.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/mdk2solv.c b/tools/mdk2solv.c
index cec705e..f680f65 100644
--- a/tools/mdk2solv.c
+++ b/tools/mdk2solv.c
@@ -36,6 +36,7 @@ usage(int status)
"mdk2solv [-i <infoxml>]\n"
" reads a 'synthesis' repository from <stdin> and writes a .solv file to <stdout>\n"
" -i : info.xml file for extra attributes\n"
+ " -f : files.xml file for extra attributes\n"
" -h : print help & exit\n"
);
exit(status);
@@ -46,10 +47,10 @@ main(int argc, char **argv)
{
Pool *pool;
Repo *repo;
- char *infofile;
+ char *infofile = 0, *filesfile = 0;
int c;
- while ((c = getopt(argc, argv, "hi:")) >= 0)
+ while ((c = getopt(argc, argv, "hi:f:")) >= 0)
{
switch(c)
{
@@ -59,6 +60,9 @@ main(int argc, char **argv)
case 'i':
infofile = optarg;
break;
+ case 'f':
+ filesfile = optarg;
+ break;
default:
usage(1);
break;
@@ -78,6 +82,17 @@ main(int argc, char **argv)
repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
fclose(fp);
}
+ if (filesfile)
+ {
+ FILE *fp = solv_xfopen(filesfile, "r");
+ if (!fp)
+ {
+ perror(filesfile);
+ exit(1);
+ }
+ repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ fclose(fp);
+ }
repo_internalize(repo);
tool_write(repo, 0, 0);
pool_free(pool);