From c09d4225f6e9b29aeb901752ba1f2016431f26b1 Mon Sep 17 00:00:00 2001 From: J. Ali Harlow Date: Fri, 23 Mar 2012 20:29:50 +0000 Subject: [PATCH] Fix confusing error message --- plover/razor.c | 26 ++++++++++++++++++++------ 1 files changed, 20 insertions(+), 6 deletions(-) diff --git a/plover/razor.c b/plover/razor.c index 9e93d2e..3379711 100644 --- a/plover/razor.c +++ b/plover/razor.c @@ -183,13 +183,19 @@ int plover_run_transaction(struct razor_transaction *trans, * script failures are treated as warnings. Be * nice and tell the user _which_ script failed. */ - fprintf(stderr, - "%s: %s(%s-%s.%s) scriptlet failed, exit status %d\n", - stage==RAZOR_STAGE_SCRIPTS_PRE?"error":"warning", - action==RAZOR_INSTALL_ACTION_ADD?"%pre":"%preun", - name,version,arch,r); if (stage==RAZOR_STAGE_SCRIPTS_PRE) + { + fprintf(stderr, + "error: %s(%s-%s.%s) scriptlet failed, exit status %d\n", + action==RAZOR_INSTALL_ACTION_ADD?"%pre":"%preun", + name,version,arch,r); return -1; + } + else + fprintf(stderr, + "warning: %s(%s-%s.%s) scriptlet failed, exit status %d\n", + action==RAZOR_INSTALL_ACTION_ADD?"%post":"%postun", + name,version,arch,r); } } return 0; @@ -308,6 +314,14 @@ int plover_install(const char *base,const char *prefix,char **pkgs) } } system=razor_root_get_system_set(root); + if (!system) + { + fprintf(stderr,"Internal error: No system set\n"); + razor_root_close(root); + if (relocations) + razor_relocations_destroy(relocations); + return -1; + } s=plover_strconcat(base,"/repodata",NULL); if (s) { @@ -486,7 +500,7 @@ int plover_remove(char **pkgs) { int i,retval=0; char *install_root; - struct razor_set *system,*set,*upstream; + struct razor_set *system,*upstream; struct razor_transaction *trans; struct razor_root *root; struct razor_error *error=NULL; -- 1.7.1