diff options
Diffstat (limited to 'src/build.c')
| -rw-r--r-- | src/build.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/build.c b/src/build.c index 855b38b..243f3bc 100644 --- a/src/build.c +++ b/src/build.c @@ -2,10 +2,12 @@ #include "package.h" #include "paths.h" +#include "download.h" #include "lauxlib.h" #include "lua.h" #include "lualib.h" #include "stdio.h" +#include "stdlib.h" #include "unistd.h" int pow_package_build(pow_package *pkg) { @@ -31,16 +33,25 @@ int pow_package_build(pow_package *pkg) { if ((err = chdir(tmp_path))) { printf("uh oh oops %d\n", err); + + return 1; } + printf("building package %s\n", pkg->name); + + pow_download_source(pkg->sources[0], tmp_path); + lua_getfield(pkg->L, -1, "build"); if (lua_pcall(pkg->L, 0, 0, 0) != LUA_OK) { + free(tmp_path); + printf("error running script: %s\n", lua_tostring(pkg->L, -1)); return 1; } + free(tmp_path); fflush(stdout); return 0; |
