From b1b0ee5d6af26ab863d151408f140ee50db31c90 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 25 Sep 2014 15:05:10 +0900 Subject: [PATCH] marrakesh server - accept build script as arg --- mrk-srv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mrk-srv.c b/mrk-srv.c index 8815a14..94971a1 100644 --- a/mrk-srv.c +++ b/mrk-srv.c @@ -11,6 +11,7 @@ static const char *sane_name_veto[] = {"../", "./", "/", NULL}; static const char *sane_name_ok = "01234567890-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ."; static char *repodir = "./repo"; +static char *build_sh = "./mrk-srv-build.sh"; static int sane_forbidden_path(const char *file, const char **forbidden) @@ -143,9 +144,7 @@ client_upload_end(Client *c) { fclose(c->f); c->f = NULL; - snprintf(tmp, sizeof(tmp), - "./mrk-srv-build.sh %s %s", - c->dir, repodir); + snprintf(tmp, sizeof(tmp), "%s %s %s", build_sh, c->dir, repodir); c->exe = ecore_exe_pipe_run(tmp, ECORE_EXE_TERM_WITH_PARENT | ECORE_EXE_NOT_LEADER, c); @@ -324,7 +323,7 @@ main(int argc, char **argv) if (argc < 2) { printf("usage:\n" - " mrk-srv /path/to/repo\n" + " mrk-srv [REPO_DIR] [BUILD_SCRIPT]\n" "\n"); exit(1); } @@ -335,6 +334,7 @@ main(int argc, char **argv) ecore_ipc_init(); if (argc > 1) repodir = ecore_file_realpath(argv[1]); + if (argc > 2) build_sh = ecore_file_realpath(argv[2]); if (ipc_init()) {