X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-runscript.c;h=a3f4c2f6d07efe0e21c071483264b2deca97a301;hb=ba901e2a9d0361de899461397cc6380549f8661a;hp=06d0c701bde537cd86aef6513c58cd3803301a1b;hpb=b1e87f6766c86bb68072a3d01752a96ad1134542;p=zpackage diff --git a/zpm-runscript.c b/zpm-runscript.c index 06d0c70..a3f4c2f 100644 --- a/zpm-runscript.c +++ b/zpm-runscript.c @@ -148,10 +148,12 @@ int main(int ac, char **av){ pkgid = zpm_findpkg(&zpm, pkgstr); if (pkgid) { if (zpm_script_hash(&zpm, pkgid, phase, hash)) { + /* since the script file name doesn't really + * mean anything, pass in the phase as arg 0 + */ - /* perhaps also pass in the phase name? or ENV? */ /* TODO sanitize environment ? */ - args[0] = script; + args[0] = phase; args[1] = pkgid; args[2] = 0; args[3] = 0; @@ -192,8 +194,12 @@ int main(int ac, char **av){ pkgid, rv); } /* TODO log output */ - unlink(script); - unlink(output); + if (script) { + unlink(script); + } + if (output) { + unlink(output); + } if (rv) { failures++; }