Print this page
make: remove SCCS ident stuff
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/make/bin/make/common/dosys.cc
+++ new/usr/src/cmd/make/bin/make/common/dosys.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.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
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 -/*
26 - * @(#)dosys.cc 1.45 06/12/12
27 - */
28 -
29 -#pragma ident "@(#)dosys.cc 1.45 06/12/12"
30 25
31 26 /*
32 27 * dosys.cc
33 28 *
34 29 * Execute one commandline
35 30 */
36 31
37 32 /*
38 33 * Included files
39 34 */
40 35 #include <fcntl.h> /* open() */
41 36 #include <mk/defs.h>
42 37 #include <mksh/dosys.h> /* doshell(), doexec() */
43 38 #include <mksh/misc.h> /* getmem() */
44 39 #include <sys/stat.h> /* open() */
45 40 #include <unistd.h> /* getpid() */
46 41
47 42 /*
48 43 * Defined macros
49 44 */
50 45
51 46 /*
52 47 * typedefs & structs
53 48 */
54 49
55 50 /*
56 51 * Static variables
57 52 */
58 53 static int filter_file;
59 54 static char *filter_file_name;
60 55
61 56 /*
62 57 * File table of contents
63 58 */
64 59 static void redirect_stderr(void);
65 60
66 61 /*
67 62 * dosys(command, ignore_error, call_make, silent_error, target)
68 63 *
69 64 * Check if command string contains meta chars and dispatch to
70 65 * the proper routine for executing one command line.
71 66 *
72 67 * Return value:
73 68 * Indicates if the command execution failed
74 69 *
75 70 * Parameters:
76 71 * command The command to run
77 72 * ignore_error Should make abort when an error is seen?
78 73 * call_make Did command reference $(MAKE) ?
79 74 * silent_error Should error messages be suppressed for pmake?
80 75 * target Target we are building
81 76 *
82 77 * Global variables used:
83 78 * do_not_exec_rule Is -n on?
84 79 * working_on_targets We started processing real targets
85 80 */
86 81 Doname
87 82 dosys(register Name command, register Boolean ignore_error, register Boolean call_make, Boolean silent_error, Boolean always_exec, Name target, Boolean redirect_out_err)
88 83 {
89 84 timestruc_t before;
90 85 register int length = command->hash.length;
91 86 Wstring wcb(command);
92 87 register wchar_t *p = wcb.get_string();
93 88 register wchar_t *q;
94 89 Doname result;
95 90
96 91 /* Strip spaces from head of command string */
97 92 while (iswspace(*p)) {
98 93 p++, length--;
99 94 }
100 95 if (*p == (int) nul_char) {
101 96 return build_failed;
102 97 }
103 98 /* If we are faking it we just return */
104 99 if (do_not_exec_rule &&
105 100 working_on_targets &&
106 101 !call_make &&
107 102 !always_exec) {
108 103 return build_ok;
109 104 }
110 105 /* no_action_was_taken is used to print special message */
111 106 no_action_was_taken = false;
112 107
113 108 /* Copy string to make it OK to write it. */
114 109 q = ALLOC_WC(length + 1);
115 110 (void) wscpy(q, p);
116 111 /* Write the state file iff this command uses make. */
117 112 if (call_make && command_changed) {
118 113 write_state_file(0, false);
119 114 }
120 115 make_state->stat.time = file_no_time;
121 116 (void)exists(make_state);
122 117 before = make_state->stat.time;
123 118 /*
124 119 * Run command directly if it contains no shell meta chars,
125 120 * else run it using the shell.
126 121 */
127 122 if (await(ignore_error,
128 123 silent_error,
129 124 target,
130 125 wcb.get_string(),
131 126 command->meta ?
132 127 doshell(q, ignore_error, redirect_out_err,
133 128 stdout_file, stderr_file, 0) :
134 129 doexec(q, ignore_error, redirect_out_err,
135 130 stdout_file, stderr_file,
136 131 vroot_path, 0),
137 132 send_mtool_msgs,
138 133 #if defined(DISTRIBUTED) || defined(MAKETOOL) /* tolik */
139 134 get_xdrs_ptr(),
140 135 get_job_msg_id()
141 136 #else
142 137 NULL,
143 138 -1
144 139 #endif
145 140 )) {
146 141 result = build_ok;
147 142 } else {
148 143 result = build_failed;
149 144 }
150 145 retmem(q);
151 146
152 147 if ((report_dependencies_level == 0) &&
153 148 call_make) {
154 149 make_state->stat.time = file_no_time;
155 150 (void)exists(make_state);
156 151 if (before == make_state->stat.time) {
157 152 return result;
158 153 }
159 154 makefile_type = reading_statefile;
160 155 if (read_trace_level > 1) {
161 156 trace_reader = true;
162 157 }
163 158 temp_file_number++;
164 159 (void) read_simple_file(make_state,
165 160 false,
166 161 false,
167 162 false,
168 163 false,
169 164 false,
170 165 true);
171 166 trace_reader = false;
172 167 }
173 168 return result;
174 169 }
↓ open down ↓ |
135 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX