Fix confusing error message 0.4.3
authorJ. Ali Harlow <ali@juiblex.co.uk>
Fri, 23 Mar 2012 20:29:50 +0000 (20:29 +0000)
committerJ. Ali Harlow <ali@juiblex.co.uk>
Fri, 23 Mar 2012 20:29:50 +0000 (20:29 +0000)
plover/razor.c

index 9e93d2e..3379711 100644 (file)
@@ -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;