2 * Copyright (c) 2007, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
13 #include <sys/types.h>
23 #include "repo_solv.h"
24 #include "common_write.h"
29 fprintf(stderr, "\nUsage:\n"
30 "mergesolv [file] [file] [...]\n"
31 " merges multiple solv files into one and writes it to stdout\n"
37 loadcallback (Pool *pool, Repodata *data, void *vdata)
40 const char *location = repodata_lookup_str(data, 0, REPOSITORY_LOCATION);
43 fprintf(stderr, "Loading SOLV file %s\n", location);
44 fp = fopen (location, "r");
52 main(int argc, char **argv)
56 const char *basefile = 0;
61 repo = repo_create(pool, "<mergesolv>");
63 while ((c = getopt(argc, argv, "ahb:")) >= 0)
81 pool_setloadcallback(pool, loadcallback, 0);
83 for (; optind < argc; optind++)
86 if ((fp = fopen(argv[optind], "r")) == NULL)
91 repo_add_solv(repo, fp);
94 tool_write(repo, basefile, 0);