Print this page
4526 nightly contains a great deal of effectively dead code
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/scripts/nightly.sh
+++ new/usr/src/tools/scripts/nightly.sh
1 1 #!/bin/ksh -p
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22
23 23 #
24 24 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
25 25 # Copyright 2008, 2010, Richard Lowe
26 26 # Copyright 2011 Nexenta Systems, Inc. All rights reserved.
27 27 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
28 28 #
29 29 # Based on the nightly script from the integration folks,
30 30 # Mostly modified and owned by mike_s.
31 31 # Changes also by kjc, dmk.
32 32 #
33 33 # BRINGOVER_WS may be specified in the env file.
34 34 # The default is the old behavior of CLONE_WS
35 35 #
36 36 # -i on the command line, means fast options, so when it's on the
37 37 # command line (only), lint and check builds are skipped no matter what
38 38 # the setting of their individual flags are in NIGHTLY_OPTIONS.
↓ open down ↓ |
38 lines elided |
↑ open up ↑ |
39 39 #
40 40 # LINTDIRS can be set in the env file, format is a list of:
41 41 #
42 42 # /dirname-to-run-lint-on flag
43 43 #
44 44 # Where flag is: y - enable lint noise diff output
45 45 # n - disable lint noise diff output
46 46 #
47 47 # For example: LINTDIRS="$SRC/uts n $SRC/stand y $SRC/psm y"
48 48 #
49 -# OPTHOME and TEAMWARE may be set in the environment to override /opt
50 -# and /opt/teamware defaults.
49 +# OPTHOME may be set in the environment to override /opt
51 50 #
52 51
53 52 #
54 53 # The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
55 54 # under certain circumstances, which can really screw things up; unset it.
56 55 #
57 56 unset CDPATH
58 57
59 58 # Get the absolute path of the nightly script that the user invoked. This
60 59 # may be a relative path, and we need to do this before changing directory.
61 60 nightly_path=`whence $0`
62 61
63 62 #
64 63 # Keep track of where we found nightly so we can invoke the matching
65 64 # which_scm script. If that doesn't work, don't go guessing, just rely
66 65 # on the $PATH settings, which will generally give us either /opt/onbld
67 66 # or the user's workspace.
68 67 #
69 68 WHICH_SCM=$(dirname $nightly_path)/which_scm
70 69 if [[ ! -x $WHICH_SCM ]]; then
71 70 WHICH_SCM=which_scm
72 71 fi
73 72
74 73 function fatal_error
75 74 {
76 75 print -u2 "nightly: $*"
77 76 exit 1
78 77 }
79 78
80 79 #
81 80 # Function to do a DEBUG and non-DEBUG build. Needed because we might
82 81 # need to do another for the source build, and since we only deliver DEBUG or
83 82 # non-DEBUG packages.
84 83 #
85 84 # usage: normal_build
86 85 #
87 86 function normal_build {
88 87
89 88 typeset orig_p_FLAG="$p_FLAG"
↓ open down ↓ |
29 lines elided |
↑ open up ↑ |
90 89 typeset crypto_signer="$CODESIGN_USER"
91 90
92 91 suffix=""
93 92
94 93 # non-DEBUG build begins
95 94
96 95 if [ "$F_FLAG" = "n" ]; then
97 96 set_non_debug_build_flags
98 97 CODESIGN_USER="$crypto_signer" \
99 98 build "non-DEBUG" "$suffix-nd" "-nd" "$MULTI_PROTO"
100 - if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \
101 - "$p_FLAG" = "y" ]; then
102 - copy_ihv_pkgs non-DEBUG -nd
103 - fi
104 99 else
105 100 echo "\n==== No non-DEBUG $open_only build ====\n" >> "$LOGFILE"
106 101 fi
107 102
108 103 # non-DEBUG build ends
109 104
110 105 # DEBUG build begins
111 106
112 107 if [ "$D_FLAG" = "y" ]; then
113 108 set_debug_build_flags
114 109 CODESIGN_USER="$crypto_signer" \
115 110 build "DEBUG" "$suffix" "" "$MULTI_PROTO"
116 - if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \
117 - "$p_FLAG" = "y" ]; then
118 - copy_ihv_pkgs DEBUG ""
119 - fi
120 111 else
121 112 echo "\n==== No DEBUG $open_only build ====\n" >> "$LOGFILE"
122 113 fi
123 114
124 115 # DEBUG build ends
125 116
126 117 p_FLAG="$orig_p_FLAG"
127 118 }
128 119
129 120 #
130 121 # usage: run_hook HOOKNAME ARGS...
131 122 #
132 123 # If variable "$HOOKNAME" is defined, insert a section header into
133 124 # our logs and then run the command with ARGS
134 125 #
135 126 function run_hook {
136 127 HOOKNAME=$1
137 128 eval HOOKCMD=\$$HOOKNAME
138 129 shift
139 130
140 131 if [ -n "$HOOKCMD" ]; then
141 132 (
142 133 echo "\n==== Running $HOOKNAME command: $HOOKCMD ====\n"
143 134 ( $HOOKCMD "$@" 2>&1 )
144 135 if [ "$?" -ne 0 ]; then
145 136 # Let exit status propagate up
146 137 touch $TMPDIR/abort
147 138 fi
148 139 ) | tee -a $mail_msg_file >> $LOGFILE
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
149 140
150 141 if [ -f $TMPDIR/abort ]; then
151 142 build_ok=n
152 143 echo "\nAborting at request of $HOOKNAME" |
153 144 tee -a $mail_msg_file >> $LOGFILE
154 145 exit 1
155 146 fi
156 147 fi
157 148 }
158 149
159 -#
160 -# usage: filelist DESTDIR PATTERN
161 -#
162 -function filelist {
163 - DEST=$1
164 - PATTERN=$2
165 - cd ${DEST}
166 -}
167 -
168 -# function to save off binaries after a full build for later
169 -# restoration
170 -function save_binaries {
171 - # save off list of binaries
172 - echo "\n==== Saving binaries from build at `date` ====\n" | \
173 - tee -a $mail_msg_file >> $LOGFILE
174 - rm -f ${BINARCHIVE}
175 - cd ${CODEMGR_WS}
176 - filelist ${CODEMGR_WS} '^preserve:' >> $LOGFILE
177 - filelist ${CODEMGR_WS} '^preserve:' | \
178 - cpio -ocB 2>/dev/null | compress \
179 - > ${BINARCHIVE}
180 -}
181 -
182 -# delete files
183 -# usage: hybridize_files DESTDIR MAKE_TARGET
184 -function hybridize_files {
185 - DEST=$1
186 - MAKETARG=$2
187 -
188 - echo "\n==== Hybridizing files at `date` ====\n" | \
189 - tee -a $mail_msg_file >> $LOGFILE
190 - for i in `filelist ${DEST} '^delete:'`
191 - do
192 - echo "removing ${i}." | tee -a $mail_msg_file >> $LOGFILE
193 - rm -rf "${i}"
194 - done
195 - for i in `filelist ${DEST} '^hybridize:' `
196 - do
197 - echo "hybridizing ${i}." | tee -a $mail_msg_file >> $LOGFILE
198 - rm -f ${i}+
199 - sed -e "/^# HYBRID DELETE START/,/^# HYBRID DELETE END/d" \
200 - < ${i} > ${i}+
201 - mv ${i}+ ${i}
202 - done
203 -}
204 -
205 -# restore binaries into the proper source tree.
206 -# usage: restore_binaries DESTDIR MAKE_TARGET
207 -function restore_binaries {
208 - DEST=$1
209 - MAKETARG=$2
210 -
211 - echo "\n==== Restoring binaries to ${MAKETARG} at `date` ====\n" | \
212 - tee -a $mail_msg_file >> $LOGFILE
213 - cd ${DEST}
214 - zcat ${BINARCHIVE} | \
215 - cpio -idmucvB 2>/dev/null | tee -a $mail_msg_file >> ${LOGFILE}
216 -}
217 -
218 -# rename files we save binaries of
219 -# usage: rename_files DESTDIR MAKE_TARGET
220 -function rename_files {
221 - DEST=$1
222 - MAKETARG=$2
223 - echo "\n==== Renaming source files in ${MAKETARG} at `date` ====\n" | \
224 - tee -a $mail_msg_file >> $LOGFILE
225 - for i in `filelist ${DEST} '^rename:'`
226 - do
227 - echo ${i} | tee -a $mail_msg_file >> ${LOGFILE}
228 - rm -f ${i}.export
229 - mv ${i} ${i}.export
230 - done
231 -}
232 -
233 150 # Return library search directive as function of given root.
234 151 function myldlibs {
235 152 echo "-L$1/lib -L$1/usr/lib"
236 153 }
237 154
238 155 # Return header search directive as function of given root.
239 156 function myheaders {
240 157 echo "-I$1/usr/include"
241 158 }
242 159
243 160 #
244 161 # Function to do the build, including package generation.
245 162 # usage: build LABEL SUFFIX ND MULTIPROTO
246 163 # - LABEL is used to tag build output.
247 164 # - SUFFIX is used to distinguish files (e.g., DEBUG vs non-DEBUG,
248 165 # open-only vs full tree).
249 166 # - ND is "-nd" (non-DEBUG builds) or "" (DEBUG builds).
250 167 # - If MULTIPROTO is "yes", it means to name the proto area according to
251 168 # SUFFIX. Otherwise ("no"), (re)use the standard proto area.
252 169 #
253 170 function build {
254 171 LABEL=$1
255 172 SUFFIX=$2
256 173 ND=$3
257 174 MULTIPROTO=$4
258 175 INSTALLOG=install${SUFFIX}-${MACH}
259 176 NOISE=noise${SUFFIX}-${MACH}
260 177 PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
261 178
262 179 ORIGROOT=$ROOT
263 180 [ $MULTIPROTO = no ] || export ROOT=$ROOT$SUFFIX
264 181
265 182 export ENVLDLIBS1=`myldlibs $ROOT`
266 183 export ENVCPPFLAGS1=`myheaders $ROOT`
267 184
268 185 this_build_ok=y
269 186 #
↓ open down ↓ |
27 lines elided |
↑ open up ↑ |
270 187 # Build OS-Networking source
271 188 #
272 189 echo "\n==== Building OS-Net source at `date` ($LABEL) ====\n" \
273 190 >> $LOGFILE
274 191
275 192 rm -f $SRC/${INSTALLOG}.out
276 193 cd $SRC
277 194 /bin/time $MAKE -e install 2>&1 | \
278 195 tee -a $SRC/${INSTALLOG}.out >> $LOGFILE
279 196
280 - if [[ "$SCM_TYPE" = teamware ]]; then
281 - echo "\n==== SCCS Noise ($LABEL) ====\n" >> $mail_msg_file
282 - egrep 'sccs(check:| *get)' $SRC/${INSTALLOG}.out >> \
283 - $mail_msg_file
284 - fi
285 -
286 197 echo "\n==== Build errors ($LABEL) ====\n" >> $mail_msg_file
287 198 egrep ":" $SRC/${INSTALLOG}.out |
288 199 egrep -e "(^${MAKE}:|[ ]error[: \n])" | \
289 200 egrep -v "Ignoring unknown host" | \
290 201 egrep -v "cc .* -o error " | \
291 202 egrep -v "warning" >> $mail_msg_file
292 203 if [ "$?" = "0" ]; then
293 204 build_ok=n
294 205 this_build_ok=n
295 206 fi
296 207 grep "bootblock image is .* bytes too big" $SRC/${INSTALLOG}.out \
297 208 >> $mail_msg_file
298 209 if [ "$?" = "0" ]; then
299 210 build_ok=n
300 211 this_build_ok=n
301 212 fi
302 213
303 - if [ "$W_FLAG" = "n" ]; then
304 - echo "\n==== Build warnings ($LABEL) ====\n" >>$mail_msg_file
305 - egrep -i warning: $SRC/${INSTALLOG}.out \
306 - | egrep -v '^tic:' \
307 - | egrep -v "symbol (\`|')timezone' has differing types:" \
308 - | egrep -v "parameter <PSTAMP> set to" \
309 - | egrep -v "Ignoring unknown host" \
310 - | egrep -v "redefining segment flags attribute for" \
311 - >> $mail_msg_file
312 - fi
214 + echo "\n==== Build warnings ($LABEL) ====\n" >>$mail_msg_file
215 + egrep -i warning: $SRC/${INSTALLOG}.out \
216 + | egrep -v '^tic:' \
217 + | egrep -v "symbol (\`|')timezone' has differing types:" \
218 + | egrep -v "parameter <PSTAMP> set to" \
219 + | egrep -v "Ignoring unknown host" \
220 + | egrep -v "redefining segment flags attribute for" \
221 + >> $mail_msg_file
313 222
314 223 echo "\n==== Ended OS-Net source build at `date` ($LABEL) ====\n" \
315 224 >> $LOGFILE
316 225
317 226 echo "\n==== Elapsed build time ($LABEL) ====\n" >>$mail_msg_file
318 227 tail -3 $SRC/${INSTALLOG}.out >>$mail_msg_file
319 228
320 - if [ "$i_FLAG" = "n" -a "$W_FLAG" = "n" ]; then
229 + if [ "$i_FLAG" = "n" ]; then
321 230 rm -f $SRC/${NOISE}.ref
322 231 if [ -f $SRC/${NOISE}.out ]; then
323 232 mv $SRC/${NOISE}.out $SRC/${NOISE}.ref
324 233 fi
325 234 grep : $SRC/${INSTALLOG}.out \
326 235 | egrep -v '^/' \
327 236 | egrep -v '^(Start|Finish|real|user|sys|./bld_awk)' \
328 237 | egrep -v '^tic:' \
329 238 | egrep -v '^mcs' \
330 239 | egrep -v '^LD_LIBRARY_PATH=' \
331 240 | egrep -v 'ar: creating' \
332 241 | egrep -v 'ar: writing' \
333 242 | egrep -v 'conflicts:' \
334 243 | egrep -v ':saved created' \
335 244 | egrep -v '^stty.*c:' \
336 245 | egrep -v '^mfgname.c:' \
337 246 | egrep -v '^uname-i.c:' \
338 247 | egrep -v '^volumes.c:' \
339 248 | egrep -v '^lint library construction:' \
340 249 | egrep -v 'tsort: INFORM:' \
341 250 | egrep -v 'stripalign:' \
342 251 | egrep -v 'chars, width' \
343 252 | egrep -v "symbol (\`|')timezone' has differing types:" \
344 253 | egrep -v 'PSTAMP' \
345 254 | egrep -v '|%WHOANDWHERE%|' \
346 255 | egrep -v '^Manifying' \
347 256 | egrep -v 'Ignoring unknown host' \
348 257 | egrep -v 'Processing method:' \
349 258 | egrep -v '^Writing' \
350 259 | egrep -v 'spellin1:' \
351 260 | egrep -v '^adding:' \
352 261 | egrep -v "^echo 'msgid" \
353 262 | egrep -v '^echo ' \
354 263 | egrep -v '\.c:$' \
355 264 | egrep -v '^Adding file:' \
356 265 | egrep -v 'CLASSPATH=' \
357 266 | egrep -v '\/var\/mail\/:saved' \
358 267 | egrep -v -- '-DUTS_VERSION=' \
359 268 | egrep -v '^Running Mkbootstrap' \
360 269 | egrep -v '^Applet length read:' \
361 270 | egrep -v 'bytes written:' \
362 271 | egrep -v '^File:SolarisAuthApplet.bin' \
363 272 | egrep -v -i 'jibversion' \
364 273 | egrep -v '^Output size:' \
365 274 | egrep -v '^Solo size statistics:' \
366 275 | egrep -v '^Using ROM API Version' \
367 276 | egrep -v '^Zero Signature length:' \
368 277 | egrep -v '^Note \(probably harmless\):' \
369 278 | egrep -v '::' \
370 279 | egrep -v -- '-xcache' \
371 280 | egrep -v '^\+' \
372 281 | egrep -v '^cc1: note: -fwritable-strings' \
373 282 | egrep -v 'svccfg-native -s svc:/' \
374 283 | sort | uniq >$SRC/${NOISE}.out
375 284 if [ ! -f $SRC/${NOISE}.ref ]; then
376 285 cp $SRC/${NOISE}.out $SRC/${NOISE}.ref
377 286 fi
378 287 echo "\n==== Build noise differences ($LABEL) ====\n" \
379 288 >>$mail_msg_file
380 289 diff $SRC/${NOISE}.ref $SRC/${NOISE}.out >>$mail_msg_file
381 290 fi
382 291
383 292 #
384 293 # Re-sign selected binaries using signing server
385 294 # (gatekeeper builds only)
386 295 #
387 296 if [ -n "$CODESIGN_USER" -a "$this_build_ok" = "y" ]; then
388 297 echo "\n==== Signing proto area at `date` ====\n" >> $LOGFILE
389 298 signing_file="${TMPDIR}/signing"
390 299 rm -f ${signing_file}
391 300 export CODESIGN_USER
392 301 signproto $SRC/tools/codesign/creds 2>&1 | \
393 302 tee -a ${signing_file} >> $LOGFILE
394 303 echo "\n==== Finished signing proto area at `date` ====\n" \
395 304 >> $LOGFILE
396 305 echo "\n==== Crypto module signing errors ($LABEL) ====\n" \
397 306 >> $mail_msg_file
398 307 egrep 'WARNING|ERROR' ${signing_file} >> $mail_msg_file
↓ open down ↓ |
68 lines elided |
↑ open up ↑ |
399 308 if (( $? == 0 )) ; then
400 309 build_ok=n
401 310 this_build_ok=n
402 311 fi
403 312 fi
404 313
405 314 #
406 315 # Building Packages
407 316 #
408 317 if [ "$p_FLAG" = "y" -a "$this_build_ok" = "y" ]; then
409 - if [ -d $SRC/pkg -o -d $SRC/pkgdefs ]; then
318 + if [ -d $SRC/pkg ]; then
410 319 echo "\n==== Creating $LABEL packages at `date` ====\n" \
411 320 >> $LOGFILE
412 321 echo "Clearing out $PKGARCHIVE ..." >> $LOGFILE
413 322 rm -rf $PKGARCHIVE >> "$LOGFILE" 2>&1
414 323 mkdir -p $PKGARCHIVE >> "$LOGFILE" 2>&1
415 324
416 - for d in pkg pkgdefs; do
417 - if [ ! -f "$SRC/$d/Makefile" ]; then
418 - continue
419 - fi
420 - rm -f $SRC/$d/${INSTALLOG}.out
421 - cd $SRC/$d
422 - /bin/time $MAKE -e install 2>&1 | \
423 - tee -a $SRC/$d/${INSTALLOG}.out >> $LOGFILE
424 - done
325 + rm -f $SRC/pkg/${INSTALLOG}.out
326 + cd $SRC/pkg
327 + /bin/time $MAKE -e install 2>&1 | \
328 + tee -a $SRC/pkg/${INSTALLOG}.out >> $LOGFILE
425 329
426 330 echo "\n==== package build errors ($LABEL) ====\n" \
427 331 >> $mail_msg_file
428 332
429 - for d in pkg pkgdefs; do
430 - if [ ! -f "$SRC/$d/Makefile" ]; then
431 - continue
432 - fi
433 -
434 - egrep "${MAKE}|ERROR|WARNING" $SRC/$d/${INSTALLOG}.out | \
435 - grep ':' | \
436 - grep -v PSTAMP | \
437 - egrep -v "Ignoring unknown host" \
438 - >> $mail_msg_file
439 - done
333 + egrep "${MAKE}|ERROR|WARNING" $SRC/pkg/${INSTALLOG}.out | \
334 + grep ':' | \
335 + grep -v PSTAMP | \
336 + egrep -v "Ignoring unknown host" \
337 + >> $mail_msg_file
440 338 else
441 339 #
442 340 # Handle it gracefully if -p was set but there are
443 - # neither pkg nor pkgdefs directories.
341 + # neither pkg directories.
444 342 #
445 343 echo "\n==== No $LABEL packages to build ====\n" \
446 344 >> $LOGFILE
447 345 fi
448 346 else
449 347 echo "\n==== Not creating $LABEL packages ====\n" >> $LOGFILE
450 348 fi
451 349
452 350 ROOT=$ORIGROOT
453 351 }
454 352
455 353 # Usage: dolint /dir y|n
456 354 # Arg. 2 is a flag to turn on/off the lint diff output
457 355 function dolint {
458 356 if [ ! -d "$1" ]; then
459 357 echo "dolint error: $1 is not a directory"
460 358 exit 1
461 359 fi
462 360
463 361 if [ "$2" != "y" -a "$2" != "n" ]; then
464 362 echo "dolint internal error: $2 should be 'y' or 'n'"
465 363 exit 1
466 364 fi
467 365
468 366 lintdir=$1
469 367 dodiff=$2
470 368 base=`basename $lintdir`
471 369 LINTOUT=$lintdir/lint-${MACH}.out
472 370 LINTNOISE=$lintdir/lint-noise-${MACH}
473 371 export ENVLDLIBS1=`myldlibs $ROOT`
474 372 export ENVCPPFLAGS1=`myheaders $ROOT`
475 373
476 374 set_debug_build_flags
477 375
478 376 #
479 377 # '$MAKE lint' in $lintdir
480 378 #
481 379 echo "\n==== Begin '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
482 380
483 381 # remove old lint.out
484 382 rm -f $lintdir/lint.out $lintdir/lint-noise.out
485 383 if [ -f $lintdir/lint-noise.ref ]; then
486 384 mv $lintdir/lint-noise.ref ${LINTNOISE}.ref
487 385 fi
488 386
489 387 rm -f $LINTOUT
490 388 cd $lintdir
491 389 #
492 390 # Remove all .ln files to ensure a full reference file
493 391 #
494 392 rm -f Nothing_to_remove \
495 393 `find . \( -name SCCS -o -name .hg -o -name .svn -o -name .git \) \
496 394 -prune -o -type f -name '*.ln' -print `
497 395
498 396 /bin/time $MAKE -ek lint 2>&1 | \
499 397 tee -a $LINTOUT >> $LOGFILE
500 398 echo "\n==== '$MAKE lint' of $base ERRORS ====\n" >> $mail_msg_file
501 399 grep "$MAKE:" $LINTOUT |
502 400 egrep -v "Ignoring unknown host" \
503 401 >> $mail_msg_file
504 402
505 403 echo "\n==== Ended '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
506 404
507 405 echo "\n==== Elapsed time of '$MAKE lint' of $base ====\n" \
508 406 >>$mail_msg_file
509 407 tail -3 $LINTOUT >>$mail_msg_file
510 408
511 409 rm -f ${LINTNOISE}.ref
512 410 if [ -f ${LINTNOISE}.out ]; then
513 411 mv ${LINTNOISE}.out ${LINTNOISE}.ref
514 412 fi
515 413 grep : $LINTOUT | \
516 414 egrep -v '^(real|user|sys)' |
517 415 egrep -v '(library construction)' | \
518 416 egrep -v ': global crosschecks' | \
519 417 egrep -v 'Ignoring unknown host' | \
520 418 egrep -v '\.c:$' | \
521 419 sort | uniq > ${LINTNOISE}.out
522 420 if [ ! -f ${LINTNOISE}.ref ]; then
523 421 cp ${LINTNOISE}.out ${LINTNOISE}.ref
524 422 fi
525 423 if [ "$dodiff" != "n" ]; then
526 424 echo "\n==== lint warnings $base ====\n" \
527 425 >>$mail_msg_file
528 426 # should be none, though there are a few that were filtered out
↓ open down ↓ |
75 lines elided |
↑ open up ↑ |
529 427 # above
530 428 egrep -i '(warning|lint):' ${LINTNOISE}.out \
531 429 | sort | uniq >> $mail_msg_file
532 430 echo "\n==== lint noise differences $base ====\n" \
533 431 >> $mail_msg_file
534 432 diff ${LINTNOISE}.ref ${LINTNOISE}.out \
535 433 >> $mail_msg_file
536 434 fi
537 435 }
538 436
539 -# Install proto area from IHV build
540 -
541 -function copy_ihv_proto {
542 -
543 - echo "\n==== Installing IHV proto area ====\n" \
544 - >> $LOGFILE
545 - if [ -d "$IA32_IHV_ROOT" ]; then
546 - if [ ! -d "$ROOT" ]; then
547 - echo "mkdir -p $ROOT" >> $LOGFILE
548 - mkdir -p $ROOT
549 - fi
550 - echo "copying $IA32_IHV_ROOT to $ROOT\n" >> $LOGFILE
551 - cd $IA32_IHV_ROOT
552 - tar cf - . | (cd $ROOT; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
553 - else
554 - echo "$IA32_IHV_ROOT: not found" >> $LOGFILE
555 - fi
556 -
557 - if [ "$MULTI_PROTO" = yes ]; then
558 - if [ ! -d "$ROOT-nd" ]; then
559 - echo "mkdir -p $ROOT-nd" >> $LOGFILE
560 - mkdir -p $ROOT-nd
561 - fi
562 - # If there's a non-DEBUG version of the IHV proto area,
563 - # copy it, but copy something if there's not.
564 - if [ -d "$IA32_IHV_ROOT-nd" ]; then
565 - echo "copying $IA32_IHV_ROOT-nd to $ROOT-nd\n" >> $LOGFILE
566 - cd $IA32_IHV_ROOT-nd
567 - elif [ -d "$IA32_IHV_ROOT" ]; then
568 - echo "copying $IA32_IHV_ROOT to $ROOT-nd\n" >> $LOGFILE
569 - cd $IA32_IHV_ROOT
570 - else
571 - echo "$IA32_IHV_ROOT{-nd,}: not found" >> $LOGFILE
572 - return
573 - fi
574 - tar cf - . | (cd $ROOT-nd; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
575 - fi
576 -}
577 -
578 -# Install IHV packages in PKGARCHIVE
579 -# usage: copy_ihv_pkgs LABEL SUFFIX
580 -function copy_ihv_pkgs {
581 - LABEL=$1
582 - SUFFIX=$2
583 - # always use non-DEBUG IHV packages
584 - IA32_IHV_PKGS=${IA32_IHV_PKGS_ORIG}-nd
585 - PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
586 -
587 - echo "\n==== Installing IHV packages from $IA32_IHV_PKGS ($LABEL) ====\n" \
588 - >> $LOGFILE
589 - if [ -d "$IA32_IHV_PKGS" ]; then
590 - cd $IA32_IHV_PKGS
591 - tar cf - * | \
592 - (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
593 - else
594 - echo "$IA32_IHV_PKGS: not found" >> $LOGFILE
595 - fi
596 -
597 - echo "\n==== Installing IHV packages from $IA32_IHV_BINARY_PKGS ($LABEL) ====\n" \
598 - >> $LOGFILE
599 - if [ -d "$IA32_IHV_BINARY_PKGS" ]; then
600 - cd $IA32_IHV_BINARY_PKGS
601 - tar cf - * | \
602 - (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
603 - else
604 - echo "$IA32_IHV_BINARY_PKGS: not found" >> $LOGFILE
605 - fi
606 -}
607 -
608 437 #
609 438 # Build and install the onbld tools.
610 439 #
611 440 # usage: build_tools DESTROOT
612 441 #
613 442 # returns non-zero status if the build was successful.
614 443 #
615 444 function build_tools {
616 445 DESTROOT=$1
617 446
618 447 INSTALLOG=install-${MACH}
619 448
620 449 echo "\n==== Building tools at `date` ====\n" \
621 450 >> $LOGFILE
622 451
623 452 rm -f ${TOOLS}/${INSTALLOG}.out
624 453 cd ${TOOLS}
625 454 /bin/time $MAKE TOOLS_PROTO=${DESTROOT} -e install 2>&1 | \
626 455 tee -a ${TOOLS}/${INSTALLOG}.out >> $LOGFILE
627 456
628 457 echo "\n==== Tools build errors ====\n" >> $mail_msg_file
629 458
630 459 egrep ":" ${TOOLS}/${INSTALLOG}.out |
631 460 egrep -e "(${MAKE}:|[ ]error[: \n])" | \
632 461 egrep -v "Ignoring unknown host" | \
633 462 egrep -v warning >> $mail_msg_file
634 463 return $?
635 464 }
636 465
637 466 #
638 467 # Set up to use locally installed tools.
639 468 #
640 469 # usage: use_tools TOOLSROOT
641 470 #
642 471 function use_tools {
643 472 TOOLSROOT=$1
644 473
645 474 #
646 475 # If we're not building ON workspace, then the TOOLSROOT
647 476 # settings here are clearly ignored by the workspace
648 477 # makefiles, prepending nonexistent directories to PATH is
649 478 # harmless, and we clearly do not wish to override
650 479 # ONBLD_TOOLS.
651 480 #
652 481 # If we're building an ON workspace, then the prepended PATH
653 482 # elements should supercede the preexisting ONBLD_TOOLS paths,
654 483 # and we want to override ONBLD_TOOLS to catch the tools that
655 484 # don't have specific path env vars here.
656 485 #
657 486 # So the only conditional behavior is overriding ONBLD_TOOLS,
658 487 # and we check for "an ON workspace" by looking for
659 488 # ${TOOLSROOT}/opt/onbld.
660 489 #
661 490
662 491 STABS=${TOOLSROOT}/opt/onbld/bin/${MACH}/stabs
663 492 export STABS
664 493 CTFSTABS=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfstabs
665 494 export CTFSTABS
666 495 GENOFFSETS=${TOOLSROOT}/opt/onbld/bin/genoffsets
667 496 export GENOFFSETS
668 497
669 498 CTFCONVERT=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfconvert
670 499 export CTFCONVERT
671 500 CTFMERGE=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfmerge
672 501 export CTFMERGE
673 502
674 503 CTFCVTPTBL=${TOOLSROOT}/opt/onbld/bin/ctfcvtptbl
675 504 export CTFCVTPTBL
676 505 CTFFINDMOD=${TOOLSROOT}/opt/onbld/bin/ctffindmod
677 506 export CTFFINDMOD
678 507
679 508 if [ "$VERIFY_ELFSIGN" = "y" ]; then
680 509 ELFSIGN=${TOOLSROOT}/opt/onbld/bin/elfsigncmp
681 510 else
682 511 ELFSIGN=${TOOLSROOT}/opt/onbld/bin/${MACH}/elfsign
683 512 fi
684 513 export ELFSIGN
685 514
686 515 PATH="${TOOLSROOT}/opt/onbld/bin/${MACH}:${PATH}"
687 516 PATH="${TOOLSROOT}/opt/onbld/bin:${PATH}"
688 517 export PATH
689 518
690 519 if [ -d "${TOOLSROOT}/opt/onbld" ]; then
691 520 ONBLD_TOOLS=${TOOLSROOT}/opt/onbld
692 521 export ONBLD_TOOLS
693 522 fi
694 523
695 524 echo "\n==== New environment settings. ====\n" >> $LOGFILE
696 525 echo "STABS=${STABS}" >> $LOGFILE
697 526 echo "CTFSTABS=${CTFSTABS}" >> $LOGFILE
698 527 echo "CTFCONVERT=${CTFCONVERT}" >> $LOGFILE
699 528 echo "CTFMERGE=${CTFMERGE}" >> $LOGFILE
700 529 echo "CTFCVTPTBL=${CTFCVTPTBL}" >> $LOGFILE
701 530 echo "CTFFINDMOD=${CTFFINDMOD}" >> $LOGFILE
702 531 echo "ELFSIGN=${ELFSIGN}" >> $LOGFILE
703 532 echo "PATH=${PATH}" >> $LOGFILE
704 533 echo "ONBLD_TOOLS=${ONBLD_TOOLS}" >> $LOGFILE
705 534 }
706 535
707 536 function staffer {
708 537 if [ $ISUSER -ne 0 ]; then
709 538 "$@"
710 539 else
711 540 arg="\"$1\""
↓ open down ↓ |
94 lines elided |
↑ open up ↑ |
712 541 shift
713 542 for i
714 543 do
715 544 arg="$arg \"$i\""
716 545 done
717 546 eval su $STAFFER -c \'$arg\'
718 547 fi
719 548 }
720 549
721 550 #
722 -# Verify that the closed tree is present if it needs to be.
551 +# Verify that the closed bins are present
723 552 #
724 -function check_closed_tree {
553 +function check_closed_bins {
725 554 if [[ ! -d "$ON_CLOSED_BINS" ]]; then
726 555 echo "ON_CLOSED_BINS must point to the closed binaries tree."
727 556 build_ok=n
728 557 exit 1
729 558 fi
730 559 }
731 560
732 -function obsolete_build {
733 - echo "WARNING: Obsolete $1 build requested; request will be ignored"
734 -}
735 -
736 561 #
737 562 # wrapper over wsdiff.
738 563 # usage: do_wsdiff LABEL OLDPROTO NEWPROTO
739 564 #
740 565 function do_wsdiff {
741 566 label=$1
742 567 oldproto=$2
743 568 newproto=$3
744 569
745 570 wsdiff="wsdiff"
746 571 [ "$t_FLAG" = y ] && wsdiff="wsdiff -t"
747 572
748 573 echo "\n==== Getting object changes since last build at `date`" \
749 574 "($label) ====\n" | tee -a $LOGFILE >> $mail_msg_file
750 575 $wsdiff -s -r ${TMPDIR}/wsdiff.results $oldproto $newproto 2>&1 | \
751 576 tee -a $LOGFILE >> $mail_msg_file
752 577 echo "\n==== Object changes determined at `date` ($label) ====\n" | \
753 578 tee -a $LOGFILE >> $mail_msg_file
754 579 }
755 580
756 581 #
757 582 # Functions for setting build flags (DEBUG/non-DEBUG). Keep them
758 583 # together.
759 584 #
760 585
761 586 function set_non_debug_build_flags {
762 587 export RELEASE_BUILD ; RELEASE_BUILD=
763 588 unset EXTRA_OPTIONS
764 589 unset EXTRA_CFLAGS
765 590 }
766 591
767 592 function set_debug_build_flags {
768 593 unset RELEASE_BUILD
769 594 unset EXTRA_OPTIONS
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
770 595 unset EXTRA_CFLAGS
771 596 }
772 597
773 598
774 599 MACH=`uname -p`
775 600
776 601 if [ "$OPTHOME" = "" ]; then
777 602 OPTHOME=/opt
778 603 export OPTHOME
779 604 fi
780 -if [ "$TEAMWARE" = "" ]; then
781 - TEAMWARE=$OPTHOME/teamware
782 - export TEAMWARE
783 -fi
784 605
785 606 USAGE='Usage: nightly [-in] [+t] [-V VERS ] <env_file>
786 607
787 608 Where:
788 609 -i Fast incremental options (no clobber, lint, check)
789 610 -n Do not do a bringover
790 611 +t Use the build tools in $ONBLD_TOOLS/bin
791 612 -V VERS set the build version string to VERS
792 613
793 614 <env_file> file in Bourne shell syntax that sets and exports
794 615 variables that configure the operation of this script and many of
795 616 the scripts this one calls. If <env_file> does not exist,
796 617 it will be looked for in $OPTHOME/onbld/env.
797 618
798 619 non-DEBUG is the default build type. Build options can be set in the
799 620 NIGHTLY_OPTIONS variable in the <env_file> as follows:
800 621
801 622 -A check for ABI differences in .so files
↓ open down ↓ |
8 lines elided |
↑ open up ↑ |
802 623 -C check for cstyle/hdrchk errors
803 624 -D do a build with DEBUG on
804 625 -F do _not_ do a non-DEBUG build
805 626 -G gate keeper default group of options (-au)
806 627 -I integration engineer default group of options (-ampu)
807 628 -M do not run pmodes (safe file permission checker)
808 629 -N do not run protocmp
809 630 -R default group of options for building a release (-mp)
810 631 -U update proto area in the parent
811 632 -V VERS set the build version string to VERS
812 - -X copy x86 IHV proto area
813 633 -f find unreferenced files
814 634 -i do an incremental build (no "make clobber")
815 635 -l do "make lint" in $LINTDIRS (default: $SRC y)
816 636 -m send mail to $MAILTO at end of build
817 637 -n do not do a bringover
818 - -o build using root privileges to set OWNER/GROUP (old style)
819 638 -p create packages
820 639 -r check ELF runtime attributes in the proto area
821 640 -t build and use the tools in $SRC/tools (default setting)
822 641 +t Use the build tools in $ONBLD_TOOLS/bin
823 642 -u update proto_list_$MACH and friends in the parent workspace;
824 643 when used with -f, also build an unrefmaster.out in the parent
825 644 -w report on differences between previous and current proto areas
826 - -z compress cpio archives with gzip
827 - -W Do not report warnings (freeware gate ONLY)
828 645 '
829 646 #
830 647 # A log file will be generated under the name $LOGFILE
831 648 # for partially completed build and log.`date '+%F'`
832 649 # in the same directory for fully completed builds.
833 650 #
834 651
835 652 # default values for low-level FLAGS; G I R are group FLAGS
836 653 A_FLAG=n
837 654 C_FLAG=n
838 655 D_FLAG=n
839 656 F_FLAG=n
840 657 f_FLAG=n
841 658 i_FLAG=n; i_CMD_LINE_FLAG=n
842 659 l_FLAG=n
843 660 M_FLAG=n
844 661 m_FLAG=n
845 662 N_FLAG=n
846 663 n_FLAG=n
847 -o_FLAG=n
848 -P_FLAG=n
849 664 p_FLAG=n
850 665 r_FLAG=n
851 -T_FLAG=n
852 666 t_FLAG=y
853 667 U_FLAG=n
854 668 u_FLAG=n
855 669 V_FLAG=n
856 -W_FLAG=n
857 670 w_FLAG=n
858 -X_FLAG=n
859 -#
860 -XMOD_OPT=
861 671 #
862 672 build_ok=y
863 673
864 674 #
865 675 # examine arguments
866 676 #
867 677
868 678 OPTIND=1
869 679 while getopts +intV: FLAG
870 680 do
871 681 case $FLAG in
872 682 i ) i_FLAG=y; i_CMD_LINE_FLAG=y
873 683 ;;
874 684 n ) n_FLAG=y
875 685 ;;
876 686 +t ) t_FLAG=n
877 687 ;;
878 688 V ) V_FLAG=y
879 689 V_ARG="$OPTARG"
880 690 ;;
881 691 \? ) echo "$USAGE"
882 692 exit 1
883 693 ;;
884 694 esac
885 695 done
886 696
887 697 # correct argument count after options
888 698 shift `expr $OPTIND - 1`
889 699
890 700 # test that the path to the environment-setting file was given
891 701 if [ $# -ne 1 ]; then
892 702 echo "$USAGE"
893 703 exit 1
894 704 fi
895 705
896 706 # check if user is running nightly as root
897 707 # ISUSER is set non-zero if an ordinary user runs nightly, or is zero
898 708 # when root invokes nightly.
899 709 /usr/bin/id | grep '^uid=0(' >/dev/null 2>&1
900 710 ISUSER=$?; export ISUSER
901 711
902 712 #
903 713 # force locale to C
904 714 LC_COLLATE=C; export LC_COLLATE
905 715 LC_CTYPE=C; export LC_CTYPE
906 716 LC_MESSAGES=C; export LC_MESSAGES
907 717 LC_MONETARY=C; export LC_MONETARY
908 718 LC_NUMERIC=C; export LC_NUMERIC
909 719 LC_TIME=C; export LC_TIME
910 720
911 721 # clear environment variables we know to be bad for the build
912 722 unset LD_OPTIONS
913 723 unset LD_AUDIT LD_AUDIT_32 LD_AUDIT_64
914 724 unset LD_BIND_NOW LD_BIND_NOW_32 LD_BIND_NOW_64
915 725 unset LD_BREADTH LD_BREADTH_32 LD_BREADTH_64
916 726 unset LD_CONFIG LD_CONFIG_32 LD_CONFIG_64
917 727 unset LD_DEBUG LD_DEBUG_32 LD_DEBUG_64
918 728 unset LD_DEMANGLE LD_DEMANGLE_32 LD_DEMANGLE_64
919 729 unset LD_FLAGS LD_FLAGS_32 LD_FLAGS_64
920 730 unset LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64
921 731 unset LD_LOADFLTR LD_LOADFLTR_32 LD_LOADFLTR_64
922 732 unset LD_NOAUDIT LD_NOAUDIT_32 LD_NOAUDIT_64
923 733 unset LD_NOAUXFLTR LD_NOAUXFLTR_32 LD_NOAUXFLTR_64
924 734 unset LD_NOCONFIG LD_NOCONFIG_32 LD_NOCONFIG_64
925 735 unset LD_NODIRCONFIG LD_NODIRCONFIG_32 LD_NODIRCONFIG_64
926 736 unset LD_NODIRECT LD_NODIRECT_32 LD_NODIRECT_64
927 737 unset LD_NOLAZYLOAD LD_NOLAZYLOAD_32 LD_NOLAZYLOAD_64
928 738 unset LD_NOOBJALTER LD_NOOBJALTER_32 LD_NOOBJALTER_64
929 739 unset LD_NOVERSION LD_NOVERSION_32 LD_NOVERSION_64
930 740 unset LD_ORIGIN LD_ORIGIN_32 LD_ORIGIN_64
931 741 unset LD_PRELOAD LD_PRELOAD_32 LD_PRELOAD_64
932 742 unset LD_PROFILE LD_PROFILE_32 LD_PROFILE_64
933 743
934 744 unset CONFIG
935 745 unset GROUP
936 746 unset OWNER
937 747 unset REMOTE
938 748 unset ENV
939 749 unset ARCH
940 750 unset CLASSPATH
941 751 unset NAME
942 752
943 753 #
944 754 # To get ONBLD_TOOLS from the environment, it must come from the env file.
945 755 # If it comes interactively, it is generally TOOLS_PROTO, which will be
946 756 # clobbered before the compiler version checks, which will therefore fail.
947 757 #
948 758 unset ONBLD_TOOLS
949 759
950 760 #
951 761 # Setup environmental variables
952 762 #
953 763 if [ -f /etc/nightly.conf ]; then
954 764 . /etc/nightly.conf
955 765 fi
956 766
957 767 if [ -f $1 ]; then
958 768 if [[ $1 = */* ]]; then
959 769 . $1
960 770 else
961 771 . ./$1
962 772 fi
963 773 else
964 774 if [ -f $OPTHOME/onbld/env/$1 ]; then
965 775 . $OPTHOME/onbld/env/$1
966 776 else
967 777 echo "Cannot find env file as either $1 or $OPTHOME/onbld/env/$1"
968 778 exit 1
969 779 fi
970 780 fi
971 781
972 782 # contents of stdenv.sh inserted after next line:
973 783 # STDENV_START
974 784 # STDENV_END
975 785
976 786 # Check if we have sufficient data to continue...
977 787 [[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
978 788 if [[ "${NIGHTLY_OPTIONS}" == ~(F)n ]] ; then
979 789 # Check if the gate data are valid if we don't do a "bringover" below
980 790 [[ -d "${CODEMGR_WS}" ]] || \
981 791 fatal_error "Error: ${CODEMGR_WS} is not a directory."
982 792 [[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || \
983 793 fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
984 794 fi
985 795
986 796 #
987 797 # place ourselves in a new task, respecting BUILD_PROJECT if set.
988 798 #
989 799 if [ -z "$BUILD_PROJECT" ]; then
990 800 /usr/bin/newtask -c $$
991 801 else
992 802 /usr/bin/newtask -c $$ -p $BUILD_PROJECT
993 803 fi
994 804
995 805 ps -o taskid= -p $$ | read build_taskid
996 806 ps -o project= -p $$ | read build_project
997 807
998 808 #
999 809 # See if NIGHTLY_OPTIONS is set
1000 810 #
1001 811 if [ "$NIGHTLY_OPTIONS" = "" ]; then
1002 812 NIGHTLY_OPTIONS="-aBm"
↓ open down ↓ |
132 lines elided |
↑ open up ↑ |
1003 813 fi
1004 814
1005 815 #
1006 816 # If BRINGOVER_WS was not specified, let it default to CLONE_WS
1007 817 #
1008 818 if [ "$BRINGOVER_WS" = "" ]; then
1009 819 BRINGOVER_WS=$CLONE_WS
1010 820 fi
1011 821
1012 822 #
1013 -# If CLOSED_BRINGOVER_WS was not specified, let it default to CLOSED_CLONE_WS
1014 -#
1015 -if [ "$CLOSED_BRINGOVER_WS" = "" ]; then
1016 - CLOSED_BRINGOVER_WS=$CLOSED_CLONE_WS
1017 -fi
1018 -
1019 -#
1020 823 # If BRINGOVER_FILES was not specified, default to usr
1021 824 #
1022 825 if [ "$BRINGOVER_FILES" = "" ]; then
1023 826 BRINGOVER_FILES="usr"
1024 827 fi
1025 828
1026 -check_closed_tree
829 +check_closed_bins
1027 830
1028 831 #
1029 832 # Note: changes to the option letters here should also be applied to the
1030 833 # bldenv script. `d' is listed for backward compatibility.
1031 834 #
1032 835 NIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-}
1033 836 OPTIND=1
1034 -while getopts +ABCDdFfGIilMmNnoPpRrTtUuWwXxz FLAG $NIGHTLY_OPTIONS
837 +while getopts +ABCDdFfGIilMmNnpRrtUuw FLAG $NIGHTLY_OPTIONS
1035 838 do
1036 839 case $FLAG in
1037 840 A ) A_FLAG=y
1038 841 ;;
1039 842 B ) D_FLAG=y
1040 843 ;; # old version of D
1041 844 C ) C_FLAG=y
1042 845 ;;
1043 846 D ) D_FLAG=y
1044 847 ;;
1045 848 F ) F_FLAG=y
1046 849 ;;
1047 850 f ) f_FLAG=y
1048 851 ;;
1049 852 G ) u_FLAG=y
1050 853 ;;
1051 854 I ) m_FLAG=y
1052 855 p_FLAG=y
1053 856 u_FLAG=y
1054 857 ;;
1055 858 i ) i_FLAG=y
1056 859 ;;
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
1057 860 l ) l_FLAG=y
1058 861 ;;
1059 862 M ) M_FLAG=y
1060 863 ;;
1061 864 m ) m_FLAG=y
1062 865 ;;
1063 866 N ) N_FLAG=y
1064 867 ;;
1065 868 n ) n_FLAG=y
1066 869 ;;
1067 - o ) o_FLAG=y
1068 - ;;
1069 - P ) P_FLAG=y
1070 - ;; # obsolete
1071 870 p ) p_FLAG=y
1072 871 ;;
1073 872 R ) m_FLAG=y
1074 873 p_FLAG=y
1075 874 ;;
1076 875 r ) r_FLAG=y
1077 876 ;;
1078 - T ) T_FLAG=y
1079 - ;; # obsolete
1080 877 +t ) t_FLAG=n
1081 878 ;;
1082 879 U ) if [ -z "${PARENT_ROOT}" ]; then
1083 880 echo "PARENT_ROOT must be set if the U flag is" \
1084 881 "present in NIGHTLY_OPTIONS."
1085 882 exit 1
1086 883 fi
1087 884 NIGHTLY_PARENT_ROOT=$PARENT_ROOT
1088 885 if [ -n "${PARENT_TOOLS_ROOT}" ]; then
1089 886 NIGHTLY_PARENT_TOOLS_ROOT=$PARENT_TOOLS_ROOT
1090 887 fi
1091 888 U_FLAG=y
1092 889 ;;
1093 890 u ) u_FLAG=y
1094 891 ;;
1095 - W ) W_FLAG=y
1096 - ;;
1097 -
1098 892 w ) w_FLAG=y
1099 893 ;;
1100 - X ) # now that we no longer need realmode builds, just
1101 - # copy IHV packages. only meaningful on x86.
1102 - if [ "$MACH" = "i386" ]; then
1103 - X_FLAG=y
1104 - fi
1105 - ;;
1106 - x ) XMOD_OPT="-x"
1107 - ;;
1108 894 \? ) echo "$USAGE"
1109 895 exit 1
1110 896 ;;
1111 897 esac
1112 898 done
1113 899
1114 900 if [ $ISUSER -ne 0 ]; then
1115 - if [ "$o_FLAG" = "y" ]; then
1116 - echo "Old-style build requires root permission."
1117 - exit 1
1118 - fi
1119 -
1120 901 # Set default value for STAFFER, if needed.
1121 902 if [ -z "$STAFFER" -o "$STAFFER" = "nobody" ]; then
1122 903 STAFFER=`/usr/xpg4/bin/id -un`
1123 904 export STAFFER
1124 905 fi
1125 906 fi
1126 907
1127 908 if [ -z "$MAILTO" -o "$MAILTO" = "nobody" ]; then
1128 909 MAILTO=$STAFFER
1129 910 export MAILTO
1130 911 fi
1131 912
1132 913 PATH="$OPTHOME/onbld/bin:$OPTHOME/onbld/bin/${MACH}:/usr/ccs/bin"
1133 -PATH="$PATH:$OPTHOME/SUNWspro/bin:$TEAMWARE/bin:/usr/bin:/usr/sbin:/usr/ucb"
914 +PATH="$PATH:$OPTHOME/SUNWspro/bin:/usr/bin:/usr/sbin:/usr/ucb"
1134 915 PATH="$PATH:/usr/openwin/bin:/usr/sfw/bin:/opt/sfw/bin:."
1135 916 export PATH
1136 917
1137 918 # roots of source trees, both relative to $SRC and absolute.
1138 919 relsrcdirs="."
1139 920 abssrcdirs="$SRC"
1140 921
1141 -unset CH
1142 -if [ "$o_FLAG" = "y" ]; then
1143 -# root invoked old-style build -- make sure it works as it always has
1144 -# by exporting 'CH'. The current Makefile.master doesn't use this, but
1145 -# the old ones still do.
1146 - PROTOCMPTERSE="protocmp.terse"
1147 - CH=
1148 - export CH
1149 -else
1150 - PROTOCMPTERSE="protocmp.terse -gu"
1151 -fi
922 +PROTOCMPTERSE="protocmp.terse -gu"
1152 923 POUND_SIGN="#"
1153 924 # have we set RELEASE_DATE in our env file?
1154 925 if [ -z "$RELEASE_DATE" ]; then
1155 926 RELEASE_DATE=$(LC_ALL=C date +"%B %Y")
1156 927 fi
1157 928 BUILD_DATE=$(LC_ALL=C date +%Y-%b-%d)
1158 929 BASEWSDIR=$(basename $CODEMGR_WS)
1159 930 DEV_CM="\"@(#)SunOS Internal Development: $LOGNAME $BUILD_DATE [$BASEWSDIR]\""
1160 931
1161 932 # we export POUND_SIGN, RELEASE_DATE and DEV_CM to speed up the build process
1162 -# by avoiding repeated shell invocations to evaluate Makefile.master definitions.
1163 -# we export o_FLAG and X_FLAG for use by makebfu, and by usr/src/pkg/Makefile
1164 -export o_FLAG X_FLAG POUND_SIGN RELEASE_DATE DEV_CM
933 +# by avoiding repeated shell invocations to evaluate Makefile.master
934 +# definitions.
935 +export POUND_SIGN RELEASE_DATE DEV_CM
1165 936
1166 937 maketype="distributed"
1167 938 if [[ -z "$MAKE" ]]; then
1168 939 MAKE=dmake
1169 940 elif [[ ! -x "$MAKE" ]]; then
1170 941 echo "\$MAKE is set to garbage in the environment"
1171 942 exit 1
1172 943 fi
1173 944 # get the dmake version string alone
1174 945 DMAKE_VERSION=$( $MAKE -v )
1175 946 DMAKE_VERSION=${DMAKE_VERSION#*: }
1176 947 # focus in on just the dotted version number alone
1177 948 DMAKE_MAJOR=$( echo $DMAKE_VERSION | \
1178 949 sed -e 's/.*\<\([^.]*\.[^ ]*\).*$/\1/' )
1179 950 # extract the second (or final) integer
1180 951 DMAKE_MINOR=${DMAKE_MAJOR#*.}
1181 952 DMAKE_MINOR=${DMAKE_MINOR%%.*}
1182 953 # extract the first integer
1183 954 DMAKE_MAJOR=${DMAKE_MAJOR%%.*}
1184 955 CHECK_DMAKE=${CHECK_DMAKE:-y}
1185 956 # x86 was built on the 12th, sparc on the 13th.
1186 957 if [ "$CHECK_DMAKE" = "y" -a \
1187 958 "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/12" -a \
1188 959 "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/13" -a \( \
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
1189 960 "$DMAKE_MAJOR" -lt 7 -o \
1190 961 "$DMAKE_MAJOR" -eq 7 -a "$DMAKE_MINOR" -lt 4 \) ]; then
1191 962 if [ -z "$DMAKE_VERSION" ]; then
1192 963 echo "$MAKE is missing."
1193 964 exit 1
1194 965 fi
1195 966 echo `whence $MAKE`" version is:"
1196 967 echo " ${DMAKE_VERSION}"
1197 968 cat <<EOF
1198 969
1199 -This version may not be safe for use. Either set TEAMWARE to a better
1200 -path or (if you really want to use this version of dmake anyway), add
1201 -the following to your environment to disable this check:
970 +This version may not be safe for use, if you really want to use this version
971 +anyway add the following to your environment to disable this check:
1202 972
1203 973 CHECK_DMAKE=n
1204 974 EOF
1205 975 exit 1
1206 976 fi
1207 977 export PATH
1208 978 export MAKE
1209 979
1210 980 if [ "${SUNWSPRO}" != "" ]; then
1211 981 PATH="${SUNWSPRO}/bin:$PATH"
1212 982 export PATH
1213 983 fi
1214 984
1215 985 hostname=$(uname -n)
1216 986 if [[ $DMAKE_MAX_JOBS != +([0-9]) || $DMAKE_MAX_JOBS -eq 0 ]]
1217 987 then
1218 988 maxjobs=
1219 989 if [[ -f $HOME/.make.machines ]]
1220 990 then
1221 991 # Note: there is a hard tab and space character in the []s
1222 992 # below.
1223 993 egrep -i "^[ ]*$hostname[ \.]" \
1224 994 $HOME/.make.machines | read host jobs
1225 995 maxjobs=${jobs##*=}
1226 996 fi
1227 997
1228 998 if [[ $maxjobs != +([0-9]) || $maxjobs -eq 0 ]]
1229 999 then
1230 1000 # default
1231 1001 maxjobs=4
1232 1002 fi
1233 1003
1234 1004 export DMAKE_MAX_JOBS=$maxjobs
1235 1005 fi
1236 1006
1237 1007 DMAKE_MODE=parallel;
1238 1008 export DMAKE_MODE
1239 1009
1240 1010 if [ -z "${ROOT}" ]; then
1241 1011 echo "ROOT must be set."
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
1242 1012 exit 1
1243 1013 fi
1244 1014
1245 1015 #
1246 1016 # if -V flag was given, reset VERSION to V_ARG
1247 1017 #
1248 1018 if [ "$V_FLAG" = "y" ]; then
1249 1019 VERSION=$V_ARG
1250 1020 fi
1251 1021
1252 -#
1253 -# Check for IHV root for copying ihv proto area
1254 -#
1255 -if [ "$X_FLAG" = "y" ]; then
1256 - if [ "$IA32_IHV_ROOT" = "" ]; then
1257 - echo "IA32_IHV_ROOT: must be set for copying ihv proto"
1258 - args_ok=n
1259 - fi
1260 - if [ ! -d "$IA32_IHV_ROOT" ]; then
1261 - echo "$IA32_IHV_ROOT: not found"
1262 - args_ok=n
1263 - fi
1264 - if [ "$IA32_IHV_WS" = "" ]; then
1265 - echo "IA32_IHV_WS: must be set for copying ihv proto"
1266 - args_ok=n
1267 - fi
1268 - if [ ! -d "$IA32_IHV_WS" ]; then
1269 - echo "$IA32_IHV_WS: not found"
1270 - args_ok=n
1271 - fi
1272 -fi
1273 -
1274 1022 TMPDIR="/tmp/nightly.tmpdir.$$"
1275 1023 export TMPDIR
1276 1024 rm -rf ${TMPDIR}
1277 1025 mkdir -p $TMPDIR || exit 1
1278 1026 chmod 777 $TMPDIR
1279 1027
1280 1028 #
1281 1029 # Keep elfsign's use of pkcs11_softtoken from looking in the user home
1282 1030 # directory, which doesn't always work. Needed until all build machines
1283 1031 # have the fix for 6271754
1284 1032 #
1285 1033 SOFTTOKEN_DIR=$TMPDIR
1286 1034 export SOFTTOKEN_DIR
1287 1035
1288 1036 #
1289 1037 # Tools should only be built non-DEBUG. Keep track of the tools proto
1290 1038 # area path relative to $TOOLS, because the latter changes in an
1291 1039 # export build.
1292 1040 #
1293 1041 # TOOLS_PROTO is included below for builds other than usr/src/tools
1294 1042 # that look for this location. For usr/src/tools, this will be
1295 1043 # overridden on the $MAKE command line in build_tools().
1296 1044 #
1297 1045 TOOLS=${SRC}/tools
1298 1046 TOOLS_PROTO_REL=proto/root_${MACH}-nd
1299 1047 TOOLS_PROTO=${TOOLS}/${TOOLS_PROTO_REL}; export TOOLS_PROTO
1300 1048
1301 1049 unset CFLAGS LD_LIBRARY_PATH LDFLAGS
1302 1050
1303 1051 # create directories that are automatically removed if the nightly script
1304 1052 # fails to start correctly
1305 1053 function newdir {
1306 1054 dir=$1
1307 1055 toadd=
1308 1056 while [ ! -d $dir ]; do
1309 1057 toadd="$dir $toadd"
1310 1058 dir=`dirname $dir`
1311 1059 done
1312 1060 torm=
1313 1061 newlist=
1314 1062 for dir in $toadd; do
1315 1063 if staffer mkdir $dir; then
1316 1064 newlist="$ISUSER $dir $newlist"
1317 1065 torm="$dir $torm"
1318 1066 else
1319 1067 [ -z "$torm" ] || staffer rmdir $torm
1320 1068 return 1
1321 1069 fi
1322 1070 done
1323 1071 newdirlist="$newlist $newdirlist"
1324 1072 return 0
1325 1073 }
1326 1074 newdirlist=
1327 1075
1328 1076 [ -d $CODEMGR_WS ] || newdir $CODEMGR_WS || exit 1
1329 1077
1330 1078 # since this script assumes the build is from full source, it nullifies
1331 1079 # variables likely to have been set by a "ws" script; nullification
1332 1080 # confines the search space for headers and libraries to the proto area
1333 1081 # built from this immediate source.
1334 1082 ENVLDLIBS1=
1335 1083 ENVLDLIBS2=
1336 1084 ENVLDLIBS3=
↓ open down ↓ |
53 lines elided |
↑ open up ↑ |
1337 1085 ENVCPPFLAGS1=
1338 1086 ENVCPPFLAGS2=
1339 1087 ENVCPPFLAGS3=
1340 1088 ENVCPPFLAGS4=
1341 1089 PARENT_ROOT=
1342 1090
1343 1091 export ENVLDLIBS3 ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 ENVCPPFLAGS4 \
1344 1092 ENVLDLIBS1 ENVLDLIBS2 PARENT_ROOT
1345 1093
1346 1094 PKGARCHIVE_ORIG=$PKGARCHIVE
1347 -IA32_IHV_PKGS_ORIG=$IA32_IHV_PKGS
1348 1095
1349 1096 #
1350 1097 # Juggle the logs and optionally send mail on completion.
1351 1098 #
1352 1099
1353 1100 function logshuffle {
1354 1101 LLOG="$ATLOG/log.`date '+%F.%H:%M'`"
1355 1102 if [ -f $LLOG -o -d $LLOG ]; then
1356 1103 LLOG=$LLOG.$$
1357 1104 fi
1358 1105 mkdir $LLOG
1359 1106 export LLOG
1360 1107
1361 1108 if [ "$build_ok" = "y" ]; then
1362 1109 mv $ATLOG/proto_list_${MACH} $LLOG
1363 1110
1364 1111 if [ -f $ATLOG/proto_list_tools_${MACH} ]; then
1365 1112 mv $ATLOG/proto_list_tools_${MACH} $LLOG
1366 1113 fi
1367 1114
1368 1115 if [ -f $TMPDIR/wsdiff.results ]; then
1369 1116 mv $TMPDIR/wsdiff.results $LLOG
1370 1117 fi
1371 1118
1372 1119 if [ -f $TMPDIR/wsdiff-nd.results ]; then
1373 1120 mv $TMPDIR/wsdiff-nd.results $LLOG
1374 1121 fi
1375 1122 fi
1376 1123
1377 1124 #
1378 1125 # Now that we're about to send mail, it's time to check the noise
1379 1126 # file. In the event that an error occurs beyond this point, it will
1380 1127 # be recorded in the nightly.log file, but nowhere else. This would
1381 1128 # include only errors that cause the copying of the noise log to fail
1382 1129 # or the mail itself not to be sent.
1383 1130 #
1384 1131
1385 1132 exec >>$LOGFILE 2>&1
1386 1133 if [ -s $build_noise_file ]; then
1387 1134 echo "\n==== Nightly build noise ====\n" |
1388 1135 tee -a $LOGFILE >>$mail_msg_file
1389 1136 cat $build_noise_file >>$LOGFILE
1390 1137 cat $build_noise_file >>$mail_msg_file
1391 1138 echo | tee -a $LOGFILE >>$mail_msg_file
1392 1139 fi
1393 1140 rm -f $build_noise_file
1394 1141
1395 1142 case "$build_ok" in
1396 1143 y)
1397 1144 state=Completed
1398 1145 ;;
1399 1146 i)
1400 1147 state=Interrupted
1401 1148 ;;
1402 1149 *)
1403 1150 state=Failed
1404 1151 ;;
1405 1152 esac
1406 1153 NIGHTLY_STATUS=$state
1407 1154 export NIGHTLY_STATUS
1408 1155
1409 1156 run_hook POST_NIGHTLY $state
1410 1157 run_hook SYS_POST_NIGHTLY $state
1411 1158
1412 1159 #
1413 1160 # mailx(1) sets From: based on the -r flag
1414 1161 # if it is given.
1415 1162 #
1416 1163 mailx_r=
1417 1164 if [[ -n "${MAILFROM}" ]]; then
1418 1165 mailx_r="-r ${MAILFROM}"
1419 1166 fi
1420 1167
1421 1168 cat $build_time_file $build_environ_file $mail_msg_file \
1422 1169 > ${LLOG}/mail_msg
1423 1170 if [ "$m_FLAG" = "y" ]; then
1424 1171 cat ${LLOG}/mail_msg | /usr/bin/mailx ${mailx_r} -s \
1425 1172 "Nightly ${MACH} Build of `basename ${CODEMGR_WS}` ${state}." \
1426 1173 ${MAILTO}
1427 1174 fi
1428 1175
1429 1176 if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
1430 1177 staffer cp ${LLOG}/mail_msg $PARENT_WS/usr/src/mail_msg-${MACH}
1431 1178 staffer cp $LOGFILE $PARENT_WS/usr/src/nightly-${MACH}.log
1432 1179 fi
1433 1180
1434 1181 mv $LOGFILE $LLOG
1435 1182 }
1436 1183
1437 1184 #
1438 1185 # Remove the locks and temporary files on any exit
1439 1186 #
1440 1187 function cleanup {
1441 1188 logshuffle
1442 1189
1443 1190 [ -z "$lockfile" ] || staffer rm -f $lockfile
1444 1191 [ -z "$atloglockfile" ] || rm -f $atloglockfile
1445 1192 [ -z "$ulockfile" ] || staffer rm -f $ulockfile
1446 1193 [ -z "$Ulockfile" ] || rm -f $Ulockfile
1447 1194
1448 1195 set -- $newdirlist
1449 1196 while [ $# -gt 0 ]; do
1450 1197 ISUSER=$1 staffer rmdir $2
1451 1198 shift; shift
1452 1199 done
1453 1200 rm -rf $TMPDIR
1454 1201 }
1455 1202
1456 1203 function cleanup_signal {
1457 1204 build_ok=i
1458 1205 # this will trigger cleanup(), above.
1459 1206 exit 1
1460 1207 }
1461 1208
1462 1209 trap cleanup 0
1463 1210 trap cleanup_signal 1 2 3 15
1464 1211
1465 1212 #
1466 1213 # Generic lock file processing -- make sure that the lock file doesn't
1467 1214 # exist. If it does, it should name the build host and PID. If it
1468 1215 # doesn't, then make sure we can create it. Clean up locks that are
1469 1216 # known to be stale (assumes host name is unique among build systems
1470 1217 # for the workspace).
1471 1218 #
1472 1219 function create_lock {
1473 1220 lockf=$1
1474 1221 lockvar=$2
1475 1222
1476 1223 ldir=`dirname $lockf`
1477 1224 [ -d $ldir ] || newdir $ldir || exit 1
1478 1225 eval $lockvar=$lockf
1479 1226
1480 1227 while ! staffer ln -s $hostname.$STAFFER.$$ $lockf 2> /dev/null; do
1481 1228 basews=`basename $CODEMGR_WS`
1482 1229 ls -l $lockf | nawk '{print $NF}' | IFS=. read host user pid
1483 1230 if [ "$host" != "$hostname" ]; then
1484 1231 echo "$MACH build of $basews apparently" \
1485 1232 "already started by $user on $host as $pid."
1486 1233 exit 1
1487 1234 elif kill -s 0 $pid 2>/dev/null; then
1488 1235 echo "$MACH build of $basews already started" \
1489 1236 "by $user as $pid."
1490 1237 exit 1
1491 1238 else
1492 1239 # stale lock; clear it out and try again
1493 1240 rm -f $lockf
1494 1241 fi
1495 1242 done
1496 1243 }
1497 1244
1498 1245 #
1499 1246 # Return the list of interesting proto areas, depending on the current
1500 1247 # options.
1501 1248 #
1502 1249 function allprotos {
1503 1250 typeset roots="$ROOT"
1504 1251
1505 1252 if [[ "$F_FLAG" = n && "$MULTI_PROTO" = yes ]]; then
1506 1253 roots="$roots $ROOT-nd"
1507 1254 fi
1508 1255
1509 1256 echo $roots
1510 1257 }
1511 1258
1512 1259 # Ensure no other instance of this script is running on this host.
1513 1260 # LOCKNAME can be set in <env_file>, and is by default, but is not
1514 1261 # required due to the use of $ATLOG below.
1515 1262 if [ -n "$LOCKNAME" ]; then
1516 1263 create_lock /tmp/$LOCKNAME "lockfile"
1517 1264 fi
1518 1265 #
1519 1266 # Create from one, two, or three other locks:
1520 1267 # $ATLOG/nightly.lock
1521 1268 # - protects against multiple builds in same workspace
1522 1269 # $PARENT_WS/usr/src/nightly.$MACH.lock
1523 1270 # - protects against multiple 'u' copy-backs
1524 1271 # $NIGHTLY_PARENT_ROOT/nightly.lock
1525 1272 # - protects against multiple 'U' copy-backs
1526 1273 #
1527 1274 # Overriding ISUSER to 1 causes the lock to be created as root if the
1528 1275 # script is run as root. The default is to create it as $STAFFER.
1529 1276 ISUSER=1 create_lock $ATLOG/nightly.lock "atloglockfile"
1530 1277 if [ "$u_FLAG" = "y" ]; then
1531 1278 create_lock $PARENT_WS/usr/src/nightly.$MACH.lock "ulockfile"
1532 1279 fi
1533 1280 if [ "$U_FLAG" = "y" ]; then
1534 1281 # NIGHTLY_PARENT_ROOT is written as root if script invoked as root.
1535 1282 ISUSER=1 create_lock $NIGHTLY_PARENT_ROOT/nightly.lock "Ulockfile"
1536 1283 fi
1537 1284
1538 1285 # Locks have been taken, so we're doing a build and we're committed to
1539 1286 # the directories we may have created so far.
1540 1287 newdirlist=
1541 1288
1542 1289 #
1543 1290 # Create mail_msg_file
1544 1291 #
1545 1292 mail_msg_file="${TMPDIR}/mail_msg"
1546 1293 touch $mail_msg_file
1547 1294 build_time_file="${TMPDIR}/build_time"
1548 1295 build_environ_file="${TMPDIR}/build_environ"
1549 1296 touch $build_environ_file
1550 1297 #
1551 1298 # Move old LOGFILE aside
1552 1299 # ATLOG directory already made by 'create_lock' above
1553 1300 #
1554 1301 if [ -f $LOGFILE ]; then
1555 1302 mv -f $LOGFILE ${LOGFILE}-
1556 1303 fi
1557 1304 #
1558 1305 # Build OsNet source
1559 1306 #
1560 1307 START_DATE=`date`
1561 1308 SECONDS=0
1562 1309 echo "\n==== Nightly $maketype build started: $START_DATE ====" \
1563 1310 | tee -a $LOGFILE > $build_time_file
1564 1311
1565 1312 echo "\nBuild project: $build_project\nBuild taskid: $build_taskid" | \
1566 1313 tee -a $mail_msg_file >> $LOGFILE
1567 1314
1568 1315 # make sure we log only to the nightly build file
1569 1316 build_noise_file="${TMPDIR}/build_noise"
↓ open down ↓ |
212 lines elided |
↑ open up ↑ |
1570 1317 exec </dev/null >$build_noise_file 2>&1
1571 1318
1572 1319 run_hook SYS_PRE_NIGHTLY
1573 1320 run_hook PRE_NIGHTLY
1574 1321
1575 1322 echo "\n==== list of environment variables ====\n" >> $LOGFILE
1576 1323 env >> $LOGFILE
1577 1324
1578 1325 echo "\n==== Nightly argument issues ====\n" | tee -a $mail_msg_file >> $LOGFILE
1579 1326
1580 -if [ "$P_FLAG" = "y" ]; then
1581 - obsolete_build GPROF | tee -a $mail_msg_file >> $LOGFILE
1582 -fi
1583 -
1584 -if [ "$T_FLAG" = "y" ]; then
1585 - obsolete_build TRACE | tee -a $mail_msg_file >> $LOGFILE
1586 -fi
1587 -
1588 1327 if [ "$N_FLAG" = "y" ]; then
1589 1328 if [ "$p_FLAG" = "y" ]; then
1590 1329 cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
1591 1330 WARNING: the p option (create packages) is set, but so is the N option (do
1592 1331 not run protocmp); this is dangerous; you should unset the N option
1593 1332 EOF
1594 1333 else
1595 1334 cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
1596 1335 Warning: the N option (do not run protocmp) is set; it probably shouldn't be
1597 1336 EOF
1598 1337 fi
1599 1338 echo "" | tee -a $mail_msg_file >> $LOGFILE
1600 1339 fi
1601 1340
1602 1341 if [ "$D_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
1603 1342 #
1604 1343 # In the past we just complained but went ahead with the lint
1605 1344 # pass, even though the proto area was built non-DEBUG. It's
1606 1345 # unlikely that non-DEBUG headers will make a difference, but
1607 1346 # rather than assuming it's a safe combination, force the user
1608 1347 # to specify a DEBUG build.
1609 1348 #
1610 1349 echo "WARNING: DEBUG build not requested; disabling lint.\n" \
1611 1350 | tee -a $mail_msg_file >> $LOGFILE
1612 1351 l_FLAG=n
1613 1352 fi
1614 1353
1615 1354 if [ "$f_FLAG" = "y" ]; then
1616 1355 if [ "$i_FLAG" = "y" ]; then
1617 1356 echo "WARNING: the -f flag cannot be used during incremental" \
1618 1357 "builds; ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
1619 1358 f_FLAG=n
1620 1359 fi
1621 1360 if [ "${l_FLAG}${p_FLAG}" != "yy" ]; then
1622 1361 echo "WARNING: the -f flag requires -l, and -p;" \
1623 1362 "ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
1624 1363 f_FLAG=n
1625 1364 fi
1626 1365 fi
1627 1366
1628 1367 if [ "$w_FLAG" = "y" -a ! -d $ROOT ]; then
1629 1368 echo "WARNING: -w specified, but $ROOT does not exist;" \
1630 1369 "ignoring -w\n" | tee -a $mail_msg_file >> $LOGFILE
1631 1370 w_FLAG=n
1632 1371 fi
1633 1372
1634 1373 if [ "$t_FLAG" = "n" ]; then
1635 1374 #
1636 1375 # We're not doing a tools build, so make sure elfsign(1) is
1637 1376 # new enough to safely sign non-crypto binaries. We test
1638 1377 # debugging output from elfsign to detect the old version.
1639 1378 #
1640 1379 newelfsigntest=`SUNW_CRYPTO_DEBUG=stderr /usr/bin/elfsign verify \
1641 1380 -e /usr/lib/security/pkcs11_softtoken.so.1 2>&1 \
1642 1381 | egrep algorithmOID`
1643 1382 if [ -z "$newelfsigntest" ]; then
1644 1383 echo "WARNING: /usr/bin/elfsign out of date;" \
1645 1384 "will only sign crypto modules\n" | \
1646 1385 tee -a $mail_msg_file >> $LOGFILE
1647 1386 export ELFSIGN_OBJECT=true
1648 1387 elif [ "$VERIFY_ELFSIGN" = "y" ]; then
1649 1388 echo "WARNING: VERIFY_ELFSIGN=y requires" \
1650 1389 "the -t flag; ignoring VERIFY_ELFSIGN\n" | \
1651 1390 tee -a $mail_msg_file >> $LOGFILE
1652 1391 fi
1653 1392 fi
1654 1393
1655 1394 case $MULTI_PROTO in
1656 1395 yes|no) ;;
1657 1396 *)
1658 1397 echo "WARNING: MULTI_PROTO is \"$MULTI_PROTO\"; " \
1659 1398 "should be \"yes\" or \"no\"." | tee -a $mail_msg_file >> $LOGFILE
1660 1399 echo "Setting MULTI_PROTO to \"no\".\n" | \
1661 1400 tee -a $mail_msg_file >> $LOGFILE
1662 1401 export MULTI_PROTO=no
1663 1402 ;;
1664 1403 esac
1665 1404
1666 1405 echo "\n==== Build version ====\n" | tee -a $mail_msg_file >> $LOGFILE
1667 1406 echo $VERSION | tee -a $mail_msg_file >> $LOGFILE
1668 1407
1669 1408 # Save the current proto area if we're comparing against the last build
1670 1409 if [ "$w_FLAG" = "y" -a -d "$ROOT" ]; then
1671 1410 if [ -d "$ROOT.prev" ]; then
1672 1411 rm -rf $ROOT.prev
1673 1412 fi
1674 1413 mv $ROOT $ROOT.prev
1675 1414 fi
1676 1415
1677 1416 # Same for non-DEBUG proto area
1678 1417 if [ "$w_FLAG" = "y" -a "$MULTI_PROTO" = yes -a -d "$ROOT-nd" ]; then
1679 1418 if [ -d "$ROOT-nd.prev" ]; then
1680 1419 rm -rf $ROOT-nd.prev
1681 1420 fi
1682 1421 mv $ROOT-nd $ROOT-nd.prev
1683 1422 fi
1684 1423
1685 1424 #
↓ open down ↓ |
88 lines elided |
↑ open up ↑ |
1686 1425 # Echo the SCM type of the parent workspace, this can't just be which_scm
1687 1426 # as that does not know how to identify various network repositories.
1688 1427 #
1689 1428 function parent_wstype {
1690 1429 typeset scm_type junk
1691 1430
1692 1431 CODEMGR_WS="$BRINGOVER_WS" "$WHICH_SCM" 2>/dev/null \
1693 1432 | read scm_type junk
1694 1433 if [[ -z "$scm_type" || "$scm_type" == unknown ]]; then
1695 1434 # Probe BRINGOVER_WS to determine its type
1696 - if [[ $BRINGOVER_WS == svn*://* ]]; then
1697 - scm_type="subversion"
1698 - elif [[ $BRINGOVER_WS == file://* ]] &&
1699 - egrep -s "This is a Subversion repository" \
1700 - ${BRINGOVER_WS#file://}/README.txt 2> /dev/null; then
1701 - scm_type="subversion"
1702 - elif [[ $BRINGOVER_WS == ssh://* ]]; then
1435 + if [[ $BRINGOVER_WS == ssh://* ]]; then
1703 1436 scm_type="mercurial"
1704 1437 elif [[ $BRINGOVER_WS == http://* ]] && \
1705 1438 wget -q -O- --save-headers "$BRINGOVER_WS/?cmd=heads" | \
1706 1439 egrep -s "application/mercurial" 2> /dev/null; then
1707 1440 scm_type="mercurial"
1708 - elif svn info $BRINGOVER_WS > /dev/null 2>&1; then
1709 - scm_type="subversion"
1710 1441 else
1711 1442 scm_type="none"
1712 1443 fi
1713 1444 fi
1714 1445
1715 1446 # fold both unsupported and unrecognized results into "none"
1716 1447 case "$scm_type" in
1717 - none|subversion|teamware|mercurial)
1448 + mercurial)
1718 1449 ;;
1719 1450 *) scm_type=none
1720 1451 ;;
1721 1452 esac
1722 1453
1723 1454 echo $scm_type
1724 1455 }
1725 1456
1726 1457 # Echo the SCM types of $CODEMGR_WS and $BRINGOVER_WS
1727 1458 function child_wstype {
1728 1459 typeset scm_type junk
1729 1460
1730 1461 # Probe CODEMGR_WS to determine its type
1731 1462 if [[ -d $CODEMGR_WS ]]; then
1732 1463 $WHICH_SCM | read scm_type junk || exit 1
1733 1464 fi
1734 1465
1735 1466 case "$scm_type" in
1736 - none|subversion|git|teamware|mercurial)
1467 + none|git|mercurial)
1737 1468 ;;
1738 1469 *) scm_type=none
1739 1470 ;;
1740 1471 esac
1741 1472
1742 1473 echo $scm_type
1743 1474 }
1744 1475
1745 1476 SCM_TYPE=$(child_wstype)
1746 1477
1747 1478 #
1748 1479 # Decide whether to clobber
1749 1480 #
1750 1481 if [ "$i_FLAG" = "n" -a -d "$SRC" ]; then
1751 1482 echo "\n==== Make clobber at `date` ====\n" >> $LOGFILE
1752 1483
1753 1484 cd $SRC
1754 1485 # remove old clobber file
1755 1486 rm -f $SRC/clobber.out
1756 1487 rm -f $SRC/clobber-${MACH}.out
1757 1488
1758 1489 # Remove all .make.state* files, just in case we are restarting
1759 1490 # the build after having interrupted a previous 'make clobber'.
1760 1491 find . \( -name SCCS -o -name .hg -o -name .svn -o -name .git \
1761 1492 -o -name 'interfaces.*' \) -prune \
1762 1493 -o -name '.make.*' -print | xargs rm -f
1763 1494
1764 1495 $MAKE -ek clobber 2>&1 | tee -a $SRC/clobber-${MACH}.out >> $LOGFILE
1765 1496 echo "\n==== Make clobber ERRORS ====\n" >> $mail_msg_file
1766 1497 grep "$MAKE:" $SRC/clobber-${MACH}.out |
1767 1498 egrep -v "Ignoring unknown host" \
1768 1499 >> $mail_msg_file
1769 1500
1770 1501 if [[ "$t_FLAG" = "y" ]]; then
1771 1502 echo "\n==== Make tools clobber at `date` ====\n" >> $LOGFILE
1772 1503 cd ${TOOLS}
1773 1504 rm -f ${TOOLS}/clobber-${MACH}.out
1774 1505 $MAKE TOOLS_PROTO=$TOOLS_PROTO -ek clobber 2>&1 | \
1775 1506 tee -a ${TOOLS}/clobber-${MACH}.out >> $LOGFILE
1776 1507 echo "\n==== Make tools clobber ERRORS ====\n" \
1777 1508 >> $mail_msg_file
1778 1509 grep "$MAKE:" ${TOOLS}/clobber-${MACH}.out \
1779 1510 >> $mail_msg_file
1780 1511 rm -rf ${TOOLS_PROTO}
1781 1512 mkdir -p ${TOOLS_PROTO}
1782 1513 fi
1783 1514
1784 1515 typeset roots=$(allprotos)
1785 1516 echo "\n\nClearing $roots" >> "$LOGFILE"
1786 1517 rm -rf $roots
1787 1518
1788 1519 # Get back to a clean workspace as much as possible to catch
1789 1520 # problems that only occur on fresh workspaces.
1790 1521 # Remove all .make.state* files, libraries, and .o's that may
1791 1522 # have been omitted from clobber. A couple of libraries are
1792 1523 # under source code control, so leave them alone.
1793 1524 # We should probably blow away temporary directories too.
↓ open down ↓ |
47 lines elided |
↑ open up ↑ |
1794 1525 cd $SRC
1795 1526 find $relsrcdirs \( -name SCCS -o -name .hg -o -name .svn \
1796 1527 -o -name .git -o -name 'interfaces.*' \) -prune -o \
1797 1528 \( -name '.make.*' -o -name 'lib*.a' -o -name 'lib*.so*' -o \
1798 1529 -name '*.o' \) -print | \
1799 1530 grep -v 'tools/ctf/dwarf/.*/libdwarf' | xargs rm -f
1800 1531 else
1801 1532 echo "\n==== No clobber at `date` ====\n" >> $LOGFILE
1802 1533 fi
1803 1534
1804 -type bringover_teamware > /dev/null 2>&1 || function bringover_teamware {
1805 - # sleep on the parent workspace's lock
1806 - while egrep -s write $BRINGOVER_WS/Codemgr_wsdata/locks
1807 - do
1808 - sleep 120
1809 - done
1810 -
1811 - if [[ -z $BRINGOVER ]]; then
1812 - BRINGOVER=$TEAMWARE/bin/bringover
1813 - fi
1814 -
1815 - staffer $BRINGOVER -c "nightly update" -p $BRINGOVER_WS \
1816 - -w $CODEMGR_WS $BRINGOVER_FILES < /dev/null 2>&1 ||
1817 - touch $TMPDIR/bringover_failed
1818 -
1819 - staffer bringovercheck $CODEMGR_WS >$TMPDIR/bringovercheck.out 2>&1
1820 - if [ -s $TMPDIR/bringovercheck.out ]; then
1821 - echo "\n==== POST-BRINGOVER CLEANUP NOISE ====\n"
1822 - cat $TMPDIR/bringovercheck.out
1823 - fi
1824 -}
1825 -
1826 1535 type bringover_mercurial > /dev/null 2>&1 || function bringover_mercurial {
1827 1536 typeset -x PATH=$PATH
1828 1537
1829 1538 # If the repository doesn't exist yet, then we want to populate it.
1830 1539 if [[ ! -d $CODEMGR_WS/.hg ]]; then
1831 1540 staffer hg init $CODEMGR_WS
1832 1541 staffer echo "[paths]" > $CODEMGR_WS/.hg/hgrc
1833 1542 staffer echo "default=$BRINGOVER_WS" >> $CODEMGR_WS/.hg/hgrc
1834 1543 touch $TMPDIR/new_repository
1835 1544 fi
1836 1545
1837 1546 typeset -x HGMERGE="/bin/false"
1838 1547
1839 1548 #
1840 1549 # If the user has changes, regardless of whether those changes are
1841 1550 # committed, and regardless of whether those changes conflict, then
1842 1551 # we'll attempt to merge them either implicitly (uncommitted) or
1843 1552 # explicitly (committed).
1844 1553 #
1845 1554 # These are the messages we'll use to help clarify mercurial output
1846 1555 # in those cases.
1847 1556 #
1848 1557 typeset mergefailmsg="\
1849 1558 ***\n\
1850 1559 *** nightly was unable to automatically merge your changes. You should\n\
1851 1560 *** redo the full merge manually, following the steps outlined by mercurial\n\
1852 1561 *** above, then restart nightly.\n\
1853 1562 ***\n"
1854 1563 typeset mergepassmsg="\
1855 1564 ***\n\
1856 1565 *** nightly successfully merged your changes. This means that your working\n\
1857 1566 *** directory has been updated, but those changes are not yet committed.\n\
1858 1567 *** After nightly completes, you should validate the results of the merge,\n\
1859 1568 *** then use hg commit manually.\n\
1860 1569 ***\n"
1861 1570
1862 1571 #
1863 1572 # For each repository in turn:
1864 1573 #
1865 1574 # 1. Do the pull. If this fails, dump the output and bail out.
1866 1575 #
1867 1576 # 2. If the pull resulted in an extra head, do an explicit merge.
1868 1577 # If this fails, dump the output and bail out.
1869 1578 #
1870 1579 # Because we can't rely on Mercurial to exit with a failure code
1871 1580 # when a merge fails (Mercurial issue #186), we must grep the
1872 1581 # output of pull/merge to check for attempted and/or failed merges.
1873 1582 #
1874 1583 # 3. If a merge failed, set the message and fail the bringover.
1875 1584 #
1876 1585 # 4. Otherwise, if a merge succeeded, set the message
1877 1586 #
1878 1587 # 5. Dump the output, and any message from step 3 or 4.
1879 1588 #
1880 1589
1881 1590 typeset HG_SOURCE=$BRINGOVER_WS
1882 1591 if [ ! -f $TMPDIR/new_repository ]; then
1883 1592 HG_SOURCE=$TMPDIR/open_bundle.hg
1884 1593 staffer hg --cwd $CODEMGR_WS incoming --bundle $HG_SOURCE \
1885 1594 -v $BRINGOVER_WS > $TMPDIR/incoming_open.out
1886 1595
1887 1596 #
1888 1597 # If there are no incoming changesets, then incoming will
1889 1598 # fail, and there will be no bundle file. Reset the source,
1890 1599 # to allow the remaining logic to complete with no false
1891 1600 # negatives. (Unlike incoming, pull will return success
1892 1601 # for the no-change case.)
1893 1602 #
1894 1603 if (( $? != 0 )); then
1895 1604 HG_SOURCE=$BRINGOVER_WS
1896 1605 fi
1897 1606 fi
1898 1607
1899 1608 staffer hg --cwd $CODEMGR_WS pull -u $HG_SOURCE \
1900 1609 > $TMPDIR/pull_open.out 2>&1
1901 1610 if (( $? != 0 )); then
1902 1611 printf "%s: pull failed as follows:\n\n" "$CODEMGR_WS"
1903 1612 cat $TMPDIR/pull_open.out
1904 1613 if grep "^merging.*failed" $TMPDIR/pull_open.out > /dev/null 2>&1; then
1905 1614 printf "$mergefailmsg"
1906 1615 fi
1907 1616 touch $TMPDIR/bringover_failed
1908 1617 return
1909 1618 fi
1910 1619
1911 1620 if grep "not updating" $TMPDIR/pull_open.out > /dev/null 2>&1; then
1912 1621 staffer hg --cwd $CODEMGR_WS merge \
1913 1622 >> $TMPDIR/pull_open.out 2>&1
1914 1623 if (( $? != 0 )); then
1915 1624 printf "%s: merge failed as follows:\n\n" \
1916 1625 "$CODEMGR_WS"
1917 1626 cat $TMPDIR/pull_open.out
1918 1627 if grep "^merging.*failed" $TMPDIR/pull_open.out \
1919 1628 > /dev/null 2>&1; then
1920 1629 printf "$mergefailmsg"
1921 1630 fi
1922 1631 touch $TMPDIR/bringover_failed
1923 1632 return
1924 1633 fi
1925 1634 fi
1926 1635
1927 1636 printf "updated %s with the following results:\n" "$CODEMGR_WS"
1928 1637 cat $TMPDIR/pull_open.out
1929 1638 if grep "^merging" $TMPDIR/pull_open.out >/dev/null 2>&1; then
1930 1639 printf "$mergepassmsg"
1931 1640 fi
1932 1641 printf "\n"
1933 1642
↓ open down ↓ |
98 lines elided |
↑ open up ↑ |
1934 1643 #
1935 1644 # Per-changeset output is neither useful nor manageable for a
1936 1645 # newly-created repository.
1937 1646 #
1938 1647 if [ -f $TMPDIR/new_repository ]; then
1939 1648 return
1940 1649 fi
1941 1650
1942 1651 printf "\nadded the following changesets to open repository:\n"
1943 1652 cat $TMPDIR/incoming_open.out
1944 -
1945 - #
1946 - # The closed repository could have been newly created, even though
1947 - # the open one previously existed...
1948 - #
1949 - if [ -f $TMPDIR/new_closed ]; then
1950 - return
1951 - fi
1952 -
1953 - if [ -f $TMPDIR/incoming_closed.out ]; then
1954 - printf "\nadded the following changesets to closed repository:\n"
1955 - cat $TMPDIR/incoming_closed.out
1956 - fi
1957 -}
1958 -
1959 -type bringover_subversion > /dev/null 2>&1 || function bringover_subversion {
1960 - typeset -x PATH=$PATH
1961 -
1962 - if [[ ! -d $CODEMGR_WS/.svn ]]; then
1963 - staffer svn checkout $BRINGOVER_WS $CODEMGR_WS ||
1964 - touch $TMPDIR/bringover_failed
1965 - else
1966 - typeset root
1967 - root=$(staffer svn info $CODEMGR_WS |
1968 - nawk '/^Repository Root:/ {print $NF}')
1969 - if [[ $root != $BRINGOVER_WS ]]; then
1970 - # We fail here because there's no way to update
1971 - # from a named repo.
1972 - cat <<-EOF
1973 - \$BRINGOVER_WS doesn't match repository root:
1974 - \$BRINGOVER_WS: $BRINGOVER_WS
1975 - Repository root: $root
1976 - EOF
1977 - touch $TMPDIR/bringover_failed
1978 - else
1979 - # If a conflict happens, svn still exits 0.
1980 - staffer svn update $CODEMGR_WS | tee $TMPDIR/pull.out ||
1981 - touch $TMPDIR/bringover_failed
1982 - if grep "^C" $TMPDIR/pull.out > /dev/null 2>&1; then
1983 - touch $TMPDIR/bringover_failed
1984 - fi
1985 - fi
1986 - fi
1987 1653 }
1988 1654
1989 1655 type bringover_none > /dev/null 2>&1 || function bringover_none {
1990 1656 echo "Couldn't figure out what kind of SCM to use for $BRINGOVER_WS."
1991 1657 touch $TMPDIR/bringover_failed
1992 1658 }
1993 1659
1994 1660 #
1995 1661 # Decide whether to bringover to the codemgr workspace
1996 1662 #
1997 1663 if [ "$n_FLAG" = "n" ]; then
1998 1664 PARENT_SCM_TYPE=$(parent_wstype)
1999 1665
2000 1666 if [[ $SCM_TYPE != none && $SCM_TYPE != $PARENT_SCM_TYPE ]]; then
2001 1667 echo "cannot bringover from $PARENT_SCM_TYPE to $SCM_TYPE, " \
2002 1668 "quitting at `date`." | tee -a $mail_msg_file >> $LOGFILE
2003 1669 exit 1
2004 1670 fi
2005 1671
2006 1672 run_hook PRE_BRINGOVER
2007 1673
2008 1674 echo "\n==== bringover to $CODEMGR_WS at `date` ====\n" >> $LOGFILE
2009 1675 echo "\n==== BRINGOVER LOG ====\n" >> $mail_msg_file
2010 1676
2011 1677 eval "bringover_${PARENT_SCM_TYPE}" 2>&1 |
2012 1678 tee -a $mail_msg_file >> $LOGFILE
2013 1679
2014 1680 if [ -f $TMPDIR/bringover_failed ]; then
2015 1681 rm -f $TMPDIR/bringover_failed
2016 1682 build_ok=n
2017 1683 echo "trouble with bringover, quitting at `date`." |
2018 1684 tee -a $mail_msg_file >> $LOGFILE
2019 1685 exit 1
2020 1686 fi
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
2021 1687
2022 1688 #
2023 1689 # It's possible that we used the bringover above to create
2024 1690 # $CODEMGR_WS. If so, then SCM_TYPE was previously "none,"
2025 1691 # but should now be the same as $BRINGOVER_WS.
2026 1692 #
2027 1693 [[ $SCM_TYPE = none ]] && SCM_TYPE=$PARENT_SCM_TYPE
2028 1694
2029 1695 run_hook POST_BRINGOVER
2030 1696
2031 - check_closed_tree
1697 + check_closed_bins
2032 1698
2033 1699 else
2034 1700 echo "\n==== No bringover to $CODEMGR_WS ====\n" >> $LOGFILE
2035 1701 fi
2036 1702
2037 1703 # Safeguards
2038 1704 [[ -v CODEMGR_WS ]] || fatal_error "Error: Variable CODEMGR_WS not set."
2039 1705 [[ -d "${CODEMGR_WS}" ]] || fatal_error "Error: ${CODEMGR_WS} is not a directory."
2040 1706 [[ -f "${CODEMGR_WS}/usr/src/Makefile" ]] || fatal_error "Error: ${CODEMGR_WS}/usr/src/Makefile not found."
2041 1707
2042 1708 echo "\n==== Build environment ====\n" | tee -a $build_environ_file >> $LOGFILE
2043 1709
2044 1710 # System
2045 1711 whence uname | tee -a $build_environ_file >> $LOGFILE
2046 1712 uname -a 2>&1 | tee -a $build_environ_file >> $LOGFILE
2047 1713 echo | tee -a $build_environ_file >> $LOGFILE
2048 1714
2049 1715 # make
2050 1716 whence $MAKE | tee -a $build_environ_file >> $LOGFILE
2051 1717 $MAKE -v | tee -a $build_environ_file >> $LOGFILE
2052 1718 echo "number of concurrent jobs = $DMAKE_MAX_JOBS" |
2053 1719 tee -a $build_environ_file >> $LOGFILE
2054 1720
2055 1721 #
2056 1722 # Report the compiler versions.
2057 1723 #
2058 1724
2059 1725 if [[ ! -f $SRC/Makefile ]]; then
2060 1726 build_ok=n
2061 1727 echo "\nUnable to find \"Makefile\" in $SRC." | \
2062 1728 tee -a $build_environ_file >> $LOGFILE
2063 1729 exit 1
2064 1730 fi
2065 1731
2066 1732 ( cd $SRC
2067 1733 for target in cc-version cc64-version java-version; do
2068 1734 echo
2069 1735 #
2070 1736 # Put statefile somewhere we know we can write to rather than trip
2071 1737 # over a read-only $srcroot.
2072 1738 #
2073 1739 rm -f $TMPDIR/make-state
2074 1740 export SRC
2075 1741 if $MAKE -K $TMPDIR/make-state -e $target 2>/dev/null; then
2076 1742 continue
2077 1743 fi
2078 1744 touch $TMPDIR/nocompiler
2079 1745 done
2080 1746 echo
2081 1747 ) | tee -a $build_environ_file >> $LOGFILE
2082 1748
2083 1749 if [ -f $TMPDIR/nocompiler ]; then
2084 1750 rm -f $TMPDIR/nocompiler
2085 1751 build_ok=n
2086 1752 echo "Aborting due to missing compiler." |
2087 1753 tee -a $build_environ_file >> $LOGFILE
2088 1754 exit 1
2089 1755 fi
2090 1756
2091 1757 # as
2092 1758 whence as | tee -a $build_environ_file >> $LOGFILE
2093 1759 as -V 2>&1 | head -1 | tee -a $build_environ_file >> $LOGFILE
2094 1760 echo | tee -a $build_environ_file >> $LOGFILE
2095 1761
2096 1762 # Check that we're running a capable link-editor
2097 1763 whence ld | tee -a $build_environ_file >> $LOGFILE
2098 1764 LDVER=`ld -V 2>&1`
2099 1765 echo $LDVER | tee -a $build_environ_file >> $LOGFILE
2100 1766 LDVER=`echo $LDVER | sed -e "s/.*-1\.\([0-9]*\).*/\1/"`
2101 1767 if [ `expr $LDVER \< 422` -eq 1 ]; then
2102 1768 echo "The link-editor needs to be at version 422 or higher to build" | \
2103 1769 tee -a $build_environ_file >> $LOGFILE
2104 1770 echo "the latest stuff. Hope your build works." | \
2105 1771 tee -a $build_environ_file >> $LOGFILE
2106 1772 fi
2107 1773
2108 1774 #
2109 1775 # Build and use the workspace's tools if requested
↓ open down ↓ |
68 lines elided |
↑ open up ↑ |
2110 1776 #
2111 1777 if [[ "$t_FLAG" = "y" ]]; then
2112 1778 set_non_debug_build_flags
2113 1779
2114 1780 build_tools ${TOOLS_PROTO}
2115 1781 if [[ $? != 0 && "$t_FLAG" = y ]]; then
2116 1782 use_tools $TOOLS_PROTO
2117 1783 fi
2118 1784 fi
2119 1785
2120 -#
2121 -# copy ihv proto area in addition to the build itself
2122 -#
2123 -if [ "$X_FLAG" = "y" ]; then
2124 - copy_ihv_proto
2125 -fi
2126 -
2127 1786 # timestamp the start of the normal build; the findunref tool uses it.
2128 1787 touch $SRC/.build.tstamp
2129 1788
2130 1789 normal_build
2131 1790
2132 1791 ORIG_SRC=$SRC
2133 1792 BINARCHIVE=${CODEMGR_WS}/bin-${MACH}.cpio.Z
2134 1793
2135 1794
2136 1795 #
2137 1796 # There are several checks that need to look at the proto area, but
2138 1797 # they only need to look at one, and they don't care whether it's
2139 1798 # DEBUG or non-DEBUG.
2140 1799 #
2141 1800 if [[ "$MULTI_PROTO" = yes && "$D_FLAG" = n ]]; then
2142 1801 checkroot=$ROOT-nd
2143 1802 else
2144 1803 checkroot=$ROOT
2145 1804 fi
2146 1805
2147 1806 if [ "$build_ok" = "y" ]; then
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
2148 1807 echo "\n==== Creating protolist system file at `date` ====" \
2149 1808 >> $LOGFILE
2150 1809 protolist $checkroot > $ATLOG/proto_list_${MACH}
2151 1810 echo "==== protolist system file created at `date` ====\n" \
2152 1811 >> $LOGFILE
2153 1812
2154 1813 if [ "$N_FLAG" != "y" ]; then
2155 1814
2156 1815 E1=
2157 1816 f1=
2158 - if [ -d "$SRC/pkgdefs" ]; then
2159 - f1="$SRC/pkgdefs/etc/exception_list_$MACH"
2160 - if [ "$X_FLAG" = "y" ]; then
2161 - f1="$f1 $IA32_IHV_WS/usr/src/pkgdefs/etc/exception_list_$MACH"
2162 - fi
2163 - fi
2164 -
2165 1817 for f in $f1; do
2166 1818 if [ -f "$f" ]; then
2167 1819 E1="$E1 -e $f"
2168 1820 fi
2169 1821 done
2170 1822
2171 1823 E2=
2172 1824 f2=
2173 1825 if [ -d "$SRC/pkg" ]; then
2174 1826 f2="$f2 exceptions/packaging"
2175 1827 fi
2176 1828
2177 1829 for f in $f2; do
2178 1830 if [ -f "$f" ]; then
2179 1831 E2="$E2 -e $f"
2180 1832 fi
2181 1833 done
2182 -
2183 - if [ -f "$REF_PROTO_LIST" ]; then
2184 - #
2185 - # For builds that copy the IHV proto area (-X), add the
2186 - # IHV proto list to the reference list if the reference
2187 - # was built without -X.
2188 - #
2189 - # For builds that don't copy the IHV proto area, add the
2190 - # IHV proto list to the build's proto list if the
2191 - # reference was built with -X.
2192 - #
2193 - # Use the presence of the first file entry of the cached
2194 - # IHV proto list in the reference list to determine
2195 - # whether it was built with -X or not.
2196 - #
2197 - IHV_REF_PROTO_LIST=$SRC/pkg/proto_list_ihv_$MACH
2198 - grepfor=$(nawk '$1 == "f" { print $2; exit }' \
2199 - $IHV_REF_PROTO_LIST 2> /dev/null)
2200 - if [ $? = 0 -a -n "$grepfor" ]; then
2201 - if [ "$X_FLAG" = "y" ]; then
2202 - grep -w "$grepfor" \
2203 - $REF_PROTO_LIST > /dev/null
2204 - if [ ! "$?" = "0" ]; then
2205 - REF_IHV_PROTO="-d $IHV_REF_PROTO_LIST"
2206 - fi
2207 - else
2208 - grep -w "$grepfor" \
2209 - $REF_PROTO_LIST > /dev/null
2210 - if [ "$?" = "0" ]; then
2211 - IHV_PROTO_LIST="$IHV_REF_PROTO_LIST"
2212 - fi
2213 - fi
2214 - fi
2215 - fi
2216 - fi
2217 -
2218 - if [ "$N_FLAG" != "y" -a -f $SRC/pkgdefs/Makefile ]; then
2219 - echo "\n==== Impact on SVr4 packages ====\n" >> $mail_msg_file
2220 - #
2221 - # Compare the build's proto list with current package
2222 - # definitions to audit the quality of package
2223 - # definitions and makefile install targets. Use the
2224 - # current exception list.
2225 - #
2226 - PKGDEFS_LIST=""
2227 - for d in $abssrcdirs; do
2228 - if [ -d $d/pkgdefs ]; then
2229 - PKGDEFS_LIST="$PKGDEFS_LIST -d $d/pkgdefs"
2230 - fi
2231 - done
2232 - if [ "$X_FLAG" = "y" -a \
2233 - -d $IA32_IHV_WS/usr/src/pkgdefs ]; then
2234 - PKGDEFS_LIST="$PKGDEFS_LIST -d $IA32_IHV_WS/usr/src/pkgdefs"
2235 - fi
2236 - $PROTOCMPTERSE \
2237 - "Files missing from the proto area:" \
2238 - "Files missing from packages:" \
2239 - "Inconsistencies between pkgdefs and proto area:" \
2240 - ${E1} \
2241 - ${PKGDEFS_LIST} \
2242 - $ATLOG/proto_list_${MACH} \
2243 - >> $mail_msg_file
2244 1834 fi
2245 1835
2246 1836 if [ "$N_FLAG" != "y" -a -d $SRC/pkg ]; then
2247 1837 echo "\n==== Validating manifests against proto area ====\n" \
2248 1838 >> $mail_msg_file
2249 1839 ( cd $SRC/pkg ; $MAKE -e protocmp ROOT="$checkroot" ) \
2250 1840 >> $mail_msg_file
2251 1841
2252 1842 fi
2253 1843
2254 1844 if [ "$N_FLAG" != "y" -a -f "$REF_PROTO_LIST" ]; then
2255 1845 echo "\n==== Impact on proto area ====\n" >> $mail_msg_file
2256 1846 if [ -n "$E2" ]; then
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
2257 1847 ELIST=$E2
2258 1848 else
2259 1849 ELIST=$E1
2260 1850 fi
2261 1851 $PROTOCMPTERSE \
2262 1852 "Files in yesterday's proto area, but not today's:" \
2263 1853 "Files in today's proto area, but not yesterday's:" \
2264 1854 "Files that changed between yesterday and today:" \
2265 1855 ${ELIST} \
2266 1856 -d $REF_PROTO_LIST \
2267 - $REF_IHV_PROTO \
2268 1857 $ATLOG/proto_list_${MACH} \
2269 - $IHV_PROTO_LIST \
2270 1858 >> $mail_msg_file
2271 1859 fi
2272 1860 fi
2273 1861
2274 1862 if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
2275 1863 staffer cp $ATLOG/proto_list_${MACH} \
2276 1864 $PARENT_WS/usr/src/proto_list_${MACH}
2277 1865 fi
2278 1866
2279 1867 # Update parent proto area if necessary. This is done now
2280 1868 # so that the proto area has either DEBUG or non-DEBUG kernels.
2281 1869 # Note that this clears out the lock file, so we can dispense with
2282 1870 # the variable now.
2283 1871 if [ "$U_FLAG" = "y" -a "$build_ok" = "y" ]; then
2284 1872 echo "\n==== Copying proto area to $NIGHTLY_PARENT_ROOT ====\n" | \
2285 1873 tee -a $LOGFILE >> $mail_msg_file
2286 1874 rm -rf $NIGHTLY_PARENT_ROOT/*
2287 1875 unset Ulockfile
2288 1876 mkdir -p $NIGHTLY_PARENT_ROOT
2289 1877 if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
2290 1878 ( cd $ROOT; tar cf - . |
2291 1879 ( cd $NIGHTLY_PARENT_ROOT; umask 0; tar xpf - ) ) 2>&1 |
2292 1880 tee -a $mail_msg_file >> $LOGFILE
2293 1881 fi
2294 1882 if [[ "$MULTI_PROTO" = yes && "$F_FLAG" = n ]]; then
2295 1883 rm -rf $NIGHTLY_PARENT_ROOT-nd/*
2296 1884 mkdir -p $NIGHTLY_PARENT_ROOT-nd
2297 1885 cd $ROOT-nd
2298 1886 ( tar cf - . |
2299 1887 ( cd $NIGHTLY_PARENT_ROOT-nd; umask 0; tar xpf - ) ) 2>&1 |
2300 1888 tee -a $mail_msg_file >> $LOGFILE
2301 1889 fi
2302 1890 if [ -n "${NIGHTLY_PARENT_TOOLS_ROOT}" ]; then
2303 1891 echo "\n==== Copying tools proto area to $NIGHTLY_PARENT_TOOLS_ROOT ====\n" | \
2304 1892 tee -a $LOGFILE >> $mail_msg_file
2305 1893 rm -rf $NIGHTLY_PARENT_TOOLS_ROOT/*
2306 1894 mkdir -p $NIGHTLY_PARENT_TOOLS_ROOT
2307 1895 if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
2308 1896 ( cd $TOOLS_PROTO; tar cf - . |
2309 1897 ( cd $NIGHTLY_PARENT_TOOLS_ROOT;
2310 1898 umask 0; tar xpf - ) ) 2>&1 |
2311 1899 tee -a $mail_msg_file >> $LOGFILE
2312 1900 fi
2313 1901 fi
2314 1902 fi
2315 1903
2316 1904 #
2317 1905 # ELF verification: ABI (-A) and runtime (-r) checks
2318 1906 #
2319 1907 if [[ ($build_ok = y) && ( ($A_FLAG = y) || ($r_FLAG = y) ) ]]; then
2320 1908 # Directory ELF-data.$MACH holds the files produced by these tests.
2321 1909 elf_ddir=$SRC/ELF-data.$MACH
2322 1910
2323 1911 # If there is a previous ELF-data backup directory, remove it. Then,
2324 1912 # rotate current ELF-data directory into its place and create a new
2325 1913 # empty directory
2326 1914 rm -rf $elf_ddir.ref
2327 1915 if [[ -d $elf_ddir ]]; then
2328 1916 mv $elf_ddir $elf_ddir.ref
2329 1917 fi
2330 1918 mkdir -p $elf_ddir
2331 1919
2332 1920 # Call find_elf to produce a list of the ELF objects in the proto area.
2333 1921 # This list is passed to check_rtime and interface_check, preventing
2334 1922 # them from separately calling find_elf to do the same work twice.
2335 1923 find_elf -fr $checkroot > $elf_ddir/object_list
2336 1924
2337 1925 if [[ $A_FLAG = y ]]; then
2338 1926 echo "\n==== Check versioning and ABI information ====\n" | \
2339 1927 tee -a $LOGFILE >> $mail_msg_file
2340 1928
2341 1929 # Produce interface description for the proto. Report errors.
2342 1930 interface_check -o -w $elf_ddir -f object_list \
2343 1931 -i interface -E interface.err
2344 1932 if [[ -s $elf_ddir/interface.err ]]; then
2345 1933 tee -a $LOGFILE < $elf_ddir/interface.err \
2346 1934 >> $mail_msg_file
2347 1935 fi
2348 1936
2349 1937 # If ELF_DATA_BASELINE_DIR is defined, compare the new interface
2350 1938 # description file to that from the baseline gate. Issue a
2351 1939 # warning if the baseline is not present, and keep going.
2352 1940 if [[ "$ELF_DATA_BASELINE_DIR" != '' ]]; then
2353 1941 base_ifile="$ELF_DATA_BASELINE_DIR/interface"
2354 1942
2355 1943 echo "\n==== Compare versioning and ABI information" \
2356 1944 "to baseline ====\n" | \
2357 1945 tee -a $LOGFILE >> $mail_msg_file
2358 1946 echo "Baseline: $base_ifile\n" >> $LOGFILE
2359 1947
2360 1948 if [[ -f $base_ifile ]]; then
2361 1949 interface_cmp -d -o $base_ifile \
2362 1950 $elf_ddir/interface > $elf_ddir/interface.cmp
2363 1951 if [[ -s $elf_ddir/interface.cmp ]]; then
2364 1952 echo | tee -a $LOGFILE >> $mail_msg_file
2365 1953 tee -a $LOGFILE < \
2366 1954 $elf_ddir/interface.cmp \
2367 1955 >> $mail_msg_file
2368 1956 fi
2369 1957 else
2370 1958 echo "baseline not available. comparison" \
2371 1959 "skipped" | \
2372 1960 tee -a $LOGFILE >> $mail_msg_file
2373 1961 fi
2374 1962
2375 1963 fi
2376 1964 fi
2377 1965
2378 1966 if [[ $r_FLAG = y ]]; then
2379 1967 echo "\n==== Check ELF runtime attributes ====\n" | \
2380 1968 tee -a $LOGFILE >> $mail_msg_file
2381 1969
2382 1970 # If we're doing a DEBUG build the proto area will be left
2383 1971 # with debuggable objects, thus don't assert -s.
2384 1972 if [[ $D_FLAG = y ]]; then
2385 1973 rtime_sflag=""
2386 1974 else
2387 1975 rtime_sflag="-s"
2388 1976 fi
2389 1977 check_rtime -i -m -v $rtime_sflag -o -w $elf_ddir \
2390 1978 -D object_list -f object_list -E runtime.err \
2391 1979 -I runtime.attr.raw
2392 1980
2393 1981 # check_rtime -I output needs to be sorted in order to
2394 1982 # compare it to that from previous builds.
2395 1983 sort $elf_ddir/runtime.attr.raw > $elf_ddir/runtime.attr
2396 1984 rm $elf_ddir/runtime.attr.raw
2397 1985
2398 1986 # Report errors
2399 1987 if [[ -s $elf_ddir/runtime.err ]]; then
2400 1988 tee -a $LOGFILE < $elf_ddir/runtime.err \
2401 1989 >> $mail_msg_file
2402 1990 fi
2403 1991
2404 1992 # If there is an ELF-data directory from a previous build,
2405 1993 # then diff the attr files. These files contain information
2406 1994 # about dependencies, versioning, and runpaths. There is some
2407 1995 # overlap with the ABI checking done above, but this also
2408 1996 # flushes out non-ABI interface differences along with the
2409 1997 # other information.
2410 1998 echo "\n==== Diff ELF runtime attributes" \
2411 1999 "(since last build) ====\n" | \
2412 2000 tee -a $LOGFILE >> $mail_msg_file >> $mail_msg_file
2413 2001
2414 2002 if [[ -f $elf_ddir.ref/runtime.attr ]]; then
2415 2003 diff $elf_ddir.ref/runtime.attr \
2416 2004 $elf_ddir/runtime.attr \
2417 2005 >> $mail_msg_file
2418 2006 fi
2419 2007 fi
2420 2008
2421 2009 # If -u set, copy contents of ELF-data.$MACH to the parent workspace.
2422 2010 if [[ "$u_FLAG" = "y" ]]; then
2423 2011 p_elf_ddir=$PARENT_WS/usr/src/ELF-data.$MACH
2424 2012
2425 2013 # If parent lacks the ELF-data.$MACH directory, create it
2426 2014 if [[ ! -d $p_elf_ddir ]]; then
2427 2015 staffer mkdir -p $p_elf_ddir
2428 2016 fi
2429 2017
2430 2018 # These files are used asynchronously by other builds for ABI
2431 2019 # verification, as above for the -A option. As such, we require
2432 2020 # the file replacement to be atomic. Copy the data to a temp
2433 2021 # file in the same filesystem and then rename into place.
2434 2022 (
2435 2023 cd $elf_ddir
2436 2024 for elf_dfile in *; do
2437 2025 staffer cp $elf_dfile \
2438 2026 ${p_elf_ddir}/${elf_dfile}.new
2439 2027 staffer mv -f ${p_elf_ddir}/${elf_dfile}.new \
2440 2028 ${p_elf_ddir}/${elf_dfile}
2441 2029 done
2442 2030 )
2443 2031 fi
2444 2032 fi
2445 2033
2446 2034 # DEBUG lint of kernel begins
2447 2035
2448 2036 if [ "$i_CMD_LINE_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
2449 2037 if [ "$LINTDIRS" = "" ]; then
2450 2038 # LINTDIRS="$SRC/uts y $SRC/stand y $SRC/psm y"
2451 2039 LINTDIRS="$SRC y"
2452 2040 fi
2453 2041 set $LINTDIRS
2454 2042 while [ $# -gt 0 ]; do
2455 2043 dolint $1 $2; shift; shift
2456 2044 done
2457 2045 else
2458 2046 echo "\n==== No '$MAKE lint' ====\n" >> $LOGFILE
2459 2047 fi
2460 2048
2461 2049 # "make check" begins
2462 2050
2463 2051 if [ "$i_CMD_LINE_FLAG" = "n" -a "$C_FLAG" = "y" ]; then
2464 2052 # remove old check.out
2465 2053 rm -f $SRC/check.out
2466 2054
2467 2055 rm -f $SRC/check-${MACH}.out
2468 2056 cd $SRC
2469 2057 $MAKE -ek check ROOT="$checkroot" 2>&1 | tee -a $SRC/check-${MACH}.out \
2470 2058 >> $LOGFILE
2471 2059 echo "\n==== cstyle/hdrchk errors ====\n" >> $mail_msg_file
2472 2060
2473 2061 grep ":" $SRC/check-${MACH}.out |
2474 2062 egrep -v "Ignoring unknown host" | \
2475 2063 sort | uniq >> $mail_msg_file
2476 2064 else
2477 2065 echo "\n==== No '$MAKE check' ====\n" >> $LOGFILE
2478 2066 fi
2479 2067
2480 2068 echo "\n==== Find core files ====\n" | \
2481 2069 tee -a $LOGFILE >> $mail_msg_file
2482 2070
2483 2071 find $abssrcdirs -name core -a -type f -exec file {} \; | \
2484 2072 tee -a $LOGFILE >> $mail_msg_file
2485 2073
2486 2074 if [ "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
2487 2075 echo "\n==== Diff unreferenced files (since last build) ====\n" \
2488 2076 | tee -a $LOGFILE >>$mail_msg_file
2489 2077 rm -f $SRC/unref-${MACH}.ref
2490 2078 if [ -f $SRC/unref-${MACH}.out ]; then
2491 2079 mv $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
2492 2080 fi
2493 2081
2494 2082 findunref -S $SCM_TYPE -t $SRC/.build.tstamp -s usr $CODEMGR_WS \
↓ open down ↓ |
215 lines elided |
↑ open up ↑ |
2495 2083 ${TOOLS}/findunref/exception_list 2>> $mail_msg_file | \
2496 2084 sort > $SRC/unref-${MACH}.out
2497 2085
2498 2086 if [ ! -f $SRC/unref-${MACH}.ref ]; then
2499 2087 cp $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
2500 2088 fi
2501 2089
2502 2090 diff $SRC/unref-${MACH}.ref $SRC/unref-${MACH}.out >>$mail_msg_file
2503 2091 fi
2504 2092
2505 -#
2506 -# Generate the OpenSolaris deliverables if requested. Some of these
2507 -# steps need to come after findunref and are commented below.
2508 -#
2509 -
2510 2093 # Verify that the usual lists of files, such as exception lists,
2511 2094 # contain only valid references to files. If the build has failed,
2512 2095 # then don't check the proto area.
2513 2096 CHECK_PATHS=${CHECK_PATHS:-y}
2514 2097 if [ "$CHECK_PATHS" = y -a "$N_FLAG" != y ]; then
2515 2098 echo "\n==== Check lists of files ====\n" | tee -a $LOGFILE \
2516 2099 >>$mail_msg_file
2517 2100 arg=-b
2518 2101 [ "$build_ok" = y ] && arg=
2519 2102 checkpaths $arg $checkroot 2>&1 | tee -a $LOGFILE >>$mail_msg_file
2520 2103 fi
2521 2104
2522 2105 if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then
2523 2106 echo "\n==== Impact on file permissions ====\n" \
2524 2107 >> $mail_msg_file
2525 2108
2526 - abspkgdefs=
2527 2109 abspkg=
2528 2110 for d in $abssrcdirs; do
2529 - if [ -d "$d/pkgdefs" ]; then
2530 - abspkgdefs="$abspkgdefs $d"
2531 - fi
2532 2111 if [ -d "$d/pkg" ]; then
2533 2112 abspkg="$abspkg $d"
2534 2113 fi
2535 2114 done
2536 2115
2537 - if [ -n "$abspkgdefs" ]; then
2538 - pmodes -qvdP \
2539 - `find $abspkgdefs -name pkginfo.tmpl -print -o \
2540 - -name .del\* -prune | sed -e 's:/pkginfo.tmpl$::' | \
2541 - sort -u` >> $mail_msg_file
2542 - fi
2543 -
2544 2116 if [ -n "$abspkg" ]; then
2545 2117 for d in "$abspkg"; do
2546 2118 ( cd $d/pkg ; $MAKE -e pmodes ) >> $mail_msg_file
2547 2119 done
2548 2120 fi
2549 2121 fi
2550 2122
2551 2123 if [ "$w_FLAG" = "y" -a "$build_ok" = "y" ]; then
2552 2124 if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then
2553 2125 do_wsdiff DEBUG $ROOT.prev $ROOT
2554 2126 fi
2555 2127
2556 2128 if [[ "$MULTI_PROTO" = yes && "$F_FLAG" = n ]]; then
2557 2129 do_wsdiff non-DEBUG $ROOT-nd.prev $ROOT-nd
2558 2130 fi
2559 2131 fi
2560 2132
2561 2133 END_DATE=`date`
2562 2134 echo "==== Nightly $maketype build completed: $END_DATE ====" | \
2563 2135 tee -a $LOGFILE >> $build_time_file
2564 2136
2565 2137 typeset -i10 hours
2566 2138 typeset -Z2 minutes
2567 2139 typeset -Z2 seconds
2568 2140
2569 2141 elapsed_time=$SECONDS
2570 2142 ((hours = elapsed_time / 3600 ))
2571 2143 ((minutes = elapsed_time / 60 % 60))
2572 2144 ((seconds = elapsed_time % 60))
2573 2145
2574 2146 echo "\n==== Total build time ====" | \
2575 2147 tee -a $LOGFILE >> $build_time_file
2576 2148 echo "\nreal ${hours}:${minutes}:${seconds}" | \
2577 2149 tee -a $LOGFILE >> $build_time_file
2578 2150
2579 2151 if [ "$u_FLAG" = "y" -a "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
2580 2152 staffer cp ${SRC}/unref-${MACH}.out $PARENT_WS/usr/src/
2581 2153
2582 2154 #
2583 2155 # Produce a master list of unreferenced files -- ideally, we'd
2584 2156 # generate the master just once after all of the nightlies
2585 2157 # have finished, but there's no simple way to know when that
2586 2158 # will be. Instead, we assume that we're the last nightly to
2587 2159 # finish and merge all of the unref-${MACH}.out files in
2588 2160 # $PARENT_WS/usr/src/. If we are in fact the final ${MACH} to
2589 2161 # finish, then this file will be the authoritative master
2590 2162 # list. Otherwise, another ${MACH}'s nightly will eventually
2591 2163 # overwrite ours with its own master, but in the meantime our
2592 2164 # temporary "master" will be no worse than any older master
2593 2165 # which was already on the parent.
2594 2166 #
2595 2167
2596 2168 set -- $PARENT_WS/usr/src/unref-*.out
2597 2169 cp "$1" ${TMPDIR}/unref.merge
2598 2170 shift
2599 2171
2600 2172 for unreffile; do
2601 2173 comm -12 ${TMPDIR}/unref.merge "$unreffile" > ${TMPDIR}/unref.$$
2602 2174 mv ${TMPDIR}/unref.$$ ${TMPDIR}/unref.merge
2603 2175 done
2604 2176
2605 2177 staffer cp ${TMPDIR}/unref.merge $PARENT_WS/usr/src/unrefmaster.out
2606 2178 fi
2607 2179
2608 2180 #
2609 2181 # All done save for the sweeping up.
2610 2182 # (whichever exit we hit here will trigger the "cleanup" trap which
2611 2183 # optionally sends mail on completion).
2612 2184 #
2613 2185 if [ "$build_ok" = "y" ]; then
2614 2186 exit 0
2615 2187 fi
2616 2188 exit 1
↓ open down ↓ |
63 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX