From c57370decf4e204cf4e3323e669cc676a2760707 Mon Sep 17 00:00:00 2001 From: James Bowes Date: Thu, 26 Jun 2008 17:16:13 -0400 Subject: Add return codes to razor_set_open_files and open_details --- src/main.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index d177bc5..268eece 100644 --- a/src/main.c +++ b/src/main.c @@ -198,9 +198,11 @@ command_list_files(int argc, const char *argv[]) struct razor_set *set; set = razor_set_open(repo_filename); - razor_set_open_files(set, "system-files.repo"); if (set == NULL) return 1; + if (razor_set_open_files(set, "system-files.repo")) + return 1; + razor_set_list_files(set, argv[0]); razor_set_destroy(set); @@ -214,9 +216,10 @@ command_list_file_packages(int argc, const char *argv[]) struct razor_package_iterator *pi; set = razor_set_open(repo_filename); - razor_set_open_files(set, "system-files.repo"); if (set == NULL) return 1; + if (razor_set_open_files(set, "system-files.repo")) + return 1; pi = razor_package_iterator_create_for_file(set, argv[0]); list_packages(pi, 0); @@ -233,9 +236,11 @@ command_list_package_files(int argc, const char *argv[]) struct razor_set *set; set = razor_set_open(repo_filename); - razor_set_open_files(set, "system-files.repo"); if (set == NULL) return 1; + if (razor_set_open_files(set, "system-files.repo")) + return 1; + razor_set_list_package_files(set, argv[0]); razor_set_destroy(set); @@ -824,7 +829,10 @@ command_info(int argc, const char *argv[]) const char *summary, *description, *url, *license; set = razor_set_open(repo_filename); - razor_set_open_details(set, "system-details.repo"); + if (set == NULL) + return 1; + if (razor_set_open_details(set, "system-details.repo")) + return 1; pi = razor_package_iterator_create(set); while (razor_package_iterator_next(pi, &package, &name, &version, &arch)) { -- cgit v1.2.3