summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-27 18:26:30 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-11-27 18:26:30 +0900
commit7c243ec57c1ce7778cd14673aa3157d2e0a9ea95 (patch)
tree36ab4c2525cf670bd0d7ca1ae04669eb346a58f2
parent83983c560a44e8f6025893c8aae8db94c3370342 (diff)
mrk build - add incrimental build like make and color output
-rw-r--r--mrk.c35
-rw-r--r--mrklib.h2
-rw-r--r--mrklib_buildfile.c235
3 files changed, 215 insertions, 57 deletions
diff --git a/mrk.c b/mrk.c
index d9b802f..4237395 100644
--- a/mrk.c
+++ b/mrk.c
@@ -13,6 +13,8 @@
13static const char *server_host = "devs.enlightenment.org"; 13static const char *server_host = "devs.enlightenment.org";
14static int server_port = 10077; 14static int server_port = 10077;
15static const char *build_tmpdir = "Marrakesh"; 15static const char *build_tmpdir = "Marrakesh";
16static const char *build_chkdir = "Marrakesh-Check";
17static const char *build_objdir = "Marrakesh-Obj";
16static const char *arch = NULL; 18static const char *arch = NULL;
17static const char *os = NULL; 19static const char *os = NULL;
18 20
@@ -147,6 +149,7 @@ main(int argc, char **argv)
147 printf("mrk sub commands:\n" 149 printf("mrk sub commands:\n"
148// " new\n" 150// " new\n"
149 " build\n" 151 " build\n"
152 " clean\n"
150 " bin\n" 153 " bin\n"
151 " check\n" 154 " check\n"
152 " src\n" 155 " src\n"
@@ -154,7 +157,7 @@ main(int argc, char **argv)
154 " inst FILE\n" 157 " inst FILE\n"
155 " rm PKGNAME\n" 158 " rm PKGNAME\n"
156 " rel [FILE]\n" 159 " rel [FILE]\n"
157 " clean\n" 160 " fixup\n"
158 " down PKGNAME\n" 161 " down PKGNAME\n"
159 " get PKGNAME\n" 162 " get PKGNAME\n"
160 " getsrc PKGNAME\n" 163 " getsrc PKGNAME\n"
@@ -172,23 +175,31 @@ main(int argc, char **argv)
172 os = mrk_os_get(); 175 os = mrk_os_get();
173 arch = mrk_arch_get(); 176 arch = mrk_arch_get();
174 177
175 if (getenv("MRKHOST")) server_host = getenv("MRKHOST"); 178 if (getenv("MRKHOST")) server_host = getenv("MRKHOST");
176 if (getenv("MRKPORT")) server_port = atoi(getenv("MRKPORT")); 179 if (getenv("MRKPORT")) server_port = atoi(getenv("MRKPORT"));
177 if (getenv("MRKARCH")) arch = getenv("MRKARCH"); 180 if (getenv("MRKARCH")) arch = getenv("MRKARCH");
178 if (getenv("MRKOS")) os = getenv("MRKOS"); 181 if (getenv("MRKOS")) os = getenv("MRKOS");
179 if (getenv("MRKDIR")) build_tmpdir = getenv("MRKDIR"); 182 if (getenv("MRKDIR")) build_tmpdir = getenv("MRKDIR");
183 if (getenv("MRKCHKDIR")) build_chkdir = getenv("MRKCHKDIR");
184 if (getenv("MRKOBJDIR")) build_objdir = getenv("MRKOBJDIR");
180 185
181 if (!strcmp(argv[1], "build")) 186 if (!strcmp(argv[1], "build"))
182 { 187 {
183 Mrk_Build *bld = mrk_build_load("Marrakesh.mrk"); 188 Mrk_Build *bld = mrk_build_load("Marrakesh.mrk");
184 if (!bld) _mrk_err("Failed to load Marrakesh.mrk\n"); 189 if (!bld) _mrk_err("Failed to load Marrakesh.mrk\n");
185 if (!mrk_build_do(bld, build_tmpdir)) 190 if (!mrk_build_do(bld, build_tmpdir, build_objdir))
186 { 191 {
187 mrk_build_free(bld); 192 mrk_build_free(bld);
188 _mrk_err("Failed to build Marrakesh.mrk\n"); 193 _mrk_err("Failed to build Marrakesh.mrk\n");
189 } 194 }
190 mrk_build_free(bld); 195 mrk_build_free(bld);
191 } 196 }
197 else if (!strcmp(argv[1], "clean"))
198 {
199 ecore_file_recursive_rm(build_tmpdir);
200 ecore_file_recursive_rm(build_chkdir);
201 ecore_file_recursive_rm(build_objdir);
202 }
192 else if (!strcmp(argv[1], "src")) 203 else if (!strcmp(argv[1], "src"))
193 { 204 {
194 char tmp[4096]; 205 char tmp[4096];
@@ -228,9 +239,9 @@ main(int argc, char **argv)
228 _mrk_err("Failed to install\n"); 239 _mrk_err("Failed to install\n");
229 if (!mrk_package_bin_clean()) _mrk_err("Failed to clean\n"); 240 if (!mrk_package_bin_clean()) _mrk_err("Failed to clean\n");
230 } 241 }
231 else if (!strcmp(argv[1], "clean")) 242 else if (!strcmp(argv[1], "fixup"))
232 { 243 {
233 if (!mrk_package_bin_clean()) _mrk_err("Failed to clean\n"); 244 if (!mrk_package_bin_clean()) _mrk_err("Failed to fix up dangling links\n");
234 } 245 }
235 else if (!strcmp(argv[1], "rm")) 246 else if (!strcmp(argv[1], "rm"))
236 { 247 {
@@ -246,11 +257,11 @@ main(int argc, char **argv)
246 Mrk_Build *bld; 257 Mrk_Build *bld;
247 char tmp[4096]; 258 char tmp[4096];
248 259
249 ecore_file_recursive_rm("Marrakesh-Check"); 260 ecore_file_recursive_rm(build_chkdir);
250 ecore_file_mkdir("Marrakesh-Check"); 261 ecore_file_mkdir(build_chkdir);
251 bld = mrk_build_load("Marrakesh.mrk"); 262 bld = mrk_build_load("Marrakesh.mrk");
252 if (!bld) _mrk_err("Failed to load Marrakesh.mrk\n"); 263 if (!bld) _mrk_err("Failed to load Marrakesh.mrk\n");
253 if (!mrk_build_do(bld, build_tmpdir)) 264 if (!mrk_build_do(bld, build_tmpdir, build_objdir))
254 { 265 {
255 mrk_build_free(bld); 266 mrk_build_free(bld);
256 _mrk_err("Failed to build Marrakesh.mrk\n"); 267 _mrk_err("Failed to build Marrakesh.mrk\n");
diff --git a/mrklib.h b/mrklib.h
index 3d0e839..e167020 100644
--- a/mrklib.h
+++ b/mrklib.h
@@ -127,7 +127,7 @@ struct _Mrk_Build
127 127
128EAPI Mrk_Build *mrk_build_load(const char *file); 128EAPI Mrk_Build *mrk_build_load(const char *file);
129EAPI void mrk_build_free(Mrk_Build *bld); 129EAPI void mrk_build_free(Mrk_Build *bld);
130EAPI Eina_Bool mrk_build_do(Mrk_Build *bld, const char *tmpd); 130EAPI Eina_Bool mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd);
131EAPI Eina_Bool mrk_build_pakage_bin(Mrk_Build *bld, const char *file, const char *tmpd, const char *os, const char *arch); 131EAPI Eina_Bool mrk_build_pakage_bin(Mrk_Build *bld, const char *file, const char *tmpd, const char *os, const char *arch);
132EAPI Eina_Bool mrk_build_package_src(Mrk_Build *bld, const char *buildfile, const char *file); 132EAPI Eina_Bool mrk_build_package_src(Mrk_Build *bld, const char *buildfile, const char *file);
133 133
diff --git a/mrklib_buildfile.c b/mrklib_buildfile.c
index 892bf21..07d5675 100644
--- a/mrklib_buildfile.c
+++ b/mrklib_buildfile.c
@@ -419,25 +419,36 @@ mrk_build_free(Mrk_Build *bld)
419} 419}
420 420
421EAPI Eina_Bool 421EAPI Eina_Bool
422mrk_build_do(Mrk_Build *bld, const char *tmpd) 422mrk_build_do(Mrk_Build *bld, const char *tmpd, const char *objd)
423{ 423{
424 Eina_List *l, *ll; 424 Eina_List *l, *ll, *lll;
425 Mrk_Build_Bin *bin; 425 Mrk_Build_Bin *bin;
426 Mrk_Build_Data *data; 426 Mrk_Build_Data *data;
427 Eina_Strbuf *buf; 427 Eina_Strbuf *buf;
428 char *s, *extn, *s2; 428 char *s, *extn, *s2, *p;
429 char tmp[4096]; 429 char tmp[4096];
430 char tmp2[4096]; 430 char tmp2[4096];
431 const char *ss, *cc; 431 const char *ss, *cc;
432 int res;
432#define err(reason) do { fprintf(stderr, "%s\n", reason); goto error; } while (0) 433#define err(reason) do { fprintf(stderr, "%s\n", reason); goto error; } while (0)
433 434
435 if (!(buf = eina_strbuf_new())) goto error;
436 snprintf(tmp, sizeof(tmp), "%s", tmpd);
437 ecore_file_mkpath(tmp);
438 snprintf(tmp, sizeof(tmp), "%s", objd);
439 ecore_file_mkpath(tmp);
434 EINA_LIST_FOREACH(bld->po, l, s) 440 EINA_LIST_FOREACH(bld->po, l, s)
435 { 441 {
436 snprintf(tmp, sizeof(tmp), "%s/share/locale/%s/LC_MESSAGES/", tmpd, s); 442 snprintf(tmp, sizeof(tmp), "%s/share/locale/%s/LC_MESSAGES/", tmpd, s);
437 ecore_file_mkpath(tmp); 443 ecore_file_mkpath(tmp);
438 snprintf(tmp2, sizeof(tmp2), "po/%s.gmo", s); 444 snprintf(tmp2, sizeof(tmp2), "po/%s.gmo", s);
439 snprintf(tmp, sizeof(tmp), "%s/share/locale/%s/LC_MESSAGES/%s.mo", tmpd, s, bld->domain); 445 snprintf(tmp, sizeof(tmp), "%s/share/locale/%s/LC_MESSAGES/%s.mo", tmpd, s, bld->domain);
440 ecore_file_cp(tmp2, tmp); 446 if ((!ecore_file_exists(tmp)) ||
447 (ecore_file_mod_time(tmp2) >= ecore_file_mod_time(tmp)))
448 {
449 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, tmp2, 27, 27, 27, 27);
450 ecore_file_cp(tmp2, tmp);
451 }
441 } 452 }
442 EINA_LIST_FOREACH(bld->data, l, data) 453 EINA_LIST_FOREACH(bld->data, l, data)
443 { 454 {
@@ -449,7 +460,12 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd)
449 free(s); 460 free(s);
450 } 461 }
451 snprintf(tmp, sizeof(tmp), "%s/%s", tmpd, data->dest); 462 snprintf(tmp, sizeof(tmp), "%s/%s", tmpd, data->dest);
452 ecore_file_cp(data->src, tmp); 463 if ((!ecore_file_exists(tmp)) ||
464 (ecore_file_mod_time(data->src) >= ecore_file_mod_time(tmp)))
465 {
466 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, data->src, 27, 27, 27, 27);
467 ecore_file_cp(data->src, tmp);
468 }
453 } 469 }
454 snprintf(tmp, sizeof(tmp), "%s/%s", tmpd, "share/applications"); 470 snprintf(tmp, sizeof(tmp), "%s/%s", tmpd, "share/applications");
455 ecore_file_mkpath(tmp); 471 ecore_file_mkpath(tmp);
@@ -459,7 +475,12 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd)
459 if (!(!strncmp(ss, bld->domain, strlen(bld->domain)))) 475 if (!(!strncmp(ss, bld->domain, strlen(bld->domain))))
460 err("destkop file wrong domain"); 476 err("destkop file wrong domain");
461 snprintf(tmp, sizeof(tmp), "%s/share/applications/%s", tmpd, ss); 477 snprintf(tmp, sizeof(tmp), "%s/share/applications/%s", tmpd, ss);
462 ecore_file_cp(s, tmp); 478 if ((!ecore_file_exists(tmp)) ||
479 (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp)))
480 {
481 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, s, 27, 27, 27, 27);
482 ecore_file_cp(s, tmp);
483 }
463 } 484 }
464 snprintf(tmp, sizeof(tmp), "%s/%s", tmpd, "share/icons"); 485 snprintf(tmp, sizeof(tmp), "%s/%s", tmpd, "share/icons");
465 ecore_file_mkpath(tmp); 486 ecore_file_mkpath(tmp);
@@ -469,7 +490,12 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd)
469 if (!(!strncmp(ss, bld->domain, strlen(bld->domain)))) 490 if (!(!strncmp(ss, bld->domain, strlen(bld->domain))))
470 err("icon file wrong domain"); 491 err("icon file wrong domain");
471 snprintf(tmp, sizeof(tmp), "%s/share/icons/%s", tmpd, ss); 492 snprintf(tmp, sizeof(tmp), "%s/share/icons/%s", tmpd, ss);
472 ecore_file_cp(s, tmp); 493 if ((!ecore_file_exists(tmp)) ||
494 (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp)))
495 {
496 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, s, 27, 27, 27, 27);
497 ecore_file_cp(s, tmp);
498 }
473 } 499 }
474 EINA_LIST_FOREACH(bld->copying, l, s) 500 EINA_LIST_FOREACH(bld->copying, l, s)
475 { 501 {
@@ -483,11 +509,50 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd)
483 snprintf(tmp, sizeof(tmp), "%s/share/licenses", tmpd); 509 snprintf(tmp, sizeof(tmp), "%s/share/licenses", tmpd);
484 ecore_file_mkpath(tmp); 510 ecore_file_mkpath(tmp);
485 snprintf(tmp, sizeof(tmp), "%s/share/licenses/%s", tmpd, s); 511 snprintf(tmp, sizeof(tmp), "%s/share/licenses/%s", tmpd, s);
486 ecore_file_cp(s, tmp); 512 if ((!ecore_file_exists(tmp)) ||
513 (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp)))
514 {
515 printf("%c[36;01m%s%c[0m%c[35m -%c[1m>%c[0m\n", 27, s, 27, 27, 27, 27);
516 ecore_file_cp(s, tmp);
517 }
487 } 518 }
519
520 cc = getenv("CC");
521 if (!cc) cc = "gcc";
522
488 EINA_LIST_FOREACH(bld->bins, l, bin) 523 EINA_LIST_FOREACH(bld->bins, l, bin)
489 { 524 {
490 if ((buf = eina_strbuf_new())) 525 Eina_Bool rebuild, rebuild2, touchme;
526
527 printf("%c[37;01m%s%c[0m%c[32m =%c[1m>>%c[0m\n", 27, bin->bin, 27, 27, 27, 27);
528 snprintf(tmp, sizeof(tmp), "%s/%s", tmpd, bin->bin);
529 if (!ecore_file_exists(tmp)) rebuild = EINA_TRUE;
530 rebuild = EINA_FALSE;
531 if (!rebuild)
532 {
533 EINA_LIST_FOREACH(bin->srcs, ll, s)
534 {
535 snprintf(tmp, sizeof(tmp), "%s-%s", bin->bin, s);
536 for (p = tmp; *p; p++)
537 {
538 if (*p == '/') *p = '.';
539 }
540 extn = strrchr(tmp, '.');
541 if ((extn) && (!strcasecmp(extn, ".c"))) extn[1] = 'o';
542 snprintf(tmp2, sizeof(tmp2), "%s/%s", objd, tmp);
543 if (!ecore_file_exists(tmp2))
544 {
545 rebuild = EINA_TRUE;
546 break;
547 }
548 if (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp2))
549 {
550 rebuild = EINA_TRUE;
551 break;
552 }
553 }
554 }
555 if (rebuild)
491 { 556 {
492 s = ecore_file_dir_get(bin->bin); 557 s = ecore_file_dir_get(bin->bin);
493 if (s) 558 if (s)
@@ -496,60 +561,142 @@ mrk_build_do(Mrk_Build *bld, const char *tmpd)
496 ecore_file_mkpath(tmp); 561 ecore_file_mkpath(tmp);
497 free(s); 562 free(s);
498 } 563 }
499 cc = getenv("CC"); 564 EINA_LIST_FOREACH(bin->srcs, ll, s)
500 if (!cc) cc = "gcc"; 565 {
566 touchme = EINA_FALSE;
567 rebuild2 = EINA_FALSE;
568 snprintf(tmp, sizeof(tmp), "%s-%s", bin->bin, s);
569 for (p = tmp; *p; p++)
570 {
571 if (*p == '/') *p = '.';
572 }
573 extn = strrchr(tmp, '.');
574 if ((extn) && (!strcasecmp(extn, ".c"))) extn[1] = 'o';
575 else touchme = EINA_TRUE;
576 snprintf(tmp2, sizeof(tmp2), "%s/%s", objd, tmp);
577 if (!ecore_file_exists(tmp2))
578 {
579 rebuild2 = EINA_TRUE;
580 }
581 if (ecore_file_mod_time(s) >= ecore_file_mod_time(tmp2))
582 {
583 rebuild2 = EINA_TRUE;
584 }
585 if ((rebuild2) && (!touchme))
586 {
587 eina_strbuf_reset(buf);
588 eina_strbuf_append(buf, cc);
589 eina_strbuf_append(buf, " -c ");
590 eina_strbuf_append(buf, s);
591 eina_strbuf_append(buf, " -I. -o ");
592 eina_strbuf_append(buf, tmp2);
593
594 eina_strbuf_append(buf, " -DLOCALEDIR=\\\"/tmp/X/share/locale\\\"");
595 eina_strbuf_append(buf, " -DPACKAGE_BIN_DIR=\\\"/tmp/X/bin\\\"");
596 eina_strbuf_append(buf, " -DPACKAGE_LIB_DIR=\\\"/tmp/X/lib\\\"");
597 eina_strbuf_append(buf, " -DPACKAGE_DATA_DIR=\\\"/tmp/X/share/");
598 eina_strbuf_append(buf, bld->domain);
599 eina_strbuf_append(buf, "\\\"");
600
601 eina_strbuf_append(buf, " -DPACKAGE_NAME=\\\"");
602 eina_strbuf_append(buf, bld->domain);
603 eina_strbuf_append(buf, "\\\"");
604
605 eina_strbuf_append(buf, " -DPACKAGE_VERSION=\\\"");
606 eina_strbuf_append(buf, bld->version);
607 eina_strbuf_append(buf, "\\\"");
608
609 eina_strbuf_append(buf, " -D_REENTRANT -DHAVE_CONFIG_H -pthread ");
610 eina_strbuf_append(buf, " $CFLAGS ");
611 EINA_LIST_FOREACH(bin->deps, lll, s2)
612 {
613 eina_strbuf_append(buf, " `pkg-config --cflags ");
614 eina_strbuf_append(buf, s2);
615 eina_strbuf_append(buf, "`");
616 }
617 EINA_LIST_FOREACH(bin->incs, lll, s2)
618 {
619 eina_strbuf_append(buf, " -I");
620 eina_strbuf_append(buf, s2);
621 eina_strbuf_append(buf, " ");
622 }
623 s2 = (char *)eina_strbuf_string_get(buf);
624 if (s2)
625 {
626 printf(" %c[31mCC%c[33m %s%c[0m\n", 27, 27, s, 27);
627 if (getenv("V")) printf("%s\n", s2);
628 printf("%c[34m", 27);
629 fflush(stdout);
630 res = system(s2);
631 printf("%c[0m", 27);
632 if (res != 0)
633 {
634 printf("%c[31;1mERROR ERROR ERROR%c[0m\n", 27, 27);
635 goto error;
636 }
637 }
638 }
639 else if ((rebuild2) && (touchme))
640 {
641 FILE *f;
642
643 unlink(tmp2);
644 f = fopen(tmp2, "wb");
645 fclose(f);
646 }
647 }
648 eina_strbuf_reset(buf);
501 eina_strbuf_append(buf, cc); 649 eina_strbuf_append(buf, cc);
502 eina_strbuf_append(buf, " -I. -lm -o "); 650 eina_strbuf_append(buf, " -lm -o ");
503 eina_strbuf_append(buf, tmpd); 651 eina_strbuf_append(buf, tmpd);
504 eina_strbuf_append(buf, "/"); 652 eina_strbuf_append(buf, "/");
505 eina_strbuf_append(buf, bin->bin); 653 eina_strbuf_append(buf, bin->bin);
506 654
507 eina_strbuf_append(buf, " -DLOCALEDIR=\\\"/tmp/X/share/locale\\\"");
508 eina_strbuf_append(buf, " -DPACKAGE_BIN_DIR=\\\"/tmp/X/bin\\\"");
509 eina_strbuf_append(buf, " -DPACKAGE_LIB_DIR=\\\"/tmp/X/lib\\\"");
510 eina_strbuf_append(buf, " -DPACKAGE_DATA_DIR=\\\"/tmp/X/share/");
511 eina_strbuf_append(buf, bld->domain);
512 eina_strbuf_append(buf, "\\\"");
513
514 eina_strbuf_append(buf, " -DPACKAGE_NAME=\\\"");
515 eina_strbuf_append(buf, bld->domain);
516 eina_strbuf_append(buf, "\\\"");
517
518 eina_strbuf_append(buf, " -DPACKAGE_VERSION=\\\"");
519 eina_strbuf_append(buf, bld->version);
520 eina_strbuf_append(buf, "\\\"");
521
522 eina_strbuf_append(buf, " -D_REENTRANT -DHAVE_CONFIG_H -pthread ");
523 eina_strbuf_append(buf, " $CFLAGS "); 655 eina_strbuf_append(buf, " $CFLAGS ");
524 656 EINA_LIST_FOREACH(bin->deps, ll, s)
657 {
658 eina_strbuf_append(buf, " `pkg-config --libs ");
659 eina_strbuf_append(buf, s);
660 eina_strbuf_append(buf, "`");
661 }
525 EINA_LIST_FOREACH(bin->srcs, ll, s) 662 EINA_LIST_FOREACH(bin->srcs, ll, s)
526 { 663 {
527 extn = strrchr(s, '.'); 664 rebuild2 = EINA_FALSE;
665 snprintf(tmp, sizeof(tmp), "%s-%s", bin->bin, s);
666 for (p = tmp; *p; p++)
667 {
668 if (*p == '/') *p = '.';
669 }
670 extn = strrchr(tmp, '.');
528 if ((extn) && (!strcasecmp(extn, ".c"))) 671 if ((extn) && (!strcasecmp(extn, ".c")))
529 { 672 {
530 eina_strbuf_append(buf, s); 673 extn[1] = 'o';
674 snprintf(tmp2, sizeof(tmp2), "%s/%s", objd, tmp);
675 eina_strbuf_append(buf, tmp2);
531 eina_strbuf_append(buf, " "); 676 eina_strbuf_append(buf, " ");
532 } 677 }
533 } 678 }
534 EINA_LIST_FOREACH(bin->deps, ll, s) 679 s = (char *)eina_strbuf_string_get(buf);
535 { 680 if (s)
536 eina_strbuf_append(buf, " `pkg-config --cflags --libs ");
537 eina_strbuf_append(buf, s);
538 eina_strbuf_append(buf, "`");
539 }
540 EINA_LIST_FOREACH(bin->incs, ll, s)
541 { 681 {
542 eina_strbuf_append(buf, " -I"); 682 printf(" %c[1;31mLD%c[1;33m %s%c[0m\n", 27, 27, bin->bin, 27);
543 eina_strbuf_append(buf, s); 683 if (getenv("V")) printf("%s\n", s2);
544 eina_strbuf_append(buf, " "); 684 printf("%c[34m", 27);
685 fflush(stdout);
686 res = system(s);
687 printf("%c[0m", 27);
688 if (res != 0)
689 {
690 printf("%c[31;0mERROR ERROR ERROR%c[0m\n", 27, 27);
691 goto error;
692 }
545 } 693 }
546 s = (char *)eina_strbuf_string_get(buf);
547 if (s) system(s);
548 eina_strbuf_free(buf);
549 } 694 }
550 } 695 }
696 eina_strbuf_free(buf);
551 return EINA_TRUE; 697 return EINA_TRUE;
552error: 698error:
699 eina_strbuf_free(buf);
553 return EINA_FALSE; 700 return EINA_FALSE;
554#undef err 701#undef err
555} 702}