# HG changeset patch # User J. Ali Harlow # Date 1332534590 0 # Node ID 5cbb66c24fc658c2a9b97ed175ca36fc9efd991b # Parent 4da45725031f56bae974c7a46f3a901d6f1360a9 Fix confusing error message diff -r 4da45725031f -r 5cbb66c24fc6 plover/razor.c --- a/plover/razor.c Fri Mar 23 20:29:24 2012 +0000 +++ b/plover/razor.c Fri Mar 23 20:29:50 2012 +0000 @@ -183,13 +183,19 @@ * 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 @@ } } 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 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;