diff -r b0a35bae4961 -r c880957671f6 update/update.c --- a/update/update.c Thu Nov 10 11:15:09 2011 +0000 +++ b/update/update.c Mon Nov 17 11:36:20 2014 +0000 @@ -27,18 +27,20 @@ void update(const char *argv0) { - char *path,*s,*prefix; + char *path; + gchar *s,*prefix; int ch; struct comps *comps; + GError *error=NULL; path=plover_get_program_directory(argv0); - s=plover_strconcat(path,"/repodata/comps.xml",NULL); + s=g_strconcat(path,"/repodata/comps.xml",NULL); comps=plover_comps_new_from_file(s); if (!comps) { perror(s); exit(1); } - free(s); + g_free(s); prefix=plover_default_prefix_for_vendor(comps->vendor); if (!plover_installed_files_match_prefix(prefix)) { @@ -50,11 +52,21 @@ exit(1); while(ch!='\n' && ch!=EOF) ch=getchar(); - plover_remove(NULL); + if (plover_remove(NULL,&error)) + { + fprintf(stderr,"%s\n",error->message); + g_error_free(error); + exit(1); + } } plover_comps_free(comps); - plover_update(path,prefix,NULL); - free(prefix); + if (!plover_update(path,prefix,NULL,&error)) + { + fprintf(stderr,"%s\n",error->message); + g_error_free(error); + exit(1); + } + g_free(prefix); free(path); }