1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994
|
/*
* cook - file construction tool
* Copyright (C) 1997, 1998 Peter Miller;
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
* MANIFEST: functions to walk a single graph recipe node
*/
#include <ac/unistd.h> /* for getpid */
#include <cook.h>
#include <dir_part.h>
#include <error_intl.h>
#include <graph.h>
#include <graph/file.h>
#include <graph/file_list.h>
#include <graph/file_pair.h>
#include <graph/recipe.h>
#include <graph/run.h>
#include <id.h>
#include <id/variable.h>
#include <match.h>
#include <opcode/context.h>
#include <opcode/list.h>
#include <option.h>
#include <os.h>
#include <recipe.h>
#include <stmt.h>
#include <str_list.h>
#include <trace.h>
/*
* NAME
* run_it
*
* SYNOPSIS
* opcode_status_ty run_it(opcode_list_ty *);
*
* DESCRIPTION
* The run_it function is used to execute a pre-compiled opcode
* stream. Use to run recipe bodies.
*
* RETURNS
* opcode_status_ty - indicating success or failure
*/
static opcode_status_ty run_it _((graph_ty *gp, opcode_list_ty *,
const match_ty *));
static opcode_status_ty
run_it(gp, olp, mp)
graph_ty *gp;
opcode_list_ty *olp;
const match_ty *mp;
{
opcode_context_ty *ocp;
opcode_status_ty status;
ocp = opcode_context_new(olp, mp);
ocp->gp = gp;
status = opcode_context_execute_nowait(ocp);
opcode_context_delete(ocp);
return status;
}
static int make_target_directories _((graph_file_list_nrc_ty *));
static int
make_target_directories(gflp)
graph_file_list_nrc_ty *gflp;
{
size_t k;
int status;
int echo;
int errok;
status = 0;
echo = !option_test(OPTION_SILENT);
errok = option_test(OPTION_ERROK);
for (k = 0; k < gflp->nfiles; ++k)
{
graph_file_ty *gfp;
string_ty *s;
gfp = gflp->file[k];
s = dir_part(gfp->filename);
if (s)
{
if (os_mkdir(s, echo) && !errok)
status = -1;
str_free(s);
}
}
return status;
}
static string_ty *host_binding_round_robin _((string_list_ty *));
static string_ty *
host_binding_round_robin(slp)
string_list_ty *slp;
{
static int j;
if (!j)
j = getpid();
if (!slp || !slp->nstrings)
{
static string_ty *key;
id_ty *idp;
if (!key)
key = str_from_c("parallel_hosts");
idp = id_search(key);
if (!idp)
return 0;
slp = id_variable_query2(idp);
if (!slp || !slp->nstrings)
return 0;
}
return slp->string[j++ % slp->nstrings];
}
/*
* NAME
* graph_recipe_run
*
* SYNOPSIS
* graph_walk_status_ty graph_recipe_run(graph_recipe_ty *);
*
* DESCRIPTION
* The graph_recipe_run function is used via graph_walk_inner to
* perform a recipe. If the derived files are out-of-date, the
* recipe body will be run to bring them up-to-date.
*
* RETURNS
* graph_walk_status_ty
* error something went wrong
* uptodate no action required
* uptodate_done fingerprints indicate the file did not change
* done targets are out of date, because the
* recipe body was run
*/
graph_walk_status_ty
graph_recipe_run(grp, gp)
graph_recipe_ty *grp;
graph_ty *gp;
{
graph_walk_status_ty status;
time_t target_age;
long target_depth;
string_ty *target_absent;
int forced;
string_list_ty wl;
string_list_ty younger;
int show_reasoning;
string_ty *target1;
time_t need_age;
size_t j, k;
int phony;
sub_context_ty *scp;
trace(("graph_recipe_run(grp = %08lX)\n{\n"/*}*/, (long)grp));
status = graph_walk_status_uptodate;
if (grp->ocp)
{
need_age = grp->ocp->need_age;
opcode_context_resume(grp->ocp);
status = graph_walk_status_done;
goto resume;
}
need_age = 0;
phony = !grp->rp->out_of_date;
/*
* Warn about essential information which is kept only in
* derived files.
*/
if (gp->file_pair)
{
for (j = 0; j < grp->output->nfiles; ++j)
{
target1 = grp->output->file[j]->filename;
for (k = 0; k < grp->input->nfiles; ++k)
{
graph_file_pair_check
(
gp->file_pair,
target1,
grp->input->file[k]->filename,
gp
);
}
}
}
/*
* construct the ``target'' variable
*/
string_list_constructor(&wl);
assert(grp->output);
assert(grp->output->nfiles > 0);
if (grp->output->nfiles > 0)
{
target1 = grp->output->file[0]->filename;
string_list_append(&wl, target1);
}
else
target1 = str_from_c("\7bogus\7"); /* mem leak */
id_assign_push(id_target, id_variable_new(&wl));
string_list_destructor(&wl);
/*
* construct the ``targets'' variable
*/
string_list_constructor(&wl);
assert(grp->input);
for (j = 0; j < grp->output->nfiles; ++j)
string_list_append(&wl, grp->output->file[j]->filename);
id_assign_push(id_targets, id_variable_new(&wl));
string_list_destructor(&wl);
/*
* construct the ``need'' variable
*/
string_list_constructor(&wl);
assert(grp->input);
for (j = 0; j < grp->input->nfiles; ++j)
string_list_append(&wl, grp->input->file[j]->filename);
id_assign_push(id_need, id_variable_new(&wl));
string_list_destructor(&wl);
/*
* Constructing the ``younger'' variable takes quite a bit
* longer because we need to consult the file modification
* times. [[Fake an assignment to avoid problems with errors.]]
*/
string_list_constructor(&younger);
id_assign_push(id_younger, id_variable_new(&younger));
/*
* Flags apply to the precondition and to the ingredients
* evaluation. That is why the grammar puts them first.
*/
recipe_flags_set(grp->rp);
show_reasoning = option_test(OPTION_REASON);
/*
* see of the recipe is forced to activate
*/
forced = option_test(OPTION_FORCE);
if (forced && show_reasoning)
{
scp = sub_context_new();
sub_var_set(scp, "File_Name", "%S", target1);
error_with_position
(
&grp->rp->pos,
scp,
i18n("\"$filename\" is out of date because the \"forced\" flag is set (reason)")
);
sub_context_delete(scp);
}
/*
* age should be set to the worst case of all the targets
*
* The depth of the target search should be less than or equal
* to the depth of the worst (shallowest) ingredients search.
* This is to guarantee that when ingredients change they
* result in targets shallower in the path being updated.
*/
target_age = 0;
target_absent = 0;
target_depth = 32767;
for (j = 0; j < grp->output->nfiles; ++j)
{
graph_file_ty *gfp2;
time_t age2;
long depth2;
gfp2 = grp->output->file[j];
/*
* Remember the oldest mtime for later, when we compare
* them to see if it changed. Only do this for
* fingerprints - they will stay the same even when the
* file is re-written.
*/
if (option_test(OPTION_FINGERPRINT))
{
depth2 = 32767;
age2 = cook_mtime_oldest(gfp2->filename, &depth2, depth2);
if (age2 < 0)
{
/* error message already printed */
status = graph_walk_status_error;
goto ret;
}
gfp2->mtime_oldest = age2;
}
depth2 = 32767;
age2 = cook_mtime_newest(gfp2->filename, &depth2, depth2);
if (age2 < 0)
{
/* error message already printed */
status = graph_walk_status_error;
goto ret;
}
if (age2 == 0)
target_absent = gfp2->filename;
else
{
if (depth2 < target_depth)
target_depth = depth2;
if (!target_age || age2 < target_age)
target_age = age2;
}
}
if (!forced && target_absent && !phony)
{
if (show_reasoning)
{
scp = sub_context_new();
sub_var_set(scp, "File_Name", "%S", target_absent);
error_with_position
(
&grp->rp->pos,
scp,
i18n("\"$filename\" is out of date because it does not exist (reason)")
);
sub_context_delete(scp);
}
forced = 1;
}
if (!forced && target_depth > 0 && option_test(OPTION_SHALLOW))
{
if (show_reasoning)
{
scp = sub_context_new();
sub_var_set(scp, "File_Name", "%S", target1);
error_with_position
(
&grp->rp->pos,
scp,
i18n("\"$filename\" is out of date because it is too deep (reason)")
);
sub_context_delete(scp);
}
forced = 1;
}
if (forced)
{
/* make sure ``younger'' contains all ingredients */
target_age = 0;
target_depth = 0;
}
trace(("forced = %d;\n", forced));
trace(("target_depth = %d;\n", target_depth));
trace(("target_age = %ld;\n", (long)target_age));
/*
* Look at the mtimes for each of the ingredients.
*/
need_age = 0;
for (j = 0; j < grp->input->nfiles; ++j)
{
graph_file_ty *gfp2;
time_t age2;
long depth2;
gfp2 = grp->input->file[j];
depth2 = 32767;
age2 = cook_mtime_oldest(gfp2->filename, &depth2, target_depth+1);
if (age2 < 0)
{
/* error message already printed */
status = graph_walk_status_error;
goto ret;
}
/*
* track the youngest ingredient,
* in case we need to adjust the targets' times
*/
if (age2 > need_age)
need_age = age2;
/*
* This function is only called AFTER an ingredient has
* been derived. It will exist (well, almost: it could
* be a phony) and so the mtime in the stat cache will
* have been set.
*
assert(age2 != 0);
*/
/*
* Check to see if this ingredient invalidates the
* target, based on its age. (Don't say anything if we
* already know it's out of date.)
*/
if (gfp2->done)
{
if (!forced)
{
if (show_reasoning)
{
scp = sub_context_new();
sub_var_set
(
scp,
"File_Name1",
"%S",
target1
);
sub_var_set
(
scp,
"File_Name2",
"%S",
gfp2->filename
);
error_with_position
(
&grp->rp->pos,
scp,
i18n("$filename1 is out of date because $filename2 was cooked and is \
now younger (reason)")
);
sub_context_delete(scp);
}
forced = 1;
}
string_list_append_unique(&younger, gfp2->filename);
}
/*
* Check to see if this ingredient invalidates the
* target, based on its age. (Don't say anything if we
* already know it's out of date.)
*/
if (age2 >= target_age && !phony)
{
if (!forced)
{
if (show_reasoning)
{
scp = sub_context_new();
sub_var_set
(
scp,
"File_Name1",
"%S",
target1
);
sub_var_set
(
scp,
"File_Name2",
"%S",
gfp2->filename
);
error_with_position
(
&grp->rp->pos,
scp,
i18n("$filename1 is out of date because $filename2 is younger (reason)")
);
sub_context_delete(scp);
}
forced = 1;
}
string_list_append_unique(&younger, gfp2->filename);
}
/*
* Check to see if this ingredient invalidates the
* target, based on its depth. (Don't say anything if we
* already know its out of date.)
*/
if (depth2 < target_depth && !phony)
{
trace(("depth2 = %d;\n", depth2));
if (!forced)
{
if (show_reasoning)
{
scp = sub_context_new();
sub_var_set
(
scp,
"File_Name1",
"%S",
target1
);
sub_var_set
(
scp,
"File_Name2",
"%S",
gfp2->filename
);
error_with_position
(
&grp->rp->pos,
scp,
i18n("$filename1 is out of date because $filename2 is shallower (reason)")
);
sub_context_delete(scp);
}
forced = 1;
}
string_list_append_unique(&younger, gfp2->filename);
}
}
if (grp->input->nfiles == 0)
{
/*
* If there are no input files, pretend that the
* youngest ingredient is ``now'' if the file does not
* exist, and a second older than the target if it does
* exist.
*/
if (forced)
time(&need_age);
else
need_age = target_age - 1;
}
/*
* Assign the ``younger'' variable.
* (Use a normal assignment, we did the push already.)
*/
id_assign(id_younger, id_variable_new(&younger));
string_list_destructor(&younger);
/*
* See if we need to perform the actions attached to this recipe.
*/
if (forced)
{
/*
* Remember that we did something.
*/
status = graph_walk_status_done;
if (grp->rp->out_of_date)
{
/*
* Make directories for the targets if asked to.
*/
trace(("do recipe body\n"));
if
(
option_test(OPTION_MKDIR)
&&
make_target_directories(grp->output) < 0
)
{
status = graph_walk_status_error;
goto ret;
}
/*
* Unlink the targets if asked to.
*/
if (option_test(OPTION_UNLINK))
{
for (k = 0; k < grp->output->nfiles; ++k)
{
graph_file_ty *gfp2;
gfp2 = grp->output->file[k];
if
(
os_delete
(
gfp2->filename,
!option_test(OPTION_SILENT)
)
&&
!option_test(OPTION_ERROK)
)
{
status =
graph_walk_status_error;
goto ret;
}
}
}
if (option_test(OPTION_TOUCH))
{
/*
* Touch the targets, if asked to touch
* rather than to build.
*/
for (k = 0; k < grp->output->nfiles; ++k)
{
graph_file_ty *gfp2;
gfp2 = grp->output->file[k];
if (!option_test(OPTION_SILENT))
{
scp = sub_context_new();
sub_var_set
(
scp,
"File_Name",
"%S",
gfp2->filename
);
error_intl
(
scp,
i18n("touch $filename")
);
sub_context_delete(scp);
}
if (os_touch(gfp2->filename))
status =
graph_walk_status_error;
}
}
else
{
opcode_status_ty result;
string_ty *hostname;
/*
* run the recipe body
*/
trace(("doing it now\n"));
grp->ocp =
opcode_context_new
(
grp->rp->out_of_date,
grp->mp
);
grp->ocp->gp = gp;
hostname =
host_binding_round_robin
(
grp->host_binding
);
if (hostname)
{
opcode_context_host_binding_set
(
grp->ocp,
hostname
);
}
resume:
result = opcode_context_execute(grp->ocp);
switch (result)
{
case opcode_status_wait:
grp->ocp->need_age = need_age;
opcode_context_suspend(grp->ocp);
trace(("wait...\n"));
trace((/*{*/"}\n"));
return graph_walk_status_wait;
case opcode_status_success:
status = graph_walk_status_done;
break;
case opcode_status_error:
if (option_test(OPTION_ERROK))
status = graph_walk_status_done;
else
status =
graph_walk_status_error;
break;
case opcode_status_interrupted:
status = graph_walk_status_error;
break;
}
opcode_context_delete(grp->ocp);
grp->ocp = 0;
/*
* Remove recipe targets on errors,
* unless asked to keep them around.
* This ensures they will be built
* again; hopefully without errors the
* next time. (Perfect cookbooks with
* exact dependencies don't need this,
* but users often omit dependencies;
* removing the file forces a re-build.)
*/
if
(
status == graph_walk_status_error
&&
!option_test(OPTION_PRECIOUS)
)
{
for
(
k = 0;
k < grp->output->nfiles;
++k
)
{
graph_file_ty *gfp2;
gfp2 = grp->output->file[k];
os_delete
(
gfp2->filename,
!option_test(OPTION_SILENT)
);
}
}
}
}
else
{
if (show_reasoning)
{
scp = sub_context_new();
sub_var_set(scp, "File_Name", "%S", target1);
error_intl(scp, i18n("$filename is phony (reason)"));
sub_context_delete(scp);
}
/*
* remember that this ``file'' has been ``changed''
*/
for (j = 0; j < grp->output->nfiles; ++j)
{
graph_file_ty *gfp;
gfp = grp->output->file[j];
gfp->done++;
}
}
}
else
{
if (show_reasoning)
{
scp = sub_context_new();
sub_var_set(scp, "File_Name", "%S", target1);
error_intl
(
scp,
i18n("$filename is up to date (reason)")
);
sub_context_delete(scp);
}
if (grp->rp->up_to_date)
{
opcode_status_ty result;
/*
* Make directories for the targets if asked to.
* Often redundant, but it wont hurt.
*/
if
(
option_test(OPTION_MKDIR)
&&
make_target_directories(grp->output) < 0
)
{
status = graph_walk_status_error;
goto ret;
}
/*
* This feature isn't used often, don't worry
* about making it parallel.
*/
trace(("perform ``use'' clause\n"));
result = run_it(gp, grp->rp->up_to_date, grp->mp);
if (result != opcode_status_success)
status = graph_walk_status_error;
}
}
/*
* Delete the variables unique to recipe body execution.
*/
ret:
id_unassign(id_target);
id_unassign(id_targets);
id_unassign(id_need);
id_unassign(id_younger);
/*
* adjust file modification times
* (tracking fingerprints as we go)
*/
if (status == graph_walk_status_done && grp->rp->out_of_date)
{
time_t mtime;
/*
* The output files need to be at least this date
* stamp to be mtime-consistent with the inputs.
*/
mtime = need_age + 1;
if (option_test(OPTION_FINGERPRINT))
{
/*
* Update the times, and see if the pringerprint
* changed. If the fingerprint did not change
* on any target, use the uptodate_done result,
* otherwise use the done result.
*/
status = graph_walk_status_uptodate_done;
for (j = 0; j < grp->output->nfiles; ++j)
{
graph_file_ty *gfp;
time_t t;
long depth4;
gfp = grp->output->file[j];
os_clear_stat(gfp->filename);
if (os_mtime_adjust(gfp->filename, mtime))
{
status = graph_walk_status_error;
/*
* don't break here, need to
* update all of them
*/
continue;
}
depth4 = 32767;
t = cook_mtime_oldest(gfp->filename, &depth4, depth4);
if (t < 0)
{
status = graph_walk_status_error;
/*
* don't break here, need to
* update all of them
*/
continue;
}
if (t == gfp->mtime_oldest)
{
if (!option_test(OPTION_SILENT))
{
scp = sub_context_new();
sub_var_set
(
scp,
"File_Name",
"%S",
gfp->filename
);
error_intl
(
scp,
i18n("$filename fingerprint unchanged")
);
}
}
else if (status != graph_walk_status_error)
{
status = graph_walk_status_done;
gfp->done++;
}
}
}
else
{
/*
* update the times if it worked
* and if it was not a phony recipe
*/
for (j = 0; j < grp->output->nfiles; ++j)
{
graph_file_ty *gfp;
gfp = grp->output->file[j];
gfp->done++; /* for out-of-date calcs */
if (os_mtime_adjust(gfp->filename, mtime))
{
/* error message already printed */
status = graph_walk_status_error;
/*
* don't break here, need to
* update all of them
*/
}
}
}
}
/*
* Make sure the target times are consistent with the
* ingredients times, when there was nothing to do. This is
* usually only necessary when finger prints are in use, but can
* sometimes be necessary when file server times are out of
* sync. This guarantees that a later fingerprint-less run will
* not find huge amounts of work to do.
*/
if
(
(
status == graph_walk_status_uptodate
||
status == graph_walk_status_uptodate_done
)
&&
grp->rp->out_of_date
&&
(
option_test(OPTION_UPDATE)
||
option_test(OPTION_FINGERPRINT)
)
)
{
time_t need_age_youngest;
/*
* find the youngest ingredient's age
* (will be in the stat cache or the fingerprint cache)
*/
need_age_youngest = 0;
for (j = 0; j < grp->input->nfiles; ++j)
{
graph_file_ty *gfp2;
time_t age2;
long depth2;
gfp2 = grp->input->file[j];
depth2 = 32767;
age2 = cook_mtime_newest(gfp2->filename, &depth2, depth2);
if (age2 > need_age_youngest)
need_age_youngest = age2;
}
/*
* Advance one second younger. This is the youngest a
* target may be to be mtime-consistent with the
* ingredients.
*/
need_age_youngest++;
/*
* check each of the targets for consistency
*/
for (j = 0; j < grp->output->nfiles; ++j)
{
graph_file_ty *gfp;
time_t age3;
long depth3;
gfp = grp->output->file[j];
depth3 = 32767;
age3 = cook_mtime_newest(gfp->filename, &depth3, depth3);
if (age3 > 0 && depth3 == 0 && age3 < need_age_youngest)
os_mtime_adjust(gfp->filename, need_age_youngest);
}
}
/*
* cancel the recipe flags
*/
option_undo_level(OPTION_LEVEL_RECIPE);
trace(("return %s;\n", graph_walk_status_name(status)));
trace((/*{*/"}\n"));
return status;
}
|