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)
42 fprintf(stderr, "Loading SOLV file %s\n", data->location);
43 fp = fopen (data->location, "r");
45 perror(data->location);
51 main(int argc, char **argv)
55 const char *basefile = 0;
60 repo = repo_create(pool, "<mergesolv>");
62 while ((c = getopt(argc, argv, "ahb:")) >= 0)
80 pool_setloadcallback(pool, loadcallback, 0);
82 for (; optind < argc; optind++)
85 if ((fp = fopen(argv[optind], "r")) == NULL)
90 repo_add_solv(repo, fp);
93 tool_write(repo, basefile, 0);