mrk redo - make it work again ... another effort
This commit is contained in:
parent
9c3cb5a9f5
commit
cd3922c8a9
1
mrk.c
1
mrk.c
|
@ -193,6 +193,7 @@ main(int argc, char **argv)
|
|||
Mrk_Build *bld = mrk_build_load("Marrakesh.mrk");
|
||||
if (!bld) _mrk_err("Failed to load Marrakesh.mrk\n");
|
||||
snprintf(tmp, sizeof(tmp), "%s-%s.mkb", bld->name, bld->version);
|
||||
if (!ecore_file_exists(build_tmpdir)) _mrk_err("No build dir!\n");
|
||||
if (!mrk_build_package_bin(bld, tmp, build_tmpdir, os, arch))
|
||||
{
|
||||
mrk_build_free(bld);
|
||||
|
|
|
@ -103,11 +103,12 @@ parse_content(char *mem, size_t size)
|
|||
char *p = mem;
|
||||
int skipline = 0;
|
||||
int startline = 0;
|
||||
int line = 1;
|
||||
char *seg = NULL, *s;
|
||||
char *data1 = NULL, *data2 = NULL;
|
||||
int i;
|
||||
Tag_Mode mode = TMODE_TEXT;
|
||||
#define err(reason) do { fprintf(stderr, "%s\n", reason); goto error; } while (0)
|
||||
#define err(reason...) do { fprintf(stderr, ##reason); goto error; } while (0)
|
||||
|
||||
bld = calloc(1, sizeof(Mrk_Build));
|
||||
if (!bld) return NULL;
|
||||
|
@ -116,6 +117,7 @@ parse_content(char *mem, size_t size)
|
|||
{
|
||||
if (prevc == '\n')
|
||||
{
|
||||
line++;
|
||||
if (*p == '#') skipline = 1;
|
||||
else skipline = 0;
|
||||
startline = 1;
|
||||
|
@ -127,7 +129,7 @@ parse_content(char *mem, size_t size)
|
|||
|
||||
prevp = p;
|
||||
tok = parse_token(&p, end);
|
||||
if (!tok) err("token parse error");
|
||||
if (!tok) err("%i: token parse error\n", line);
|
||||
if (startline)
|
||||
{
|
||||
for (i = 0; tags[i].tag; i++)
|
||||
|
@ -151,25 +153,25 @@ not_tag:
|
|||
case TMODE_TEXT:
|
||||
p = prevp;
|
||||
data1 = parse_eol(&p, end);
|
||||
if (!data1) err("no content");
|
||||
if (!data1) err("%i: no content\n", line);
|
||||
break;
|
||||
case TMODE_PATH:
|
||||
case TMODE_PATH_LIST:
|
||||
data1 = path_check(tok);
|
||||
if (!data1) err("path invalid");
|
||||
if (!data1) err("%i: path invalid\n", line);
|
||||
break;
|
||||
case TMODE_PATH_CP:
|
||||
case TMODE_PATH_CP_LIST:
|
||||
data1 = path_check(tok);
|
||||
if (!data1) err("path invalid");
|
||||
if (!data1) err("%i: path invalid\n", line);
|
||||
s = parse_token(&p, end);
|
||||
if (!s) err("missing > in path copy");
|
||||
if (!(!strcmp(s, ">"))) err("copy token is not >");
|
||||
if (!s) err("%i: missing > in path copy\n", line);
|
||||
if (!(!strcmp(s, ">"))) err("%i: copy token is not >\n", line);
|
||||
free(s);
|
||||
s = parse_token(&p, end);
|
||||
if (!s) err("missing destination path in path copy");
|
||||
if (!s) err("%i: missing destination path in path copy\n", line);
|
||||
data2 = path_check(s);
|
||||
if (!data2) err("destination path not valid");
|
||||
if (!data2) err("%i: destination path not valid\n", line);
|
||||
free(s);
|
||||
break;
|
||||
default:
|
||||
|
@ -180,7 +182,7 @@ not_tag:
|
|||
if (!strcmp(seg, "PROJ:"))
|
||||
{
|
||||
if (!_mrk_util_plain_file_check(data1))
|
||||
err("name failed sanity check");
|
||||
err("%i: name failed sanity check\n", line);
|
||||
eina_stringshare_del(bld->name);
|
||||
bld->name = eina_stringshare_add(data1);
|
||||
}
|
||||
|
@ -337,6 +339,7 @@ not_tag:
|
|||
}
|
||||
free(tok);
|
||||
prevc = *p;
|
||||
p++;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -530,9 +533,9 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd)
|
|||
}
|
||||
EINA_LIST_FOREACH(bin->deps, ll, s)
|
||||
{
|
||||
eina_strbuf_append(buf, " pkg-config --cflags --libs ");
|
||||
eina_strbuf_append(buf, " `pkg-config --cflags --libs ");
|
||||
eina_strbuf_append(buf, s);
|
||||
eina_strbuf_append(buf, " ");
|
||||
eina_strbuf_append(buf, "`");
|
||||
}
|
||||
EINA_LIST_FOREACH(bin->incs, ll, s)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ static const char *sane_name_ok =
|
|||
static const char *sane_path_veto[] =
|
||||
{"../", "./", NULL};
|
||||
static const char *sane_path_ok =
|
||||
"01234567890-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. ";
|
||||
"/01234567890-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ. ";
|
||||
|
||||
static int
|
||||
_sane_forbidden_path(const char *file, const char **forbidden)
|
||||
|
|
Loading…
Reference in New Issue