Print this page
make: translate using gettext, rather than the unmaintainable catgets

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/bin/doname.cc
          +++ new/usr/src/cmd/make/bin/doname.cc
↓ open down ↓ 25 lines elided ↑ open up ↑
  26   26  /*
  27   27   *      doname.c
  28   28   *
  29   29   *      Figure out which targets are out of date and rebuild them
  30   30   */
  31   31  
  32   32  /*
  33   33   * Included files
  34   34   */
  35   35  #include <alloca.h>             /* alloca() */
  36      -
  37      -
  38   36  #include <fcntl.h>
  39   37  #include <mk/defs.h>
  40   38  #include <mksh/i18n.h>          /* get_char_semantics_value() */
  41   39  #include <mksh/macro.h>         /* getvar(), expand_value() */
  42   40  #include <mksh/misc.h>          /* getmem() */
  43   41  #include <poll.h>
  44      -
  45      -
       42 +#include <libintl.h>
  46   43  #include <signal.h>
  47      -
  48      -#       include <stropts.h>
  49      -
       44 +#include <stropts.h>
  50   45  #include <sys/errno.h>
  51   46  #include <sys/stat.h>
  52   47  #include <sys/types.h>
  53   48  #include <sys/utsname.h>        /* uname() */
  54   49  #include <sys/wait.h>
  55   50  #include <unistd.h>             /* close() */
  56   51  
  57   52  /*
  58   53   * Defined macros
  59   54   */
