diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2012-12-17 12:44:39 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-01-09 13:56:07 +0100 |
commit | 9b1b206a8881205b285db07733487283b6a8a806 (patch) | |
tree | a0f2b01fc53672c2aa8fb0f7f2d595385a47db1b /tools | |
parent | 377666075f7eb5ee07e0c76ed18ce417f7491150 (diff) | |
download | msitools-9b1b206a8881205b285db07733487283b6a8a806.tar.gz msitools-9b1b206a8881205b285db07733487283b6a8a806.tar.xz msitools-9b1b206a8881205b285db07733487283b6a8a806.zip |
database: make import() GObject-like
Diffstat (limited to 'tools')
-rw-r--r-- | tools/msibuild.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tools/msibuild.c b/tools/msibuild.c index 51e27be..50cbd6a 100644 --- a/tools/msibuild.c +++ b/tools/msibuild.c @@ -129,21 +129,21 @@ static LibmsiResult open_database(const char *msifile, LibmsiDatabase **db, static LibmsiDatabase *db; static LibmsiSummaryInfo *si; -static int import_table(char *table) +static gboolean import_table(char *table, GError **error) { - LibmsiResult r; + gboolean success = TRUE; char dir[PATH_MAX]; if (getcwd(dir, PATH_MAX) == NULL) return 1; - r = libmsi_database_import(db, dir, table); - if (r != LIBMSI_RESULT_SUCCESS) + if (!libmsi_database_import(db, dir, table, error)) { - fprintf(stderr, "failed to import table %s (%u)\n", table, r); + fprintf(stderr, "failed to import table %s\n", table); + success = FALSE; } - return (r != LIBMSI_RESULT_SUCCESS); + return success; } static gboolean add_summary_info(const char *name, const char *author, @@ -249,7 +249,7 @@ static void show_usage(void) int main(int argc, char *argv[]) { GError *error = NULL; - int r; + int r = LIBMSI_RESULT_SUCCESS; int n; g_type_init(); @@ -293,10 +293,9 @@ int main(int argc, char *argv[]) break; case 'i': do { - ret = import_table(argv[1]); - if (ret) { + if (!import_table(argv[1], &error)) break; - } + argc--, argv++; } while (argv[1] && argv[1][0] != '-'); argc--, argv++; |