Print this page
make: translate using gettext, rather than the unmaintainable catgets
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/make/lib/mksh/mksh.cc
+++ new/usr/src/cmd/make/lib/mksh/mksh.cc
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26
27 27 /*
28 28 * mksh.cc
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
29 29 *
30 30 * Execute the command(s) of one Make or DMake rule
31 31 */
32 32
33 33 /*
34 34 * Included files
35 35 */
36 36 #include <mksh/dosys.h> /* redirect_io() */
37 37 #include <mksh/misc.h> /* retmem() */
38 38 #include <mksh/mksh.h>
39 -#include <mksdmsi18n/mksdmsi18n.h>
40 39 #include <errno.h>
41 40 #include <signal.h>
42 41
43 42
44 43 /*
45 44 * Workaround for NFS bug. Sometimes, when running 'chdir' on a remote
46 45 * dmake server, it fails with "Stale NFS file handle" error.
47 46 * The second attempt seems to work.
48 47 */
49 48 int
50 49 my_chdir(char * dir) {
51 50 int res = chdir(dir);
52 51 if (res != 0 && (errno == ESTALE || errno == EAGAIN)) {
53 52 /* Stale NFS file handle. Try again */
54 53 res = chdir(dir);
55 54 }
56 55 return res;
57 56 }
58 57
59 58
60 59 /*
61 60 * File table of contents
62 61 */
63 62 static void change_sunpro_dependencies_value(char *oldpath, char *newpath);
64 63 static void init_mksh_globals(char *shell);
65 64 static void set_env_vars(char *env_list[]);
66 65
67 66
68 67 static void
69 68 set_env_vars(char *env_list[])
70 69 {
71 70 char **env_list_p;
72 71
73 72 for (env_list_p = env_list;
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
74 73 *env_list_p != (char *) NULL;
75 74 env_list_p++) {
76 75 putenv(*env_list_p);
77 76 }
78 77 }
79 78
80 79 static void
81 80 init_mksh_globals(char *shell)
82 81 {
83 82 /*
84 - MBSTOWCS(wcs_buffer, NOCATGETS("SHELL"));
83 + MBSTOWCS(wcs_buffer, "SHELL");
85 84 shell_name = GETNAME(wcs_buffer, FIND_LENGTH);
86 85 MBSTOWCS(wcs_buffer, shell);
87 86 (void) SETVAR(shell_name, GETNAME(wcs_buffer, FIND_LENGTH), false);
88 87 */
89 88 char * dmake_shell;
90 - if ((dmake_shell = getenv(NOCATGETS("DMAKE_SHELL"))) == NULL) {
89 + if ((dmake_shell = getenv("DMAKE_SHELL")) == NULL) {
91 90 dmake_shell = shell;
92 91 }
93 92 MBSTOWCS(wcs_buffer, dmake_shell);
94 93 shell_name = GETNAME(wcs_buffer, FIND_LENGTH);
95 94 }
96 95
97 96 /*
98 97 * Change the pathname in the value of the SUNPRO_DEPENDENCIES env variable
99 98 * from oldpath to newpath.
100 99 */
101 100 static void
102 101 change_sunpro_dependencies_value(char *oldpath, char *newpath)
103 102 {
104 103 char buf[MAXPATHLEN];
105 104 static char *env;
106 105 int length;
107 106 int oldpathlen;
108 107 char *sp_dep_value;
109 108
110 109 /* check if SUNPRO_DEPENDENCIES is set in the environment */
111 - if ((sp_dep_value = getenv(NOCATGETS("SUNPRO_DEPENDENCIES"))) != NULL) {
110 + if ((sp_dep_value = getenv("SUNPRO_DEPENDENCIES")) != NULL) {
112 111 oldpathlen = strlen(oldpath);
113 112 /* check if oldpath is indeed in the value of SUNPRO_DEPENDENCIES */
114 113 if (strncmp(oldpath, sp_dep_value, oldpathlen) == 0) {
115 114 (void) sprintf(buf,
116 115 "%s%s",
117 116 newpath,
118 117 sp_dep_value + oldpathlen);
119 118 length = 2 +
120 - strlen(NOCATGETS("SUNPRO_DEPENDENCIES")) +
119 + strlen("SUNPRO_DEPENDENCIES") +
121 120 strlen(buf);
122 121 env = getmem(length);
123 122 (void) sprintf(env,
124 123 "%s=%s",
125 - NOCATGETS("SUNPRO_DEPENDENCIES"),
124 + "SUNPRO_DEPENDENCIES",
126 125 buf);
127 126 (void) putenv(env);
128 127 }
129 128 }
130 129 }
131 130
132 131
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX