X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-script.c;h=a91f2ac3195974c030a0fc5b28c9645e319feaf6;hb=6cd290b379076aa17eed531cb23585b20cae3a37;hp=359970abd567d7934d641864c8e4e034e7c8d706;hpb=636836fc0d1e5126ad94a73be80a7eea7d984d09;p=zpackage diff --git a/zpm-script.c b/zpm-script.c index 359970a..a91f2ac 100644 --- a/zpm-script.c +++ b/zpm-script.c @@ -119,6 +119,12 @@ int run(char *program, char **args, char *output, int *status) { #define SOFT 1 #define HARD 2 +static int list_scripts(void *ud, const char *pkg, const char *stage, + const char *hash) { + printf("%s %s %.8s\n", pkg, stage, hash); + return 0; +} + int main(int ac, char **av){ struct zpm zpm; int rv; @@ -248,7 +254,9 @@ int main(int ac, char **av){ fail = HARD; } } else if (mode == LIST) { - if (!zpm_script_hash(&zpm, pkgid, phase, hash)) { + if (!phase) { + zpm_foreach_script(&zpm, pkgid, phase, 0, list_scripts); + } else if (!zpm_script_hash(&zpm, pkgid, phase, hash)) { fail = SOFT; } else if (scriptishash) { printf("%s\n", hash);