↓ open down ↓ 76 lines elided ↑ open up ↑
 136  131  try_again:
 137  132          switch (doname(target, do_get, implicit, automatic)) {
 138  133          case build_ok:
 139  134                  second_pass = 0;
 140  135                  return build_ok;
 141  136          case build_running:
 142  137                  second_pass = 0;
 143  138                  return build_running;
 144  139          case build_failed:
 145  140                  if (!continue_after_error) {
 146      -                        fatal(catgets(catd, 1, 13, "Target `%s' not remade because of errors"),
      141 +                        fatal(gettext("Target `%s' not remade because of errors"),
 147  142                                target->string_mb);
 148  143                  }
 149  144                  build_failed_seen = true;
 150  145                  second_pass = 0;
 151  146                  return build_failed;
 152  147          case build_dont_know:
 153  148                  /*
 154  149                   * If we can't figure out how to build an automatic
 155  150                   * (hidden) dependency, we just ignore it.
 156  151                   * We later declare the target to be out of date just in
↓ open down ↓ 5 lines elided ↑ open up ↑
 162  157                          second_pass = 0;
 163  158                          return build_dont_know;
 164  159                  }
 165  160                  if(first_time) {
 166  161                          first_time = 0;
 167  162                          second_pass = 1;
 168  163                          goto try_again;
 169  164                  }
 170  165                  second_pass = 0;
 171  166                  if (continue_after_error && !svr4) {
 172      -                        warning(catgets(catd, 1, 14, "Don't know how to make target `%s'"),
      167 +                        warning(gettext("Don't know how to make target `%s'"),
 173  168                                  target->string_mb);
 174  169                          build_failed_seen = true;
 175  170                          return build_failed;
 176  171                  }
 177      -                fatal(catgets(catd, 1, 15, "Don't know how to make target `%s'"), target->string_mb);
      172 +                fatal(gettext("Don't know how to make target `%s'"), target->string_mb);
 178  173                  break;
 179  174          }
 180  175  #ifdef lint
 181  176          return build_failed;
 182  177  #endif
 183  178  }
 184  179  
 185  180  
 186  181  void
 187  182  enter_explicit_rule_from_dynamic_rule(Name target, Name source)
↓ open down ↓ 244 lines elided ↑ open up ↑
 432  427                  /* Copy them */
 433  428                  for (p = automatics, dependency = line->body.line.dependencies;
 434  429                       dependency != NULL;
 435  430                       dependency = dependency->next) {
 436  431                          if (dependency->automatic && !dependency->stale) {
 437  432                                  *p++ = dependency->name;
 438  433                          }
 439  434                  }
 440  435          }
 441  436          if (debug_level > 1) {
 442      -                (void) printf(NOCATGETS("%*sdoname(%s)\n"),
      437 +                (void) printf("%*sdoname(%s)\n",
 443  438                                recursion_level,
 444  439                                "",
 445  440                                target->string_mb);
 446  441          }
 447  442          recursion_level++;
 448  443          /* Avoid infinite loops */
 449  444          if (target->state == build_in_progress) {
 450      -                warning(catgets(catd, 1, 16, "Infinite loop: Target `%s' depends on itself"),
      445 +                warning(gettext("Infinite loop: Target `%s' depends on itself"),
 451  446                          target->string_mb);
 452  447                  return build_ok;
 453  448          }
 454  449          target->state = build_in_progress;
 455  450  
 456  451          /* Activate conditional macros for the target */
 457  452          if (!target->added_pattern_conditionals) {
 458  453                  add_pattern_conditionals(target);
 459  454                  target->added_pattern_conditionals = true;
 460  455          }
↓ open down ↓ 217 lines elided ↑ open up ↑
 678  673                          if (true_target->is_member) {
 679  674                                  out_of_date = (Boolean) OUT_OF_DATE_SEC(true_target->stat.time,
 680  675                                                                          line->body.line.dependency_time);
 681  676                          } else {
 682  677                                  out_of_date = (Boolean) OUT_OF_DATE(true_target->stat.time,
 683  678                                                                      line->body.line.dependency_time);
 684  679                          }
 685  680                          if (build_unconditional || out_of_date) {
 686  681                                  line->body.line.is_out_of_date = true;
 687  682                                  if (debug_level > 0) {
 688      -                                        (void) printf(catgets(catd, 1, 17, "%*sBuilding %s using .DEFAULT because it is out of date\n"),
      683 +                                        (void) printf(gettext("%*sBuilding %s using .DEFAULT because it is out of date\n"),
 689  684                                                        recursion_level,
 690  685                                                        "",
 691  686                                                        true_target->string_mb);
 692  687                                  }
 693  688                          }
 694  689                          line->body.line.sccs_command = false;
 695  690                          line->body.line.command_template = default_rule;
 696  691                          line->body.line.target = true_target;
 697  692                          line->body.line.star = NULL;
 698  693                          line->body.line.less = true_target;
↓ open down ↓ 173 lines elided ↑ open up ↑
 872  867                  }
 873  868          }
 874  869          /*
 875  870           * Check if we found any new auto dependencies when we
 876  871           * built the target.
 877  872           */
 878  873          if ((result == build_ok) && check_auto_dependencies(target,
 879  874                                                              auto_count,
 880  875                                                              automatics)) {
 881  876                  if (debug_level > 0) {
 882      -                        (void) printf(catgets(catd, 1, 18, "%*sTarget `%s' acquired new dependencies from build, rechecking all dependencies\n"),
      877 +                        (void) printf(gettext("%*sTarget `%s' acquired new dependencies from build, rechecking all dependencies\n"),
 883  878                                        recursion_level,
 884  879                                        "",
 885  880                                        true_target->string_mb);
 886  881                  }
 887  882                  rechecking_target = true;
 888  883                  saved_commands_done = commands_done;
 889  884                  goto recheck_target;
 890  885          }
 891  886  
 892  887          if (rechecking_target && !commands_done) {
↓ open down ↓ 132 lines elided ↑ open up ↑
1025 1020                                  }
1026 1021                                  /*
1027 1022                                   * Make sure the dependency is not saved
1028 1023                                   * in the state file.
1029 1024                                   */
1030 1025                                  dependency->stale = true;
1031 1026                                  rewrite_statefile =
1032 1027                                    command_changed =
1033 1028                                      true;
1034 1029                                  if (debug_level > 0) {
1035      -                                        (void) printf(catgets(catd, 1, 19, "Target %s rebuilt because dependency %s does not exist\n"),
     1030 +                                        (void) printf(gettext("Target %s rebuilt because dependency %s does not exist\n"),
1036 1031                                                       true_target->string_mb,
1037 1032                                                       dependency->name->string_mb);
1038 1033                                  }
1039 1034                                  break;
1040 1035                          }
1041 1036                          if (dependency->name->depends_on_conditional) {
1042 1037                                  target->depends_on_conditional = true;
1043 1038                          }
1044 1039                          if (dependency->name == force) {
1045 1040                                  target->stat.time =
↓ open down ↓ 9 lines elided ↑ open up ↑
1055 1050                          line->body.line.dependency_time =
1056 1051                            MAX(dependency->name->stat.time,
1057 1052                                line->body.line.dependency_time);
1058 1053  
1059 1054                          /* Correction: do not consider nanosecs for members */
1060 1055                          if(true_target->is_member || dependency->name->is_member) {
1061 1056                                  line->body.line.dependency_time.tv_nsec = 0;
1062 1057                          }
1063 1058  
1064 1059                          if (debug_level > 1) {
1065      -                                (void) printf(catgets(catd, 1, 20, "%*sDate(%s)=%s \n"),
     1060 +                                (void) printf(gettext("%*sDate(%s)=%s \n"),
1066 1061                                                recursion_level,
1067 1062                                                "",
1068 1063                                                dependency->name->string_mb,
1069 1064                                                time_to_string(dependency->name->
1070 1065                                                               stat.time));
1071 1066                                  if (dependency->name->stat.time > line->body.line.dependency_time) {
1072      -                                        (void) printf(catgets(catd, 1, 21, "%*sDate-dependencies(%s) set to %s\n"),
     1067 +                                        (void) printf(gettext("%*sDate-dependencies(%s) set to %s\n"),
1073 1068                                                        recursion_level,
1074 1069                                                        "",
1075 1070                                                        true_target->string_mb,
1076 1071                                                        time_to_string(line->body.line.
1077 1072                                                                       dependency_time));
1078 1073                                  }
1079 1074                          }
1080 1075  
1081 1076                          /* Build the $? list */
1082 1077                          if (true_target->is_member) {
↓ open down ↓ 38 lines elided ↑ open up ↑
1121 1116                                                     member_prop)->
1122 1117                                                       body.member.member;
1123 1118                                  } else {
1124 1119                                          (*out_of_date_tail)->name =
1125 1120                                            dependency->name;
1126 1121                                  }
1127 1122                                  (*out_of_date_tail)->next = NULL;
1128 1123                                  out_of_date_tail = &(*out_of_date_tail)->next;
1129 1124                                  if (debug_level > 0) {
1130 1125                                          if (dependency->name->stat.time == file_max_time) {
1131      -                                                (void) printf(catgets(catd, 1, 22, "%*sBuilding %s because %s does not exist\n"),
     1126 +                                                (void) printf(gettext("%*sBuilding %s because %s does not exist\n"),
1132 1127                                                                recursion_level,
1133 1128                                                                "",
1134 1129                                                                true_target->string_mb,
1135 1130                                                                dependency->name->string_mb);
1136 1131                                          } else {
1137      -                                                (void) printf(catgets(catd, 1, 23, "%*sBuilding %s because it is out of date relative to %s\n"),
     1132 +                                                (void) printf(gettext("%*sBuilding %s because it is out of date relative to %s\n"),
1138 1133                                                                recursion_level,
1139 1134                                                                "",
1140 1135                                                                true_target->string_mb,
1141 1136                                                                dependency->name->string_mb);
1142 1137                                          }
1143 1138                                  }
1144 1139                          }
1145 1140                          if (dependency->name == force) {
1146 1141                                  force->stat.time =
1147 1142                                    file_max_time;
↓ open down ↓ 49 lines elided ↑ open up ↑
1197 1192          }
1198 1193          if ((true_target->is_member) && (dependency_changed == true)) {
1199 1194                  true_target->stat.time = file_no_time;
1200 1195          }
1201 1196          /*
1202 1197           * After scanning all the dependencies, we check the rule
1203 1198           * if we found one.
1204 1199           */
1205 1200          if (line->body.line.command_template != NULL) {
1206 1201                  if (line->body.line.command_template_redefined) {
1207      -                        warning(catgets(catd, 1, 24, "Too many rules defined for target %s"),
     1202 +                        warning(gettext("Too many rules defined for target %s"),
1208 1203                                  target->string_mb);
1209 1204                  }
1210 1205                  *command = line;
1211 1206                  /* Check if the target is out of date */
1212 1207                  Boolean out_of_date;
1213 1208                  if (true_target->is_member) {
1214 1209                          out_of_date = (Boolean) OUT_OF_DATE_SEC(true_target->stat.time,
1215 1210                                                                  line->body.line.dependency_time);
1216 1211                  } else {
1217 1212                          out_of_date = (Boolean) OUT_OF_DATE(true_target->stat.time,
↓ open down ↓ 199 lines elided ↑ open up ↑
1417 1412                                          dependency = new_depe;
1418 1413                                  }
1419 1414                                  reuse_cell = false;
1420 1415                                  /* Internalize the dependency name */
1421 1416                                  // tolik. Fix for bug 4110429: inconsistent expansion for macros that
1422 1417                                  // include "//" and "/./"
1423 1418                                  //dependency->name = GETNAME(start, p - start);
1424 1419                                  dependency->name = normalize_name(start, p - start);
1425 1420                                  if ((debug_level > 0) &&
1426 1421                                      (first_member == NULL)) {
1427      -                                        (void) printf(catgets(catd, 1, 25, "%*sDynamic dependency `%s' for target `%s'\n"),
     1422 +                                        (void) printf(gettext("%*sDynamic dependency `%s' for target `%s'\n"),
1428 1423                                                        recursion_level,
1429 1424                                                        "",
1430 1425                                                        dependency->name->string_mb,
1431 1426                                                        true_target->string_mb);
1432 1427                                  }
1433 1428                                  for (start = p; iswspace(*start); start++);
1434 1429                                  p = start;
1435 1430                          }
1436 1431                  } while ((*p != (int) nul_char) &&
1437 1432                           (*p != (int) parenright_char));
↓ open down ↓ 14 lines elided ↑ open up ↑
1452 1447                                                FIND_LENGTH);
1453 1448                                  append_char((int) parenright_char, &string);
1454 1449                                  member = first_member->name;
1455 1450                                  /* Replace "foo" with "lib.a(foo)" */
1456 1451                                  first_member->name =
1457 1452                                    GETNAME(string.buffer.start, FIND_LENGTH);
1458 1453                                  if (string.free_after_use) {
1459 1454                                          retmem(string.buffer.start);
1460 1455                                  }
1461 1456                                  if (debug_level > 0) {
1462      -                                        (void) printf(catgets(catd, 1, 26, "%*sDynamic dependency `%s' for target `%s'\n"),
     1457 +                                        (void) printf(gettext("%*sDynamic dependency `%s' for target `%s'\n"),
1463 1458                                                        recursion_level,
1464 1459                                                        "",
1465 1460                                                        first_member->name->
1466 1461                                                        string_mb,
1467 1462                                                        true_target->string_mb);
1468 1463                                  }
1469 1464                                  first_member->name->is_member = lib->is_member;
1470 1465                                  /* Add member property to member */
1471 1466                                  prop = maybe_append_prop(first_member->name,
1472 1467                                                           member_prop);
↓ open down ↓ 136 lines elided ↑ open up ↑
1609 1604          /*
1610 1605           * If this is an sccs command, we have to do some extra checking
1611 1606           * and possibly complain. If the file can't be gotten because it's
1612 1607           * checked out, we complain and behave as if the command was
1613 1608           * executed eventhough we ignored the command.
1614 1609           */
1615 1610          if (!touch &&
1616 1611              line->body.line.sccs_command &&
1617 1612              (target->stat.time != file_doesnt_exist) &&
1618 1613              ((target->stat.mode & 0222) != 0)) {
1619      -                fatal(catgets(catd, 1, 27, "%s is writable so it cannot be sccs gotten"),
     1614 +                fatal(gettext("%s is writable so it cannot be sccs gotten"),
1620 1615                        target->string_mb);
1621 1616                  target->has_complained = remember_only = true;
1622 1617          }
1623 1618          /*
1624 1619           * If KEEP_STATE is on, we make sure we have the timestamp for
1625 1620           * .make.state. If .make.state changes during the command run,
1626 1621           * we reread .make.state after the command. We also setup the
1627 1622           * environment variable that asks utilities to report dependencies.
1628 1623           */
1629 1624          if (!touch &&
1630 1625              keep_state &&
1631 1626              !remember_only) {
1632 1627                  (void) exists(make_state);
1633 1628                  if((strlen(temp_file_directory) == 1) && 
1634 1629                          (temp_file_directory[0] == '/')) {
1635 1630                     tmp_file_path[0] = '\0';
1636 1631                  } else {
1637 1632                     strcpy(tmp_file_path, temp_file_directory);
1638 1633                  }
1639 1634                  sprintf(mbs_buffer,
1640      -                                NOCATGETS("%s/.make.dependency.%08x.%d.%d"),
     1635 +                                "%s/.make.dependency.%08x.%d.%d",
1641 1636                                  tmp_file_path,
1642 1637                                  hostid,
1643 1638                                  getpid(),
1644 1639                                  file_number++);
1645 1640                  MBSTOWCS(wcs_buffer, mbs_buffer);
1646 1641                  Boolean fnd;
1647 1642                  temp_file_name = getname_fn(wcs_buffer, FIND_LENGTH, false, &fnd);
1648 1643                  temp_file_name->stat.is_file = true;
1649 1644                  int len = 2*MAXPATHLEN + strlen(target->string_mb) + 2;
1650 1645                  wchar_t *to = string = ALLOC_WC(len);
↓ open down ↓ 169 lines elided ↑ open up ↑
1820 1815                                                         rule->ignore_error), */
1821 1816                                                 (Boolean) rule->always_exec,
1822 1817                                                 target);
1823 1818                                  check_state(temp_file_name);
1824 1819                          }
1825 1820                  } else {
1826 1821                          result = build_ok;
1827 1822                  }
1828 1823                  if (result == build_failed) {
1829 1824                          if (silent || rule->silent) {
1830      -                                (void) printf(catgets(catd, 1, 242, "The following command caused the error:\n%s\n"),
     1825 +                                (void) printf(gettext("The following command caused the error:\n%s\n"),
1831 1826                                                rule->command_line->string_mb);
1832 1827                          }
1833 1828                          if (!rule->ignore_error && !ignore_errors) {
1834 1829                                  if (!continue_after_error) {
1835      -                                        fatal(catgets(catd, 1, 244, "Command failed for target `%s'"),
     1830 +                                        fatal(gettext("Command failed for target `%s'"),
1836 1831                                                target->string_mb);
1837 1832                                  }
1838 1833                                  /*
1839 1834                                   * Make sure a failing command is not
1840 1835                                   * saved in .make.state.
1841 1836                                   */
1842 1837                                  line->body.line.command_used = NULL;
1843 1838                                  break;
1844 1839                          } else {
1845 1840                                  result = build_ok;
↓ open down ↓ 257 lines elided ↑ open up ↑
2103 2098          /* Internalize macro name. */
2104 2099          name = GETNAME(string, equal - string);
2105 2100          /* Skip over "+=" "=". */
2106 2101          while (!((*equal == (int) nul_char) ||
2107 2102                   (*equal == (int) equal_char) ||
2108 2103                   (*equal == (int) plus_char))) {
2109 2104                  equal++;
2110 2105          }
2111 2106          switch (*equal) {
2112 2107          case nul_char:
2113      -                fatal(catgets(catd, 1, 31, "= expected in rule `%s' for target `%s'"),
     2108 +                fatal(gettext("= expected in rule `%s' for target `%s'"),
2114 2109                        line->string_mb,
2115 2110                        target->string_mb);
2116 2111          case plus_char:
2117 2112                  append = true;
2118 2113                  equal++;
2119 2114                  break;
2120 2115          }
2121 2116          equal++;
2122 2117          /* Skip over whitespace in front of value. */
2123 2118          while (iswspace(*equal)) {
↓ open down ↓ 273 lines elided ↑ open up ↑
2397 2392                  }
2398 2393                  /* Compare it with the old one for command consistency */
2399 2394                  if (used->command_line != new_command_line) {
2400 2395                          Name vpath_translated = vpath_translation(new_command_line);
2401 2396                          if (keep_state &&
2402 2397                              !used->ignore_command_dependency && (vpath_translated != used->command_line)) {
2403 2398                                  if (debug_level > 0) {
2404 2399                                          if (used->command_line != NULL
2405 2400                                              && *used->command_line->string_mb !=
2406 2401                                              '\0') {
2407      -                                                (void) printf(catgets(catd, 1, 32, "%*sBuilding %s because new command \n\t%s\n%*sdifferent from old\n\t%s\n"),
     2402 +                                                (void) printf(gettext("%*sBuilding %s because new command \n\t%s\n%*sdifferent from old\n\t%s\n"),
2408 2403                                                                recursion_level,
2409 2404                                                                "",
2410 2405                                                                target->string_mb,
2411 2406                                                                vpath_translated->string_mb,
2412 2407                                                                recursion_level,
2413 2408                                                                "",
2414 2409                                                                used->
2415 2410                                                                command_line->
2416 2411                                                                string_mb);
2417 2412                                          } else {
2418      -                                                (void) printf(catgets(catd, 1, 33, "%*sBuilding %s because new command \n\t%s\n%*sdifferent from empty old command\n"),
     2413 +                                                (void) printf(gettext("%*sBuilding %s because new command \n\t%s\n%*sdifferent from empty old command\n"),
2419 2414                                                                recursion_level,
2420 2415                                                                "",
2421 2416                                                                target->string_mb,
2422 2417                                                                vpath_translated->string_mb,
2423 2418                                                                recursion_level,
2424 2419                                                                "");
2425 2420                                          }
2426 2421                                  }
2427 2422                                  command_changed = true;
2428 2423                                  line->body.line.is_out_of_date = true;
↓ open down ↓ 4 lines elided ↑ open up ↑
2433 2428                          retmem(command_line.buffer.start);
2434 2429                  }
2435 2430          }
2436 2431          /* Check if the old command is longer than the new for */
2437 2432          /* command consistency */
2438 2433          if (used != NULL) {
2439 2434                  *insert = NULL;
2440 2435                  if (keep_state &&
2441 2436                      !ignore_all_command_dependency) {
2442 2437                          if (debug_level > 0) {
2443      -                                (void) printf(catgets(catd, 1, 34, "%*sBuilding %s because new command shorter than old\n"),
     2438 +                                (void) printf(gettext("%*sBuilding %s because new command shorter than old\n"),
2444 2439                                                recursion_level,
2445 2440                                                "",
2446 2441                                                target->string_mb);
2447 2442                          }
2448 2443                          command_changed = true;
2449 2444                          line->body.line.is_out_of_date = true;
2450 2445                  }
2451 2446          }
2452 2447          /* Check if the new command is longer than the old command for */
2453 2448          /* command consistency */
2454 2449          if (new_command_longer &&
2455 2450              !ignore_all_command_dependency &&
2456 2451              keep_state) {
2457 2452                  if (debug_level > 0) {
2458      -                        (void) printf(catgets(catd, 1, 35, "%*sBuilding %s because new command longer than old\n"),
     2453 +                        (void) printf(gettext("%*sBuilding %s because new command longer than old\n"),
2459 2454                                        recursion_level,
2460 2455                                        "",
2461 2456                                        target->string_mb);
2462 2457                  }
2463 2458                  command_changed = true;
2464 2459                  line->body.line.is_out_of_date = true;
2465 2460          }
2466 2461          /* Unbind the magic macros */
2467 2462          (void) SETVAR(c_at, (Name) NULL, false);
2468 2463          (void) SETVAR(star, (Name) NULL, false);
↓ open down ↓ 45 lines elided ↑ open up ↑
2514 2509  
2515 2510          for (name = target, target_group = NULL; name != NULL;) {
2516 2511                  if (!name->is_member) {
2517 2512                          /*
2518 2513                           * Build a touch command that can be passed
2519 2514                           * to dosys(). If KEEP_STATE is on, "make -t"
2520 2515                           * will save the proper command, not the
2521 2516                           * "touch" in .make.state.
2522 2517                           */
2523 2518                          INIT_STRING_FROM_STACK(touch_string, buffer);
2524      -                        MBSTOWCS(wcs_buffer, NOCATGETS("touch "));
     2519 +                        MBSTOWCS(wcs_buffer, "touch ");
2525 2520                          append_string(wcs_buffer, &touch_string, FIND_LENGTH);
2526 2521                          touch_cmd = name;
2527 2522                          if (name->has_vpath_alias_prop) {
2528 2523                                  touch_cmd = get_prop(name->prop,
2529 2524                                                   vpath_alias_prop)->
2530 2525                                                     body.vpath_alias.alias;
2531 2526                          }
2532 2527                          APPEND_NAME(touch_cmd,
2533 2528                                        &touch_string,
2534 2529                                        FIND_LENGTH);
↓ open down ↓ 144 lines elided ↑ open up ↑
2679 2674          String_rec              string;
2680 2675          wchar_t                 name[MAXPATHLEN];
2681 2676          register wchar_t        *p;
2682 2677          timestruc_t             sccs_time;
2683 2678          register Property       line;
2684 2679          int                     sym_link_depth = 0;
2685 2680  
2686 2681          /* For sccs, we need to chase symlinks. */
2687 2682          while (target->stat.is_sym_link) {
2688 2683                  if (sym_link_depth++ > 90) {
2689      -                        fatal(catgets(catd, 1, 95, "Can't read symbolic link `%s': Number of symbolic links encountered during path name traversal exceeds 90."),
     2684 +                        fatal(gettext("Can't read symbolic link `%s': Number of symbolic links encountered during path name traversal exceeds 90."),
2690 2685                                target->string_mb);
2691 2686                  }
2692 2687                  /* Read the value of the link. */
2693 2688                  result = readlink_vroot(target->string_mb,
2694 2689                                          link,
2695 2690                                          sizeof(link),
2696 2691                                          NULL,
2697 2692                                          VROOT_DEFAULT);
2698 2693                  if (result == -1) {
2699      -                        fatal(catgets(catd, 1, 36, "Can't read symbolic link `%s': %s"),
     2694 +                        fatal(gettext("Can't read symbolic link `%s': %s"),
2700 2695                                target->string_mb, errmsg(errno));
2701 2696                  }
2702 2697                  link[result] = 0;
2703 2698                  /* Use the value to build the proper filename. */
2704 2699                  INIT_STRING_FROM_STACK(string, name);
2705 2700  
2706 2701                  Wstring wcb(target);
2707 2702                  if ((link[0] != slash_char) &&
2708 2703                      ((p = (wchar_t *) wsrchr(wcb.get_string(), slash_char)) != NULL)) {
2709 2704                          append_string(wcb.get_string(), &string, p - wcb.get_string() + 1);
↓ open down ↓ 51 lines elided ↑ open up ↑
2761 2756                   */
2762 2757                  line = maybe_append_prop(target, line_prop);
2763 2758                  *command = line;
2764 2759                  if (sccs_time > target->stat.time) {
2765 2760                          /*
2766 2761                           * And only if the plain file is out of date do we
2767 2762                           * request execution of the command.
2768 2763                           */
2769 2764                          line->body.line.is_out_of_date = true;
2770 2765                          if (debug_level > 0) {
2771      -                                (void) printf(catgets(catd, 1, 37, "%*sSccs getting %s because s. file is younger than source file\n"),
     2766 +                                (void) printf(gettext("%*sSccs getting %s because s. file is younger than source file\n"),
2772 2767                                                recursion_level,
2773 2768                                                "",
2774 2769                                                target->string_mb);
2775 2770                          }
2776 2771                  }
2777 2772                  line->body.line.sccs_command = true;
2778 2773                  line->body.line.command_template = sccs_get_rule;
2779 2774                  if(!svr4 && (!allrules_read || posix)) {
2780 2775                     if((target->prop) &&
2781 2776                        (target->prop->body.sccs.file) &&
↓ open down ↓ 41 lines elided ↑ open up ↑
2823 2818          wchar_t usr_include_sys_buf[MAXPATHLEN];
2824 2819  
2825 2820          register Name           directory = dot;
2826 2821          register wchar_t        *p = (wchar_t *) wsrchr(wcb,
2827 2822                                                          (int) slash_char);
2828 2823          register int            length = p - wcb;
2829 2824          static Name             usr_include;
2830 2825          static Name             usr_include_sys;
2831 2826  
2832 2827          if (usr_include == NULL) {
2833      -                MBSTOWCS(usr_include_buf, NOCATGETS("/usr/include"));
     2828 +                MBSTOWCS(usr_include_buf, "/usr/include");
2834 2829                  usr_include = GETNAME(usr_include_buf, FIND_LENGTH);
2835      -                MBSTOWCS(usr_include_sys_buf, NOCATGETS("/usr/include/sys"));
     2830 +                MBSTOWCS(usr_include_sys_buf, "/usr/include/sys");
2836 2831                  usr_include_sys = GETNAME(usr_include_sys_buf, FIND_LENGTH);
2837 2832          }
2838 2833  
2839 2834          /*
2840 2835           * If the filename contains a "/" we have to extract the path
2841 2836           * Else the path defaults to ".".
2842 2837           */
2843 2838          if (p != NULL) {
2844 2839                  /*
2845 2840                   * Check some popular directories first to possibly
↓ open down ↓ 112 lines elided ↑ open up ↑
2958 2953          /* Scan the list of conditional properties and apply each one */
2959 2954          for (conditional = get_prop(target->prop, conditional_prop), i = 0;
2960 2955               conditional != NULL;
2961 2956               conditional = get_prop(conditional->next, conditional_prop),
2962 2957               i++) {
2963 2958                  /* Save the old value */
2964 2959                  old_locals[i].body.macro =
2965 2960                    maybe_append_prop(conditional->body.conditional.name,
2966 2961                                      macro_prop)->body.macro;
2967 2962                  if (debug_level > 1) {
2968      -                        (void) printf(catgets(catd, 1, 38, "%*sActivating conditional value: "),
     2963 +                        (void) printf(gettext("%*sActivating conditional value: "),
2969 2964                                        recursion_level,
2970 2965                                        "");
2971 2966                  }
2972 2967                  /* Set the conditional value. Macros are expanded when the */
2973 2968                  /* macro is refd as usual */
2974 2969                  if ((conditional->body.conditional.name != virtual_root) ||
2975 2970                      (conditional->body.conditional.value != virtual_root)) {
2976 2971                          (void) SETVAR(conditional->body.conditional.name,
2977 2972                                        conditional->body.conditional.value,
2978 2973                                        (Boolean) conditional->body.conditional.append);
↓ open down ↓ 35 lines elided ↑ open up ↑
3014 3009  
3015 3010          /* Scan the list of conditional properties and restore the old value */
3016 3011          /* to each one Reverse the order relative to when we assigned macros */
3017 3012          this_conditional = get_prop(conditional->next, conditional_prop);
3018 3013          if (this_conditional != NULL) {
3019 3014                  reset_locals(target, old_locals, this_conditional, index+1);
3020 3015          } else {
3021 3016                  /* Remove conditional target from chain */
3022 3017                  if (conditional_targets == NULL ||
3023 3018                      conditional_targets->name != target) {
3024      -                        warning(catgets(catd, 1, 39, "Internal error: reset target not at head of condtional_targets chain"));
     3019 +                        warning(gettext("Internal error: reset target not at head of condtional_targets chain"));
3025 3020                  } else {
3026 3021                          cond_chain = conditional_targets->next;
3027 3022                          retmem_mb((caddr_t) conditional_targets);
3028 3023                          conditional_targets = cond_chain;
3029 3024                  }
3030 3025          }
3031 3026          get_prop(conditional->body.conditional.name->prop,
3032 3027                   macro_prop)->body.macro = old_locals[index].body.macro;
3033 3028          if (conditional->body.conditional.name == virtual_root) {
3034 3029                  (void) SETVAR(virtual_root, getvar(virtual_root), false);
3035 3030          }
3036 3031          if (debug_level > 1) {
3037 3032                  if (old_locals[index].body.macro.value != NULL) {
3038      -                        (void) printf(catgets(catd, 1, 40, "%*sdeactivating conditional value: %s= %s\n"),
     3033 +                        (void) printf(gettext("%*sdeactivating conditional value: %s= %s\n"),
3039 3034                                        recursion_level,
3040 3035                                        "",
3041 3036                                        conditional->body.conditional.name->
3042 3037                                        string_mb,
3043 3038                                        old_locals[index].body.macro.value->
3044 3039                                        string_mb);
3045 3040                  } else {
3046      -                        (void) printf(catgets(catd, 1, 41, "%*sdeactivating conditional value: %s =\n"),
     3041 +                        (void) printf(gettext("%*sdeactivating conditional value: %s =\n"),
3047 3042                                        recursion_level,
3048 3043                                        "",
3049 3044                                        conditional->body.conditional.name->
3050 3045                                        string_mb);
3051 3046                  }
3052 3047          }
3053 3048  }
3054 3049  
3055 3050  /*
3056 3051   *      check_auto_dependencies(target, auto_count, automatics)
↓ open down ↓ 152 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX