summaryrefslogtreecommitdiff
path: root/tools/mdk2solv.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-04-13 19:23:33 +0200
committerMichael Schroeder <mls@suse.de>2012-04-13 19:23:33 +0200
commit5702cc433a97b2365801855bdc5572f940d8bc9a (patch)
tree68a62cbfd9cdfa8f2fd755b2a39b71773bb30afe /tools/mdk2solv.c
parentca1d509d28858cd9d74a4ee7724e774b58ec459c (diff)
downloadlibsolv-5702cc433a97b2365801855bdc5572f940d8bc9a.tar.gz
libsolv-5702cc433a97b2365801855bdc5572f940d8bc9a.tar.bz2
libsolv-5702cc433a97b2365801855bdc5572f940d8bc9a.zip
- add pool_error and pool_errstr. get rid of lots of exit() calls.
Diffstat (limited to 'tools/mdk2solv.c')
-rw-r--r--tools/mdk2solv.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/tools/mdk2solv.c b/tools/mdk2solv.c
index f680f65..dcf9d6f 100644
--- a/tools/mdk2solv.c
+++ b/tools/mdk2solv.c
@@ -70,7 +70,11 @@ main(int argc, char **argv)
}
pool = pool_create();
repo = repo_create(pool, "<stdin>");
- repo_add_mdk(repo, stdin, REPO_NO_INTERNALIZE);
+ if (repo_add_mdk(repo, stdin, REPO_NO_INTERNALIZE))
+ {
+ fprintf(stderr, "mdk2solv: %s\n", pool_errstr(pool));
+ exit(1);
+ }
if (infofile)
{
FILE *fp = solv_xfopen(infofile, "r");
@@ -79,7 +83,11 @@ main(int argc, char **argv)
perror(infofile);
exit(1);
}
- repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ if (repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE))
+ {
+ fprintf(stderr, "mdk2solv: %s\n", pool_errstr(pool));
+ exit(1);
+ }
fclose(fp);
}
if (filesfile)
@@ -90,7 +98,11 @@ main(int argc, char **argv)
perror(filesfile);
exit(1);
}
- repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+ if (repo_add_mdk_info(repo, fp, REPO_EXTEND_SOLVABLES | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE))
+ {
+ fprintf(stderr, "mdk2solv: %s\n", pool_errstr(pool));
+ exit(1);
+ }
fclose(fp);
}
repo_internalize(repo);