package

simple and robust package manager
Log | Files | Refs | README

commit d0c9c5e3e8733dd27ae3bbf8fec89cb1085c69bc
parent 88773691eaf13d0a5d659c5250b06e49e3b4c563
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 19 Jan 2019 20:06:00 +0100

permit build-time dependencies

Diffstat:
Mpackage-add.c | 26+++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/package-add.c b/package-add.c @@ -82,7 +82,7 @@ main(int argc, char **argv) { stralloc sa = STRALLOC_ZERO; package *p = genalloc_get(&ga, package, i); - char const *argv[] = { "package-build", "-d", def, "-p", pkg, fmt, NULL }; + char const *argv[] = { NULL, "-d", def, "-p", pkg, NULL, NULL, NULL, NULL }; fmt[package_fmt(p, fmt)] = '\0'; @@ -92,21 +92,21 @@ main(int argc, char **argv) if (!stralloc_cats(&sa, fmt)) die_nomem(); if (!stralloc_cats(&sa, "/current")) die_nomem(); if (!stralloc_cat0(&sa)) die_nomem(); - if (stat_islink(sa.x)) continue; + if (stat_islink(sa.x)) goto install; + argv[0] = "package-build"; + argv[5] = fmt; + argv[6] = NULL; log_info_2("package-build ", fmt); if ((x = forkexec_wait(argv)) != 0) goto error; - } - - if (!flag_i) return 0; - - for (size_t i = 0; i < genalloc_len(&ga, package); ++i) - { - package *p = genalloc_get(&ga, package, i); - char const *argv[] = { "package-install", "-r", root, "-d", def, "-p", pkg, fmt, NULL }; - - fmt[package_fmt(p, fmt)] = '\0'; - +install: + if (!flag_i) continue; + + argv[0] = "package-install"; + argv[5] = "-r"; + argv[6] = root; + argv[7] = fmt; + argv[8] = NULL; log_info_2("package-install ", fmt); if ((x = forkexec_wait(argv)) != 0) goto error; }