X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tools%2Fsusetags2solv.c;h=f7544dc587274b6efbf5ba994f05ec0331903e95;hb=1aac48dff40ef592968a18058bad270da65ed847;hp=71c65d800d143a391d36dce14693531a18506a4b;hpb=1fdd979e90b0178cd508a841caf7378e1f3e0327;p=platform%2Fupstream%2Flibsolv.git diff --git a/tools/susetags2solv.c b/tools/susetags2solv.c index 71c65d8..f7544dc 100644 --- a/tools/susetags2solv.c +++ b/tools/susetags2solv.c @@ -8,14 +8,11 @@ #define _GNU_SOURCE #include -#include -#include #include #include #include #include -#include -#include +#include #include "pool.h" #include "repo.h" @@ -32,13 +29,11 @@ static void usage(int status) { fprintf(stderr, "\nUsage:\n" - "susetags2solv [-b ][-c ][-d ][-h][-n ]\n" + "susetags2solv [-c ][-d ][-h][-n ]\n" " reads a 'susetags' repository from and writes a .solv file to \n" - " -b : save as multiple files starting with \n" " -c : parse given contentfile (for product information)\n" " -d : do not read from stdin, but use data in descrdir\n" " -h : print help & exit\n" - " -n : save attributes as .attr\n" ); exit(status); } @@ -64,9 +59,7 @@ int main(int argc, char **argv) { const char *contentfile = 0; - const char *attrname = 0; const char *descrdir = 0; - const char *basefile = 0; const char *query = 0; const char *mergefile = 0; Id defvendor = 0; @@ -78,25 +71,19 @@ main(int argc, char **argv) Pool *pool; Repo *repo; - while ((c = getopt(argc, argv, "hn:c:d:b:q:M:X")) >= 0) + while ((c = getopt(argc, argv, "hc:d:q:M:X")) >= 0) { switch (c) { case 'h': usage(0); break; - case 'n': - attrname = optarg; - break; case 'c': contentfile = optarg; break; case 'd': descrdir = optarg; break; - case 'b': - basefile = optarg; - break; case 'q': query = optarg; break; @@ -135,20 +122,6 @@ main(int argc, char **argv) fclose(fp); } - if (attrname) - { - /* ensure '.attr' suffix */ - const char *dot = strrchr(attrname, '.'); - if (!dot || strcmp(dot, ".attr")) - { - int len = strlen (attrname); - char *newname = (char *)malloc(len + 6); /* alloc for +'.attr'+'\0' */ - strcpy (newname, attrname); - strcpy (newname+len, ".attr"); - attrname = newname; - } - } - /* * descrdir path given, open files and read from there */ @@ -200,7 +173,7 @@ main(int argc, char **argv) perror(fn); exit(1); } - if (repo_add_susetags(repo, fp, defvendor, 0, flags | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE)) + if (repo_add_susetags(repo, fp, defvendor, 0, flags | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE | SUSETAGS_RECORD_SHARES)) { fprintf(stderr, "susetags2solv: %s: %s\n", fnp, pool_errstr(pool)); exit(1); @@ -314,7 +287,7 @@ main(int argc, char **argv) if (query) doquery(pool, repo, query); else - tool_write(repo, basefile, attrname); + tool_write(repo, stdout); pool_free(pool); exit(0); }