1 // Tweak git/exec-cmd.c for navymail needs
2 // Copyright (C) 2011 Kirill Smelkov <kirr@navytux.spb.ru>
4 // This program is free software: you can Use, Study, Modify and Redistribute it
5 // under the terms of the GNU General Public License version 2. This program is
6 // distributed WITHOUT ANY WARRANTY. See COPYING file for full License terms.
11 +#include "navymail/navymail.h"
14 // system_path: always use runtime prefix, navymail way
17 system_path(const char *path)
19 - ... // kill init for static const char prefix under #ifdef
20 + const char *prefix = navymail_prefix();
22 struct strbuf d = STRBUF_INIT;
24 if (is_absolute_path(path))
27 - ... // kill git's approach to runtime prefix under #ifdef
29 strbuf_addf(&d, "%s/%s", prefix, path);
33 // git's set/get exec_path -> navymail
36 -git_set_argv_exec_path
37 +navymail_set_argv_exec_path
38 (const char *exec_path)
42 - EXEC_PATH_ENVIRONMENT,
43 + NAVYMAIL_EXEC_PATH_ENV,
55 - EXEC_PATH_ENVIRONMENT
56 + NAVYMAIL_EXEC_PATH_ENV
59 - return system_path(GIT_EXEC_PATH);
60 // XXX how to use NAVYMAIL_EXEC_PATH_ENV here?
61 + /* argv_exec_path should be set early by navymail_setup_path() */
62 + die("BUG: both argv_exec_path and $NAVYMAIL_EXEC_PATH unset.");
68 * XXX at present "git" is changed to "navymail" in prepare_git_cmd() and
69 * execv_git_cmd(). I'm not sure this is not correct, because we might want to
70 * change those functions to navymail_ later and run git via our own special
71 * helper. Postponing this issue.
75 // include "common.cocci" (XXX "included" by build system via generating %.cocci+)