]> pd.if.org Git - zpackage/commitdiff
add note for failing script
authorNathan Wagner <nw@hydaspes.if.org>
Mon, 26 Nov 2018 09:23:27 +0000 (09:23 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Mon, 26 Nov 2018 09:23:27 +0000 (09:23 +0000)
zpm-script.c

index b8c94589f5d623d4463bc0a5a91b941e20eb5527..ba057ef72303d2e02d358fc2d6a10d785d62aafd 100644 (file)
@@ -319,6 +319,7 @@ int main(int ac, char **av){
                if (!zpm_extract(&zpm, hash, script, 0700)) {
                        fprintf(stderr, "unable to extract script");
                        fail = HARD;
+                       zpm_note_add(&zpm, pkgid, NULL, hash, "unable to extract %s script", phase);
                        goto cleanup;
                }
 
@@ -326,6 +327,10 @@ int main(int ac, char **av){
                if (rv) {
                        fprintf(stderr, "package %s script failed with code %d\n",
                                        pkgid, rv);
+                       
+                       zpm_import(&zpm, output, 0, hash);
+                       zpm_note_add(&zpm, pkgid, NULL, hash, "package %s script failed with code %d", phase, rv);
+
                        fail = HARD;
                }
 
@@ -343,5 +348,4 @@ cleanup:
        zpm_close(&zpm);
 
        return (fail == HARD || (required && fail)) ? EXIT_FAILURE : 0;
-
 }