build_summary 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. #!/bin/ksh
  2. #
  3. # build_summary
  4. #
  5. ########################################################################
  6. #set -x
  7. ##########################################################################
  8. #
  9. # Script setup: THIS NEEDS TO BE FIRST
  10. #
  11. SCRIPTS_DIR="`dirname $0`"
  12. PROG_NAME="`basename $0`"
  13. if [ "" = "$SCRIPTS_DIR" ]; then
  14. SCRIPTS_DIR=/project/dt/scripts
  15. fi
  16. if [ ! -f $SCRIPTS_DIR/script_setup.ksh ]; then
  17. print -u2 "$PROG_NAME: File '$SCRIPTS_DIR/script_setup.ksh' NOT found!"
  18. print -u2 "$PROG_NAME: Exiting ..."
  19. exit 1
  20. fi
  21. . $SCRIPTS_DIR/script_setup.ksh
  22. ##########################################################################
  23. ##########################################################################
  24. #
  25. # Script specific global variables
  26. #
  27. ##########################################################################
  28. ##########################################################################
  29. COMPONENTS_FILES=""
  30. COMPONENTS="all"
  31. DEBUG="False"
  32. SUMMARY_FILES=""
  33. NOT_DONE_SUMMARY_FILES=""
  34. PRINT_ERRORS="5"
  35. usage ()
  36. {
  37. cat <<eof
  38. USAGE: $PROG_NAME
  39. [{-c | -components_file} <file>]
  40. # Specifies a file containing a list of components to
  41. # be extracted. Multiple -c flags can be specified.
  42. [{-e | -errors} <number>]
  43. # Specifies the number of errors shown for each
  44. # component in the components files. Defaults to all.
  45. [-h | -? | -help]
  46. # Print usage and exit
  47. [{-l | -log_path} <path>]
  48. [{-m | -mail | -mail_list} <user_name(s)>]
  49. [{-pn | -project_name} <project_name>]
  50. # The default is CDE. This impacts the Subject field
  51. # when email is sent. Use "-pn X11" to get "X11" in
  52. # the Subject field.
  53. {-s | -summary_file} <file>
  54. # Specifies a summary report from a build_world.
  55. # $PROG_NAME accepts multiple -f flags.
  56. eof
  57. }
  58. ##########################################################################
  59. #
  60. # FUNCTION: is_complete_build <summary_file>
  61. #
  62. # Returns 0 if the build is complete.
  63. # Returns 1 if the build is not complete
  64. #
  65. is_complete_build ()
  66. {
  67. typeset SUMMARY_FILE LCMPL
  68. SUMMARY_FILE=$1
  69. LCMPL=`grep "$BTAG_CMPL" $SUMMARY_FILE | tail -1`
  70. if [ -z "$LCMPL" ]; then
  71. return 1
  72. fi
  73. }
  74. ###############################################################################
  75. #
  76. # FUNCTION: print_build_start_end ()
  77. #
  78. # ViewName StartTime BuildStatus
  79. # -------- --------- -----------
  80. # cde-dec STARTED: Sun Jan 16, 23:34 FINISHED: Mon Jan 17, 23:34
  81. # cde-hp STARTED: Sun Jan 16, 23:34 BUILDING: making all in ...
  82. # cde-ibm STARTED: Sun Jan 16, 23:34 FINISHED: Mon Jan 17, 23:34
  83. # cde-sco STARTED: Sun Jan 16, 23:34 FINISHED: Mon Jan 17, 23:34
  84. # cde-sgi STARTED: Sun Jan 16, 23:34 FINISHED: Mon Jan 17, 23:34
  85. # cde-sun STARTED: Sun Jan 16, 23:34 FINISHED: Mon Jan 17, 23:34
  86. #
  87. ###############################################################################
  88. print_build_start_end ()
  89. {
  90. typeset CMPL LOGD PRJT DATE VIEW
  91. typeset AWK_START_END_SUMMARY
  92. AWK_START_END_SUMMARY='{printf("%-12s %-28s %-28s\n", $1,$2,$3)}'
  93. echo "ViewName StartTime BuildStatus" | awk "$AWK_START_END_SUMMARY"
  94. echo "-------- --------- -----------" | awk "$AWK_START_END_SUMMARY"
  95. for r in $SUMMARY_FILES
  96. do
  97. VIEW=`grep "$BTAG_VIEW" $r | head -1 | awk '{printf("%s", $NF)}'`
  98. DATE=`grep "$BTAG_DATE" $r | head -1 | awk '{printf("%s", $NF)}' FS=+`
  99. is_complete_build $r
  100. if [ $? -eq 0 ]; then
  101. CMPL=`grep "$BTAG_CMPL" $r | tail -1 |
  102. awk '{printf("%s", $NF)}' FS=+`
  103. echo "$VIEW|STARTED: $DATE|FINISHED: $CMPL" | \
  104. awk "$AWK_START_END_SUMMARY" FS="|"
  105. else
  106. LOGD=`grep "$BTAG_LOGD" $r | head -1 | awk '{printf("%s", $NF)}'`
  107. PRJT=`grep "$BTAG_PRJT" $r | tail -1 | awk '{printf("%s", $NF)}'`
  108. LOGF=$LOGD/$PRJT.log
  109. if [ -f $LOGF ]; then
  110. CMPL=`$EXTRACT_MSG -m $BUILD_MSGS -l $LOGF | tail -1`
  111. else
  112. CMPL=""
  113. fi
  114. echo "$VIEW|STARTED: $DATE|BUILDING: $CMPL" | \
  115. awk "$AWK_START_END_SUMMARY" FS="|"
  116. fi
  117. done
  118. print -u1
  119. }
  120. ###############################################################################
  121. #
  122. # FUNCTION: print_build_parameters ()
  123. #
  124. # ViewName Type ConfigSpec Platfm Projects
  125. # -------- ---- ---------- ------ --------
  126. # cde-dec clean cde-next.cs dec x11,motif,cde
  127. # cde-hp clean cde-next.cs hp x11,motif,cde
  128. # cde-ibm clean cde-next.cs ibm x11,motif,cde
  129. # cde-sco clean cde-next.cs sco x11,motif,cde
  130. # cde-sgi clean cde-next.cs sgi x11,motif,cde
  131. # cde-sun clean cde-next.cs sun x11,motif,cde
  132. #
  133. # ViewName LogDirectory
  134. # -------- ------------
  135. # cde-dec /project/dt/logs/build/cde-dec/LATEST -> ./Jan.17.12:24:36
  136. # cde-hp /project/dt/logs/build/cde-hp/LATEST -> ./Jan.17.12:24:36
  137. # cde-ibm /project/dt/logs/build/cde-ibm/LATEST -> ./Jan.17.12:24:36
  138. # cde-sco /project/dt/logs/build/cde-sco/LATEST -> ./Jan.17.12:24:36
  139. # cde-sgi /project/dt/logs/build/cde-sgi/LATEST -> ./Jan.17.12:24:36
  140. # cde-sun /project/dt/logs/build/cde-sun/LATEST -> ./Jan.17.12:24:36
  141. #
  142. ###############################################################################
  143. print_build_parameters ()
  144. {
  145. typeset CMPL CSPS LOGD PRJT PTFM STRT TYPE VIEW
  146. typeset AWK_LOG_SUMMARY AWK_BUILD_SUMMARY
  147. AWK_LOG_SUMMARY='{printf("%-12s %-48s\n", $1,$2)}'
  148. AWK_BUILD_SUMMARY='{printf("%-12s %-6s %-16s %-14s %-16s\n",$1,$2,$3,$4,$5)}'
  149. #
  150. # Section 1: Type/ConfigSpec/Platform/Projects
  151. #
  152. echo "ViewName Type ConfigSpec Platfm Projects" | awk "$AWK_BUILD_SUMMARY"
  153. echo "-------- ---- ---------- ------ --------" | awk "$AWK_BUILD_SUMMARY"
  154. for r in $SUMMARY_FILES
  155. do
  156. CSPC=`grep "$BTAG_CFGS" $r | head -1 | awk '{printf("%s", $NF)}'`
  157. PRJT=`grep "$BTAG_PRJT" $r | awk '{printf("%s ", $NF)}'`
  158. PTFM=`grep "$BTAG_PTFM" $r | head -1 | awk '{printf("%s", $NF)}'`
  159. TYPE=`grep "$BTAG_TYPE" $r | head -1 | awk '{printf("%s", $NF)}'`
  160. if [ "incremental" = "$TYPE" ]; then
  161. TYPE="incrmt"
  162. fi
  163. VIEW=`grep "$BTAG_VIEW" $r | head -1 | awk '{printf("%s", $NF)}'`
  164. echo "$VIEW|$TYPE|$CSPC|$PTFM|$PRJT" | awk "$AWK_BUILD_SUMMARY" FS="|"
  165. done
  166. print -u1
  167. #
  168. # Section 2: LogDirectory
  169. #
  170. echo "ViewName LogDirectory" | awk "$AWK_LOG_SUMMARY"
  171. echo "-------- ------------" | awk "$AWK_LOG_SUMMARY"
  172. for r in $SUMMARY_FILES
  173. do
  174. LOGD=`grep "$BTAG_LOGD" $r | head -1 | awk '{printf("%s", $NF)}'`
  175. if [ -L $LOGD ]; then
  176. LOGD=`ls -l $LOGD | awk '{printf("%s %s %s", $9, $10, $11)}'`
  177. fi
  178. VIEW=`grep "$BTAG_VIEW" $r | head -1 | awk '{printf("%s", $NF)}'`
  179. echo "$VIEW|$LOGD" | awk "$AWK_LOG_SUMMARY" FS="|"
  180. done
  181. }
  182. ###############################################################################
  183. #
  184. # FUNCTION: print_error_and_warning_summaries_by_project ()
  185. #
  186. #
  187. # Project x11 motif cde cdedoc cde-test
  188. # ViewName Errrs Warns Errrs Warns Errrs Warns Errrs Warns Errrs Warns
  189. # -------- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
  190. # build-dec-cde 0 0 0 0 0 554 DNR DNR DNR DNR
  191. # build-hp-cde 0 0 0 0 0 554 DNR DNR DNR DNR
  192. # build-ibm-cde 0 0 0 0 0 554 DNR DNR DNR DNR
  193. # build-sco-cde 0 0 0 0 0 554 DNR DNR DNR DNR
  194. # build-sgi-cde 0 0 0 0 DNR DNR DNR DNR DNR DNR
  195. # build-sun-cde 0 0 0 0 0 554 DNR DNR DNR DNR
  196. #
  197. ###############################################################################
  198. print_error_and_warning_summaries_by_project ()
  199. {
  200. BLANKS=" "
  201. PROJ_CDE="cde"
  202. PROJ_CDD="cdedoc"
  203. PROJ_CDT="cde-test"
  204. PROJ_MTF="motif"
  205. PROJ_X11="x11"
  206. AWK_PROJ_HEADER='{printf("%-12s %-12s %-12s %-12s %-12s %-12s\n",$1,$2,$3,$4,$5,$6)}'
  207. AWK_PROJ_VIEWNAME='{printf("%-12s ", $1)}'
  208. AWK_PROJ_SUMMARY='{printf("%5s %5s ", $1, $2)}'
  209. #
  210. # Print the header for this section
  211. #
  212. echo "Project $PROJ_X11 $PROJ_MTF $PROJ_CDE $PROJ_CDD $PROJ_CDT"|awk "$AWK_PROJ_HEADER"
  213. echo "ViewName" | awk "$AWK_PROJ_VIEWNAME"
  214. for p in $PROJ_X11 $PROJ_MTF $PROJ_CDE $PROJ_CDD $PROJ_CDT
  215. do
  216. echo "Errrs Warns" | awk "$AWK_PROJ_SUMMARY"
  217. done
  218. print -u1
  219. echo "--------" | awk "$AWK_PROJ_VIEWNAME"
  220. for p in $PROJ_X11 $PROJ_MTF $PROJ_CDE $PROJ_CDD $PROJ_CDT
  221. do
  222. echo "----- -----" | awk "$AWK_PROJ_SUMMARY"
  223. done
  224. print -u1
  225. #
  226. # Print the error and warning summaries for each view.
  227. #
  228. for r in $SUMMARY_FILES
  229. do
  230. #
  231. # Print the view name.
  232. #
  233. VIEW=`grep "$BTAG_VIEW" $r | head -1 | awk '{printf("%s", $NF)}'`
  234. echo "$VIEW" | awk "$AWK_PROJ_VIEWNAME"
  235. #
  236. # Print the error and warn totals for each project.
  237. #
  238. for p in $PROJ_X11 $PROJ_MTF $PROJ_CDE $PROJ_CDD $PROJ_CDT
  239. do
  240. ERRRS=`grep "^$p " $r | tail -1 | awk '{print $2}'`
  241. WARNS=`grep "^$p " $r | tail -1 | awk '{print $4}'`
  242. if [ -z "$ERRRS" ] -a [ -z "$WARNS" ]
  243. then
  244. echo "DNR DNR" | awk "$AWK_PROJ_SUMMARY"
  245. else
  246. echo "$ERRRS $WARNS" | awk "$AWK_PROJ_SUMMARY"
  247. fi
  248. done
  249. #
  250. # Print a newline.
  251. #
  252. print -u1
  253. done
  254. }
  255. ###############################################################################
  256. #
  257. # FUNCTION: print_error_summaries_by_component ()
  258. #
  259. #
  260. # Component DEC HP IBM SCO SGI SUN
  261. # --------- ----- ----- ----- ----- ----- -----
  262. # cde/admin 0 0 0 0 0 5
  263. # cde/lib/DtHelp 5 3 1 0 0 0
  264. # cde/programs/dtwm 10 3 5 0 0 0
  265. #
  266. # cde-test/doc 133 22 1 0 45 0
  267. #
  268. ###############################################################################
  269. print_error_summaries_by_component ()
  270. {
  271. AWK_COMP_NAME='{printf("%-32s ", $1)}'
  272. AWK_COMP_ERROR='{printf("%5s ", $1)}'
  273. let num_errors=0
  274. #
  275. # Find the per component errors.
  276. #
  277. for f in $COMPONENTS_FILES
  278. do
  279. #
  280. # Extract the project name from the name of the components file.
  281. # Assumes the components files are named <project>.components.
  282. #
  283. p=`basename $f | awk '{ print $1 }' FS='.'`
  284. for c in `cat $f`
  285. do
  286. #
  287. # Collect the errors for the current component from the report
  288. # summary files and put them in an array.
  289. #
  290. let i=0
  291. FOUND="False"
  292. for r in $SUMMARY_FILES
  293. do
  294. ERRORS[i]=`grep "$p/$c " $r | tail -1 | awk '{print $2}'`
  295. #
  296. # The search may have succeeded but the component may
  297. # only have warnings and no errors. If this is true,
  298. # then this component should not be added to the error
  299. # list
  300. #
  301. if [ ! -z "`echo ${ERRORS[i]}`" ]; then
  302. if [ "`echo ${ERRORS[i]}`" != "0" ]; then
  303. FOUND="True"
  304. fi
  305. fi
  306. let i=i+1
  307. done
  308. #
  309. # If the component doesn't show up anywhere ignore it.
  310. #
  311. if [ -z "`echo ${ERRORS[*]}`" -o "False" = "$FOUND" ]
  312. then
  313. continue
  314. fi
  315. let num_errors=num_errors+1
  316. if [ num_errors -eq 1 ]; then
  317. #
  318. # Print the header for this section
  319. #
  320. echo "Component" | awk "$AWK_COMP_NAME"
  321. for r in $SUMMARY_FILES
  322. do
  323. PTFM=`grep "$BTAG_PTFM" $r | head -1 | awk '{printf("%s", $NF)}'`
  324. echo "$PTFM" | awk "$AWK_COMP_ERROR"
  325. done
  326. print -u1
  327. echo "---------" | awk "$AWK_COMP_NAME"
  328. for r in $SUMMARY_FILES
  329. do
  330. echo "-----" | awk "$AWK_COMP_ERROR"
  331. done
  332. print -u1
  333. fi
  334. #
  335. # Print the component name including the project it belongs to.
  336. #
  337. echo "$p/$c" | awk "$AWK_COMP_NAME"
  338. #
  339. # Print the errors for this component.
  340. #
  341. for r in $SUMMARY_FILES
  342. do
  343. ERRRS=`grep "$p/$c " $r | tail -1 | awk '{print $2}'`
  344. if [ -z "$ERRRS" ]
  345. then
  346. is_complete_build $r
  347. if [ $? -eq 0 ]; then
  348. ERRRS="0"
  349. else
  350. ERRRS="DNR"
  351. fi
  352. fi
  353. echo "$ERRRS" | awk "$AWK_COMP_ERROR"
  354. done
  355. #
  356. # Print a newline.
  357. #
  358. print -u1
  359. done
  360. done
  361. if [ $num_errors -eq 0 ]; then
  362. print -u1 "NO errors were found."
  363. fi
  364. }
  365. ###############################################################################
  366. #
  367. # FUNCTION: print_error_listings_by_component ()
  368. #
  369. # -------------------------------------------------------------------
  370. # - <component-name>
  371. # -------------------------------------------------------------------
  372. # make all in <component-name>...
  373. # error 1
  374. # error 2
  375. # make all in <component-name>/subdir...
  376. # error 3
  377. # error 4
  378. #
  379. ###############################################################################
  380. print_error_listings_by_component ()
  381. {
  382. let num_errors=0
  383. for f in $COMPONENTS_FILES
  384. do
  385. #
  386. # Extract the project name from the name of the components file.
  387. # Assumes the components files are named <project>.components.
  388. #
  389. p=`basename $f | awk '{ print $1 }' FS='.'`
  390. for c in `cat $f`
  391. do
  392. #
  393. # Collect the errors for the current component from the
  394. # report summary files and put them in an array.
  395. #
  396. let i=0
  397. FOUND="False"
  398. for r in $SUMMARY_FILES
  399. do
  400. ERRORS[i]=`grep "$p/$c " $r | tail -1 | awk '{print $2}'`
  401. #
  402. # The search may have succeeded but the component may
  403. # only have warnings and no errors. If this is true,
  404. # then this component should not be added to the error
  405. # list
  406. #
  407. if [ ! -z "`echo ${ERRORS[i]}`" ]; then
  408. if [ "`echo ${ERRORS[i]}`" != "0" ]; then
  409. FOUND="True"
  410. fi
  411. fi
  412. let i=i+1
  413. done
  414. #
  415. # If the component doesn't show up anywhere ignore it.
  416. #
  417. if [ -z "`echo ${ERRORS[*]}`" -o "False" = "$FOUND" ]
  418. then
  419. continue
  420. fi
  421. let num_errors=num_errors+1
  422. #
  423. # Print the component name including the project it belongs to.
  424. #
  425. COMP=`echo $c | tr "/" ","`
  426. print -u1 "+++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  427. print -u1 "+ COMPONENT: $p/$COMP"
  428. print -u1 "+++++++++++++++++++++++++++++++++++++++++++++++++++++++"
  429. print -u1
  430. #
  431. # Print the errors for this component.
  432. #
  433. for r in $SUMMARY_FILES
  434. do
  435. LOGD=`grep "$BTAG_LOGD" $r | head -1 |
  436. awk '{printf("%s", $NF)}'`
  437. VIEW=`grep "$BTAG_VIEW" $r | head -1 |
  438. awk '{printf("%s", $NF)}'`
  439. ERR_FILE=$LOGD/$p/$COMP.err
  440. if [ -f "$ERR_FILE" ]
  441. then
  442. print -u1 "+"
  443. print -u1 "+ View: $VIEW"
  444. print -u1 "+ Error File: $ERR_FILE"
  445. print -u1 "+"
  446. print -u1
  447. head -$PRINT_ERRORS $ERR_FILE
  448. print -u1
  449. fi
  450. done
  451. #
  452. # Print a newline.
  453. #
  454. print -u1
  455. done
  456. done
  457. if [ num_errors -eq 0 ]; then
  458. print -u1 "NO errors were found."
  459. fi
  460. }
  461. #############################################################################
  462. #
  463. # Do command-line processing
  464. #
  465. while [ $# -gt 0 ]; do
  466. case $1 in
  467. -debug)
  468. DEBUG="True"
  469. shift 1 ;;
  470. -c | -components_file)
  471. if [ $# -lt 2 ]; then
  472. print -u2 "$PROG_NAME: $1 option missing value; exiting ..."
  473. do_exit 1
  474. fi
  475. COMPONENTS_FILES="$COMPONENTS_FILES $2"
  476. shift 2 ;;
  477. -e | -errors)
  478. if [ $# -lt 2 ]; then
  479. print -u2 "$PROG_NAME: $1 option missing value; exiting ..."
  480. do_exit 1
  481. fi
  482. PRINT_ERRORS="$2"
  483. shift 2 ;;
  484. -h | "-?" | -help)
  485. usage $PROG_NAME
  486. do_exit 1 ;;
  487. -l | -log_path )
  488. if [ $# -lt 2 ]; then
  489. print -u2 "$PROG_NAME: $1 option missing value; exiting ..."
  490. do_exit 1
  491. fi
  492. LOG_PATH=$2
  493. shift 2 ;;
  494. -m | -mail | -mail_list)
  495. if [ $# -lt 2 ]; then
  496. print -u2 "$PROG_NAME: $1 option missing value; exiting ..."
  497. do_exit 1
  498. fi
  499. MAIL_LIST=$2
  500. shift 2 ;;
  501. -pn | -project_name)
  502. if [ $# -lt 2 ]; then
  503. print -u2 "$PROG_NAME: $1 option missing value; exiting ..."
  504. do_exit 1
  505. fi
  506. # Change the value of SUBJECT_BUILD_SUMMARY
  507. SUBJECT_BUILD_SUMMARY="${2}: Build Summary"
  508. shift 2 ;;
  509. -s | -summary_file)
  510. if [ $# -lt 2 ]; then
  511. print -u2 "$PROG_NAME: $1 option missing value; exiting ..."
  512. do_exit 1
  513. fi
  514. SUMMARY_FILES="$SUMMARY_FILES $2"
  515. shift 2 ;;
  516. *)
  517. print -u2 "$PROG_NAME: invalid option $1; exiting ..."
  518. do_exit 1 ;;
  519. esac
  520. done
  521. #############################################################################
  522. #
  523. # Check to make sure that the command-line parameters make sense.
  524. #
  525. for f in $COMPONENTS_FILES
  526. do
  527. if [ ! -f $f ]
  528. then
  529. print -u2 "$PROG_NAME: Component file \"$f\" does not exist."
  530. print -u2 "$PROG_NAME: exiting ..."
  531. do_exit 1
  532. fi
  533. done
  534. if [ -z "$SUMMARY_FILES" ]
  535. then
  536. print -u2 "$PROG_NAME: No report summaries specified; exiting ..."
  537. do_exit 1
  538. fi
  539. #############################################################################
  540. #
  541. # Determine which builds never started or never completed.
  542. #
  543. NOT_AVAILABLE_SUMMARY_FILES=""
  544. AVAILABLE_SUMMARY_FILES=""
  545. for r in $SUMMARY_FILES
  546. do
  547. if [ ! -f $r ]; then
  548. if [ -z "$NOT_AVAILABLE_SUMMARY_FILES" ]; then
  549. NOT_AVAILABLE_SUMMARY_FILES="$r"
  550. else
  551. NOT_AVAILABLE_SUMMARY_FILES="$NOT_AVAILABLE_SUMMARY_FILES $r"
  552. fi
  553. else
  554. if [ -z "$AVAILABLE_SUMMARY_FILES" ]; then
  555. AVAILABLE_SUMMARY_FILES="$r"
  556. else
  557. AVAILABLE_SUMMARY_FILES="$AVAILABLE_SUMMARY_FILES $r"
  558. fi
  559. fi
  560. done
  561. SUMMARY_FILES="$AVAILABLE_SUMMARY_FILES"
  562. #
  563. # Redirect output
  564. #
  565. EXECUTIVE_SUMMARY_LOG=/tmp/$PROG_NAME.execsum.$$
  566. if [ "$DEBUG" = "False" ]; then
  567. do_register_temporary_file $EXECUTIVE_SUMMARY_LOG
  568. touch $EXECUTIVE_SUMMARY_LOG
  569. exec 9>&1
  570. exec > $EXECUTIVE_SUMMARY_LOG
  571. fi
  572. #############################################################################
  573. #
  574. # Header information
  575. #
  576. DATE=`date "$BTAG_DFMT"`
  577. print -u1 " BUILD SUMMARY FOR: $DATE"
  578. print -u1 " +++++++++++++++++++++++++++++++++++++"
  579. print -u1
  580. for r in $NOT_AVAILABLE_SUMMARY_FILES
  581. do
  582. print -u1 "Missing build summary: $r\n"
  583. done
  584. print -u1
  585. print_error_and_warning_summaries_by_project
  586. print -u1
  587. print_build_start_end
  588. print -u1
  589. print -u1
  590. print -u1 " BUILD PARAMETERS"
  591. print -u1 " ++++++++++++++++"
  592. print -u1
  593. print -u1
  594. print_build_parameters
  595. print -u1
  596. print -u1
  597. print -u1 " ERROR SUMMARIES BY COMPONENT"
  598. print -u1 " ++++++++++++++++++++++++++++"
  599. print -u1
  600. print -u1
  601. print_error_summaries_by_component
  602. #############################################################################
  603. #
  604. # Find the per component errors.
  605. #
  606. if [ $PRINT_ERRORS -gt 0 ]; then
  607. print -u1
  608. print -u1
  609. print -u1 " ERROR LISTINGS BY COMPONENT"
  610. print -u1 " +++++++++++++++++++++++++++"
  611. print -u1
  612. print -u1
  613. print_error_listings_by_component
  614. fi
  615. ##########################################################################
  616. #
  617. # Complete the build summary and mail it, save it, or dump it to stdout
  618. #
  619. if [ "" != "$MAIL_LIST" ]; then
  620. mailx -s "$SUBJECT_BUILD_SUMMARY (`date $SUBJECT_DATE`) [Report #${REPORT_NUM}]" "$MAIL_LIST" < $EXECUTIVE_SUMMARY_LOG
  621. fi
  622. if [ "" != "$LOG_PATH" ]; then
  623. cp $EXECUTIVE_SUMMARY_LOG $LOG_PATH
  624. fi
  625. if [ "$DEBUG" = "False" -a "" = "$MAIL_LIST" -a "" = "$LOG_PATH" ]; then
  626. exec >&9
  627. cat $EXECUTIVE_SUMMARY_LOG
  628. fi
  629. for r in $SUMMARY_FILES
  630. do
  631. is_complete_build $r
  632. if [ $? -ne 0 ]; then
  633. #
  634. # Clean up temporary files and exit
  635. #
  636. do_exit 1
  637. fi
  638. done
  639. #############################################################################
  640. #
  641. # Clean up temporary files and exit
  642. #
  643. do_exit 0