Reduce harmless warnings from run_script().
authorKristian Høgsberg <krh@redhat.com>
Mon, 7 Apr 2008 05:03:07 +0000 (01:03 -0400)
committerKristian Høgsberg <krh@redhat.com>
Mon, 7 Apr 2008 05:03:07 +0000 (01:03 -0400)
Makefile
rpm.c

index 964c406..6d450d1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ test : test-driver
        ./test-driver test.xml
 
 reset : ./razor
-       rm -rf install
+       sudo rm -rf install
        ./razor init
 
 clean :
diff --git a/rpm.c b/rpm.c
index 58e0960..ffb17eb 100644 (file)
--- a/rpm.c
+++ b/rpm.c
@@ -353,9 +353,7 @@ run_script(struct installer *installer,
        program = razor_rpm_get_indirect(installer->rpm, program_tag, NULL);
        script = razor_rpm_get_indirect(installer->rpm, script_tag, NULL);
        if (program == NULL && script == NULL) {
-               printf("no script or program for tags %d and %d\n",
-                      program_tag, script_tag);
-               return -1;
+               return;
        } else if (program == NULL) {
                program = "/bin/sh";
        }
@@ -400,7 +398,8 @@ run_script(struct installer *installer,
                        fprintf(stderr, "wait for child failed, %m");
                        return -1;
                }
-               printf("script exited with status %d\n", status);
+               if (status)
+                       printf("script exited with status %d\n", status);
        }
 
        return 0;