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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/bin/files.cc
          +++ new/usr/src/cmd/make/bin/files.cc
↓ open down ↓ 34 lines elided ↑ open up ↑
  35   35  
  36   36  /*
  37   37   * Included files
  38   38   */
  39   39  #include <dirent.h>             /* opendir() */
  40   40  #include <errno.h>              /* errno */
  41   41  #include <mk/defs.h>
  42   42  #include <mksh/macro.h>         /* getvar() */
  43   43  #include <mksh/misc.h>          /* get_prop(), append_prop() */
  44   44  #include <sys/stat.h>           /* lstat() */
       45 +#include <libintl.h>
  45   46  
  46   47  /*
  47   48   * Defined macros
  48   49   */
  49   50  
  50   51  /*
  51   52   * typedefs & structs
  52   53   */
  53   54  
  54   55  /*
↓ open down ↓ 40 lines elided ↑ open up ↑
  95   96          /*
  96   97           * If the target is a member, we have to extract the time
  97   98           * from the archive.
  98   99           */
  99  100          if (target->is_member &&
 100  101              (get_prop(target->prop, member_prop) != NULL)) {
 101  102                  return read_archive(target);
 102  103          }
 103  104  
 104  105          if (debug_level > 1) {
 105      -                (void) printf(NOCATGETS("%*sstat(%s)\n"),
      106 +                (void) printf("%*sstat(%s)\n",
 106  107                                recursion_level,
 107  108                                "",
 108  109                                target->string_mb);
 109  110          }
 110  111  
 111  112          result = lstat_vroot(target->string_mb, &buf, NULL, VROOT_DEFAULT);
 112  113          if ((result != -1) && ((buf.st_mode & S_IFMT) == S_IFLNK)) {
 113  114                  /*
 114  115                   * If the file is a symbolic link, we remember that
 115  116                   * and then we get the status for the refd file.
↓ open down ↓ 237 lines elided ↑ open up ↑
 353  354                  MBSTOWCS(tmp_wcs_buffer, dp->d_name);
 354  355                  (void) wscpy(file_name_p, tmp_wcs_buffer);
 355  356                  file = enter_file_name(file_name, library);
 356  357                  if ((pattern != NULL) && amatch(tmp_wcs_buffer, pattern)) {
 357  358                          /*
 358  359                           * If we are expanding a wildcard pattern, we
 359  360                           * enter the file as a dependency for the target.
 360  361                           */
 361  362                          if (debug_level > 0){
 362  363                                  WCSTOMBS(mbs_buffer, pattern);
 363      -                                (void) printf(catgets(catd, 1, 231, "'%s: %s' due to %s expansion\n"),
      364 +                                (void) printf(gettext("'%s: %s' due to %s expansion\n"),
 364  365                                                line->body.line.target->string_mb,
 365  366                                                file->string_mb,
 366  367                                                mbs_buffer);
 367  368                          }
 368  369                          enter_dependency(line, file, false);
 369  370                          result++;
 370  371                  } else {
 371  372                          /*
 372  373                           * If the file has an SCCS/s. file,
 373  374                           * we will detect that later on.
↓ open down ↓ 16 lines elided ↑ open up ↑
 390  391                           * Enter the s. file as a dependency for the
 391  392                           * plain file.
 392  393                           */
 393  394                          maybe_append_prop(plain_file, sccs_prop)->
 394  395                            body.sccs.file = file;
 395  396                          MBSTOWCS(tmp_wcs_buffer, dp->d_name + 2);
 396  397                          if ((pattern != NULL) &&
 397  398                              amatch(tmp_wcs_buffer, pattern)) {
 398  399                                  if (debug_level > 0) {
 399  400                                          WCSTOMBS(mbs_buffer, pattern);
 400      -                                        (void) printf(catgets(catd, 1, 232, "'%s: %s' due to %s expansion\n"),
      401 +                                        (void) printf(gettext("'%s: %s' due to %s expansion\n"),
 401  402                                                        line->body.line.target->
 402  403                                                        string_mb,
 403  404                                                        plain_file->string_mb,
 404  405                                                        mbs_buffer);
 405  406                                  }
 406  407                                  enter_dependency(line, plain_file, false);
 407  408                                  result++;
 408  409                          }
 409  410                  }
 410  411                }
↓ open down ↓ 34 lines elided ↑ open up ↑
 445  446  
 446  447            if (sccs_dir_path != NULL) {
 447  448                  wchar_t         tmp_wchar;
 448  449                  wchar_t         path[MAXPATHLEN];
 449  450                  char            mb_path[MAXPATHLEN];
 450  451  
 451  452                  if (file_name_p - file_name > 0) {
 452  453                          tmp_wchar = *file_name_p;
 453  454                          *file_name_p = 0;
 454  455                          WCSTOMBS(mbs_buffer, file_name);
 455      -                        (void) sprintf(mb_path, NOCATGETS("%s/%s/SCCS"),
      456 +                        (void) sprintf(mb_path, "%s/%s/SCCS",
 456  457                                          sccs_dir_path,
 457  458                                          mbs_buffer);
 458  459                          *file_name_p = tmp_wchar;
 459  460                  } else {
 460      -                        (void) sprintf(mb_path, NOCATGETS("%s/SCCS"), sccs_dir_path);
      461 +                        (void) sprintf(mb_path, "%s/SCCS", sccs_dir_path);
 461  462                  }
 462  463                  MBSTOWCS(path, mb_path);
 463  464                  (void) wscpy(file_name, path);
 464  465            } else {
 465      -                MBSTOWCS(wcs_buffer, NOCATGETS("SCCS"));
      466 +                MBSTOWCS(wcs_buffer, "SCCS");
 466  467                  (void) wscpy(file_name_p, wcs_buffer);
 467  468            }
 468  469          } else {
 469      -                MBSTOWCS(wcs_buffer, NOCATGETS("."));
      470 +                MBSTOWCS(wcs_buffer, ".");
 470  471                  (void) wscpy(file_name_p, wcs_buffer);
 471  472          }
 472  473          /* Internalize the constructed SCCS dir name. */
 473  474          (void) exists(dir = GETNAME(file_name, FIND_LENGTH));
 474  475          /* Just give up if the directory file doesnt exist. */
 475  476          if (!dir->stat.is_file) {
 476  477                  return result;
 477  478          }
 478  479          /* Open the directory. */
 479  480          dir_fd = opendir(dir->string_mb);
↓ open down ↓ 45 lines elided ↑ open up ↑
 525  526                           * plain file.
 526  527                           */
 527  528                          maybe_append_prop(plain_file, sccs_prop)->
 528  529                            body.sccs.file = file;
 529  530  try_pattern:
 530  531                          MBSTOWCS(tmp_wcs_buffer, dp->d_name + 2);
 531  532                          if ((pattern != NULL) &&
 532  533                              amatch(tmp_wcs_buffer, pattern)) {
 533  534                                  if (debug_level > 0) {
 534  535                                          WCSTOMBS(mbs_buffer, pattern);
 535      -                                        (void) printf(catgets(catd, 1, 233, "'%s: %s' due to %s expansion\n"),
      536 +                                        (void) printf(gettext("'%s: %s' due to %s expansion\n"),
 536  537                                                        line->body.line.target->
 537  538                                                        string_mb,
 538  539                                                        plain_file->string_mb,
 539  540                                                        mbs_buffer);
 540  541                                  }
 541  542                                  enter_dependency(line, plain_file, false);
 542  543                                  result++;
 543  544                          }
 544  545                  }
 545  546          }
↓ open down ↓ 165 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX