Hex Artifact Content

Artifact 58637ff4f932858b9c2ba5c5a5d399a825ff38b4:


0000: 23 21 20 2f 62 69 6e 2f 62 61 73 68 0a 0a 56 45  #! /bin/bash..VE
0010: 52 53 49 4f 4e 53 3d 22 38 2e 34 2e 31 39 20 38  RSIONS="8.4.19 8
0020: 2e 35 2e 39 20 63 76 73 5f 48 45 41 44 22 0a 0a  .5.9 cvs_HEAD"..
0030: 23 20 46 69 6e 64 20 74 68 65 20 62 61 73 65 20  # Find the base 
0040: 64 69 72 65 63 74 6f 72 79 0a 66 6f 72 20 78 20  directory.for x 
0050: 69 6e 20 31 20 32 20 33 20 5f 5f 66 61 69 6c 5f  in 1 2 3 __fail_
0060: 5f 3b 20 64 6f 0a 09 69 66 20 5b 20 22 24 7b 78  _; do..if [ "${x
0070: 7d 22 20 3d 20 22 24 7b 66 61 69 6c 7d 22 20 5d  }" = "${fail}" ]
0080: 3b 20 74 68 65 6e 0a 09 09 65 63 68 6f 20 27 55  ; then...echo 'U
0090: 6e 61 62 6c 65 20 74 6f 20 66 69 6e 64 20 4b 69  nable to find Ki
00a0: 74 43 72 65 61 74 6f 72 2c 20 61 62 6f 72 74 69  tCreator, aborti
00b0: 6e 67 2e 27 20 3e 26 32 0a 0a 09 09 65 78 69 74  ng.' >&2....exit
00c0: 20 31 0a 09 66 69 0a 0a 09 69 66 20 5b 20 2d 78   1..fi...if [ -x
00d0: 20 6b 69 74 63 72 65 61 74 6f 72 20 5d 3b 20 74   kitcreator ]; t
00e0: 68 65 6e 0a 09 09 62 72 65 61 6b 0a 09 66 69 0a  hen...break..fi.
00f0: 0a 09 63 64 20 2e 2e 0a 64 6f 6e 65 0a 0a 52 4f  ..cd ...done..RO
0100: 4f 54 44 49 52 3d 22 24 28 70 77 64 29 22 0a 54  OTDIR="$(pwd)".T
0110: 45 53 54 44 49 52 3d 22 24 7b 52 4f 4f 54 44 49  ESTDIR="${ROOTDI
0120: 52 7d 2f 62 75 69 6c 64 2f 74 65 73 74 22 0a 65  R}/build/test".e
0130: 78 70 6f 72 74 20 52 4f 4f 54 44 49 52 20 54 45  xport ROOTDIR TE
0140: 53 54 44 49 52 0a 0a 23 20 48 61 6e 64 6c 65 20  STDIR..# Handle 
0150: 63 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20 61 72 67  command-line arg
0160: 75 6d 65 6e 74 73 0a 69 66 20 5b 20 22 24 31 22  uments.if [ "$1"
0170: 20 3d 20 22 63 6c 65 61 6e 22 20 5d 3b 20 74 68   = "clean" ]; th
0180: 65 6e 0a 09 72 6d 20 2d 72 66 20 22 24 7b 54 45  en..rm -rf "${TE
0190: 53 54 44 49 52 7d 2f 6b 69 74 73 22 0a 66 69 0a  STDIR}/kits".fi.
01a0: 0a 23 20 43 72 65 61 74 65 20 70 6c 61 63 65 20  .# Create place 
01b0: 74 6f 20 70 75 74 20 6b 69 74 73 0a 6d 6b 64 69  to put kits.mkdi
01c0: 72 20 22 24 7b 54 45 53 54 44 49 52 7d 2f 6b 69  r "${TESTDIR}/ki
01d0: 74 73 22 20 3e 2f 64 65 76 2f 6e 75 6c 6c 20 32  ts" >/dev/null 2
01e0: 3e 2f 64 65 76 2f 6e 75 6c 6c 0a 6d 6b 64 69 72  >/dev/null.mkdir
01f0: 20 22 24 7b 54 45 53 54 44 49 52 7d 2f 6b 69 74   "${TESTDIR}/kit
0200: 73 2f 66 61 69 6c 65 64 22 20 3e 2f 64 65 76 2f  s/failed" >/dev/
0210: 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  null 2>/dev/null
0220: 0a 69 66 20 5b 20 21 20 2d 64 20 22 24 7b 54 45  .if [ ! -d "${TE
0230: 53 54 44 49 52 7d 2f 6b 69 74 73 22 20 5d 3b 20  STDIR}/kits" ]; 
0240: 74 68 65 6e 0a 09 65 63 68 6f 20 27 55 6e 61 62  then..echo 'Unab
0250: 6c 65 20 74 6f 20 63 72 65 61 74 65 20 6b 69 74  le to create kit
0260: 73 2f 20 64 69 72 65 63 74 6f 72 79 2c 20 61 62  s/ directory, ab
0270: 6f 72 74 69 6e 67 2e 27 20 3e 26 32 0a 0a 09 65  orting.' >&2...e
0280: 78 69 74 20 31 0a 66 69 0a 0a 23 20 43 6c 65 61  xit 1.fi..# Clea
0290: 6e 75 70 0a 66 6f 72 20 66 69 6c 65 20 69 6e 20  nup.for file in 
02a0: 22 24 7b 54 45 53 54 44 49 52 7d 22 2f 6b 69 74  "${TESTDIR}"/kit
02b0: 73 2f 2a 2e 6c 6f 67 3b 20 64 6f 0a 09 69 66 20  s/*.log; do..if 
02c0: 65 63 68 6f 20 22 24 7b 66 69 6c 65 7d 22 20 7c  echo "${file}" |
02d0: 20 67 72 65 70 20 2d 2d 20 27 2d 62 75 69 6c 64   grep -- '-build
02e0: 2e 6c 6f 67 24 27 20 3e 2f 64 65 76 2f 6e 75 6c  .log$' >/dev/nul
02f0: 6c 3b 20 74 68 65 6e 0a 09 09 63 6f 6e 74 69 6e  l; then...contin
0300: 75 65 0a 09 66 69 0a 0a 09 72 6d 20 2d 66 20 22  ue..fi...rm -f "
0310: 24 7b 66 69 6c 65 7d 22 0a 64 6f 6e 65 0a 0a 23  ${file}".done..#
0320: 20 53 74 61 72 74 20 58 76 66 62 20 66 6f 72 20   Start Xvfb for 
0330: 58 31 31 2d 62 61 73 65 64 20 74 65 73 74 73 0a  X11-based tests.
0340: 58 56 46 42 5f 50 49 44 3d 22 24 28 0a 09 58 76  XVFB_PID="$(..Xv
0350: 66 62 20 3a 33 31 20 2d 73 63 72 65 65 6e 20 30  fb :31 -screen 0
0360: 20 38 30 30 78 36 30 30 78 32 34 20 2d 6e 6f 6c   800x600x24 -nol
0370: 69 73 74 65 6e 20 74 63 70 20 3e 2f 64 65 76 2f  isten tcp >/dev/
0380: 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c  null 2>/dev/null
0390: 20 26 0a 09 65 63 68 6f 20 22 24 21 22 0a 29 22   &..echo "$!".)"
03a0: 0a 44 49 53 50 4c 41 59 3d 3a 33 31 0a 65 78 70  .DISPLAY=:31.exp
03b0: 6f 72 74 20 44 49 53 50 4c 41 59 0a 0a 66 61 69  ort DISPLAY..fai
03c0: 6c 65 64 3d 22 22 0a 66 6f 72 20 6b 69 74 20 69  led="".for kit i
03d0: 6e 20 6e 6f 72 6d 61 6c 20 6e 6f 72 6d 61 6c 2d  n normal normal-
03e0: 7a 69 70 20 6e 6f 72 6d 61 6c 2d 74 68 72 65 61  zip normal-threa
03f0: 64 65 64 20 6e 6f 72 6d 61 6c 2d 74 68 72 65 61  ded normal-threa
0400: 64 65 64 2d 7a 69 70 20 6e 6f 72 6d 61 6c 2d 73  ded-zip normal-s
0410: 74 61 74 69 63 74 6b 20 6e 6f 72 6d 61 6c 2d 6e  tatictk normal-n
0420: 6f 74 6b 20 6e 6f 72 6d 61 6c 2d 74 68 72 65 61  otk normal-threa
0430: 64 65 64 2d 6e 6f 74 6b 20 6e 6f 72 6d 61 6c 2d  ded-notk normal-
0440: 74 68 72 65 61 64 65 64 2d 7a 69 70 2d 6e 6f 74  threaded-zip-not
0450: 6b 20 6e 6f 72 6d 61 6c 2d 6e 6f 6d 6b 34 20 6d  k normal-nomk4 m
0460: 69 6e 20 6d 69 6e 2d 73 74 61 74 69 63 20 6e 6f  in min-static no
0470: 72 6d 61 6c 2d 6b 69 74 64 6c 6c 20 6e 6f 72 6d  rmal-kitdll norm
0480: 61 6c 2d 74 68 72 65 61 64 65 64 2d 6b 69 74 64  al-threaded-kitd
0490: 6c 6c 20 6e 6f 72 6d 61 6c 2d 6e 6f 74 6b 2d 6b  ll normal-notk-k
04a0: 69 74 64 6c 6c 20 6e 6f 72 6d 61 6c 2d 6e 6f 6d  itdll normal-nom
04b0: 6b 34 2d 6b 69 74 64 6c 6c 20 6e 6f 72 6d 61 6c  k4-kitdll normal
04c0: 2d 6e 6f 6d 6b 34 2d 6e 6f 74 6b 2d 6b 69 74 64  -nomk4-notk-kitd
04d0: 6c 6c 20 6e 6f 72 6d 61 6c 2d 74 68 72 65 61 64  ll normal-thread
04e0: 65 64 2d 6e 6f 6d 6b 34 2d 6b 69 74 64 6c 6c 20  ed-nomk4-kitdll 
04f0: 6e 6f 72 6d 61 6c 2d 74 68 72 65 61 64 65 64 2d  normal-threaded-
0500: 6e 6f 74 6b 2d 6e 6f 6d 6b 34 2d 6b 69 74 64 6c  notk-nomk4-kitdl
0510: 6c 20 6d 69 6e 2d 6b 69 74 64 6c 6c 20 77 69 6e  l min-kitdll win
0520: 33 32 2d 69 35 38 36 20 77 69 6e 33 32 2d 69 35  32-i586 win32-i5
0530: 38 36 2d 7a 69 70 20 77 69 6e 33 32 2d 69 35 38  86-zip win32-i58
0540: 36 2d 74 68 72 65 61 64 65 64 20 77 69 6e 33 32  6-threaded win32
0550: 2d 69 35 38 36 2d 74 68 72 65 61 64 65 64 2d 7a  -i586-threaded-z
0560: 69 70 20 77 69 6e 33 32 2d 69 35 38 36 2d 6e 6f  ip win32-i586-no
0570: 74 6b 20 77 69 6e 33 32 2d 69 35 38 36 2d 74 68  tk win32-i586-th
0580: 72 65 61 64 65 64 2d 6e 6f 74 6b 20 77 69 6e 33  readed-notk win3
0590: 32 2d 69 35 38 36 2d 6e 6f 6d 6b 34 20 77 69 6e  2-i586-nomk4 win
05a0: 33 32 2d 69 35 38 36 2d 6b 69 74 64 6c 6c 20 77  32-i586-kitdll w
05b0: 69 6e 33 32 2d 69 35 38 36 2d 74 68 72 65 61 64  in32-i586-thread
05c0: 65 64 2d 6b 69 74 64 6c 6c 20 77 69 6e 33 32 2d  ed-kitdll win32-
05d0: 69 35 38 36 2d 6e 6f 74 6b 2d 6b 69 74 64 6c 6c  i586-notk-kitdll
05e0: 20 77 69 6e 33 32 2d 69 35 38 36 2d 6e 6f 6d 6b   win32-i586-nomk
05f0: 34 2d 6b 69 74 64 6c 6c 20 77 69 6e 33 32 2d 69  4-kitdll win32-i
0600: 35 38 36 2d 6e 6f 6d 6b 34 2d 6e 6f 74 6b 2d 6b  586-nomk4-notk-k
0610: 69 74 64 6c 6c 20 77 69 6e 33 32 2d 69 35 38 36  itdll win32-i586
0620: 2d 74 68 72 65 61 64 65 64 2d 6e 6f 6d 6b 34 2d  -threaded-nomk4-
0630: 6b 69 74 64 6c 6c 20 77 69 6e 33 32 2d 69 35 38  kitdll win32-i58
0640: 36 2d 74 68 72 65 61 64 65 64 2d 6e 6f 74 6b 2d  6-threaded-notk-
0650: 6e 6f 6d 6b 34 2d 6b 69 74 64 6c 6c 20 6c 69 6e  nomk4-kitdll lin
0660: 75 78 2d 61 72 6d 2d 6d 69 6e 20 6c 69 6e 75 78  ux-arm-min linux
0670: 2d 61 72 6d 2d 6d 69 6e 2d 6b 69 74 64 6c 6c 3b  -arm-min-kitdll;
0680: 20 64 6f 0a 09 6b 69 74 63 72 65 61 74 6f 72 3d   do..kitcreator=
0690: 22 2e 2f 6b 69 74 63 72 65 61 74 6f 72 22 0a 09  "./kitcreator"..
06a0: 61 72 67 73 3d 22 22 0a 09 72 75 6e 6e 61 62 6c  args=""..runnabl
06b0: 65 3d 22 31 22 0a 09 69 73 7a 69 70 3d 22 30 22  e="1"..iszip="0"
06c0: 0a 09 73 74 61 74 69 63 74 6b 3d 22 30 22 0a 09  ..statictk="0"..
06d0: 6e 6f 74 6b 3d 22 30 22 0a 09 6e 6f 6d 6b 34 3d  notk="0"..nomk4=
06e0: 22 30 22 0a 09 78 63 6f 6d 70 69 6c 65 3d 22 30  "0"..xcompile="0
06f0: 22 0a 09 6b 69 74 64 6c 6c 3d 22 30 22 0a 09 6b  "..kitdll="0"..k
0700: 69 74 72 75 6e 63 6d 64 3d 22 22 0a 0a 09 23 20  itruncmd=""...# 
0710: 48 61 6e 64 6c 65 20 62 61 73 65 20 63 6f 6e 66  Handle base conf
0720: 69 67 75 72 61 74 69 6f 6e 0a 09 6f 73 3d 22 24  iguration..os="$
0730: 28 75 6e 61 6d 65 20 2d 73 20 7c 20 64 64 20 63  (uname -s | dd c
0740: 6f 6e 76 3d 6c 63 61 73 65 20 32 3e 2f 64 65 76  onv=lcase 2>/dev
0750: 2f 6e 75 6c 6c 29 22 0a 09 63 70 75 3d 22 24 28  /null)"..cpu="$(
0760: 75 6e 61 6d 65 20 2d 6d 20 7c 20 64 64 20 63 6f  uname -m | dd co
0770: 6e 76 3d 6c 63 61 73 65 20 32 3e 2f 64 65 76 2f  nv=lcase 2>/dev/
0780: 6e 75 6c 6c 29 22 0a 09 63 61 73 65 20 22 24 7b  null)"..case "${
0790: 6b 69 74 7d 22 20 69 6e 0a 09 09 6e 6f 72 6d 61  kit}" in...norma
07a0: 6c 7c 6e 6f 72 6d 61 6c 2d 2a 29 0a 09 09 09 6b  l|normal-*)....k
07b0: 69 74 3d 22 24 28 65 63 68 6f 20 22 24 7b 6b 69  it="$(echo "${ki
07c0: 74 7d 22 20 7c 20 73 65 64 20 22 73 40 5e 6e 6f  t}" | sed "s@^no
07d0: 72 6d 61 6c 40 24 6f 73 2d 24 63 70 75 40 22 29  rmal@$os-$cpu@")
07e0: 22 0a 09 09 09 3b 3b 0a 09 09 6d 69 6e 7c 6d 69  "....;;...min|mi
07f0: 6e 2d 6b 69 74 64 6c 6c 29 0a 09 09 09 6b 69 74  n-kitdll)....kit
0800: 63 72 65 61 74 6f 72 3d 22 2e 2f 62 75 69 6c 64  creator="./build
0810: 2f 6d 61 6b 65 2d 6d 69 6e 6b 69 74 22 0a 09 09  /make-minkit"...
0820: 09 69 73 7a 69 70 3d 22 31 22 0a 09 09 09 6e 6f  .iszip="1"....no
0830: 74 6b 3d 22 31 22 0a 09 09 09 6b 69 74 3d 22 24  tk="1"....kit="$
0840: 28 65 63 68 6f 20 22 24 7b 6b 69 74 7d 22 20 7c  (echo "${kit}" |
0850: 20 73 65 64 20 22 73 40 5e 6d 69 6e 40 24 6f 73   sed "s@^min@$os
0860: 2d 24 63 70 75 2d 6d 69 6e 40 22 29 22 0a 09 09  -$cpu-min@")"...
0870: 09 3b 3b 0a 09 09 6d 69 6e 2d 73 74 61 74 69 63  .;;...min-static
0880: 29 0a 09 09 09 6b 69 74 63 72 65 61 74 6f 72 3d  )....kitcreator=
0890: 22 2e 2f 62 75 69 6c 64 2f 6d 61 6b 65 2d 6d 69  "./build/make-mi
08a0: 6e 6b 69 74 2d 73 74 61 74 69 63 22 0a 09 09 09  nkit-static"....
08b0: 69 73 7a 69 70 3d 22 31 22 0a 09 09 09 6e 6f 74  iszip="1"....not
08c0: 6b 3d 22 31 22 0a 09 09 09 6b 69 74 3d 22 24 7b  k="1"....kit="${
08d0: 6f 73 7d 2d 24 7b 63 70 75 7d 2d 6d 69 6e 2d 73  os}-${cpu}-min-s
08e0: 74 61 74 69 63 22 0a 09 09 09 3b 3b 0a 09 09 77  tatic"....;;...w
08f0: 69 6e 33 32 7c 77 69 6e 33 32 2d 2a 29 0a 09 09  in32|win32-*)...
0900: 09 6b 69 74 63 72 65 61 74 6f 72 3d 22 2e 2f 62  .kitcreator="./b
0910: 75 69 6c 64 2f 6d 61 6b 65 2d 6b 69 74 2d 77 69  uild/make-kit-wi
0920: 6e 33 32 22 0a 09 09 09 78 63 6f 6d 70 69 6c 65  n32"....xcompile
0930: 3d 22 31 22 0a 09 09 09 6b 69 74 72 75 6e 63 6d  ="1"....kitruncm
0940: 64 3d 22 77 69 6e 65 22 0a 09 09 09 3b 3b 0a 09  d="wine"....;;..
0950: 09 6c 69 6e 75 78 2d 61 72 6d 2d 6d 69 6e 7c 6c  .linux-arm-min|l
0960: 69 6e 75 78 2d 61 72 6d 2d 6d 69 6e 2d 6b 69 74  inux-arm-min-kit
0970: 64 6c 6c 29 0a 09 09 09 6b 69 74 63 72 65 61 74  dll)....kitcreat
0980: 6f 72 3d 22 2e 2f 62 75 69 6c 64 2f 6d 61 6b 65  or="./build/make
0990: 2d 6b 69 74 2d 61 72 6d 22 0a 09 09 09 72 75 6e  -kit-arm"....run
09a0: 6e 61 62 6c 65 3d 22 30 22 0a 09 09 09 78 63 6f  nable="0"....xco
09b0: 6d 70 69 6c 65 3d 22 31 22 0a 09 09 09 6e 6f 74  mpile="1"....not
09c0: 6b 3d 22 31 22 0a 09 09 09 69 73 7a 69 70 3d 22  k="1"....iszip="
09d0: 31 22 0a 09 09 09 3b 3b 0a 09 65 73 61 63 0a 0a  1"....;;..esac..
09e0: 09 69 66 20 5b 20 22 24 7b 78 63 6f 6d 70 69 6c  .if [ "${xcompil
09f0: 65 7d 22 20 21 3d 20 22 30 22 20 5d 3b 20 74 68  e}" != "0" ]; th
0a00: 65 6e 0a 09 09 6b 69 74 3d 22 24 7b 6b 69 74 7d  en...kit="${kit}
0a10: 2d 78 63 6f 6d 70 69 6c 65 22 0a 09 66 69 0a 0a  -xcompile"..fi..
0a20: 09 23 20 48 61 6e 64 6c 65 20 61 64 64 69 74 69  .# Handle additi
0a30: 6f 6e 61 6c 20 63 6f 6e 66 69 67 75 72 61 74 69  onal configurati
0a40: 6f 6e 0a 09 74 65 6d 70 6b 69 74 3d 22 2d 24 7b  on..tempkit="-${
0a50: 6b 69 74 7d 2d 22 0a 09 66 6f 72 20 74 72 79 20  kit}-"..for try 
0a60: 69 6e 20 31 20 32 20 33 20 34 20 35 20 36 20 37  in 1 2 3 4 5 6 7
0a70: 20 38 20 39 3b 20 64 6f 0a 09 09 63 61 73 65 20   8 9; do...case 
0a80: 22 2d 24 7b 74 65 6d 70 6b 69 74 7d 2d 22 20 69  "-${tempkit}-" i
0a90: 6e 0a 09 09 09 2a 2d 74 68 72 65 61 64 65 64 2d  n....*-threaded-
0aa0: 2a 29 0a 09 09 09 09 74 65 6d 70 6b 69 74 3d 22  *).....tempkit="
0ab0: 24 28 65 63 68 6f 20 22 24 7b 74 65 6d 70 6b 69  $(echo "${tempki
0ac0: 74 7d 22 20 7c 20 73 65 64 20 27 73 40 2d 74 68  t}" | sed 's@-th
0ad0: 72 65 61 64 65 64 2d 40 2d 40 27 29 22 0a 09 09  readed-@-@')"...
0ae0: 09 09 61 72 67 73 3d 22 24 7b 61 72 67 73 7d 20  ..args="${args} 
0af0: 2d 2d 65 6e 61 62 6c 65 2d 74 68 72 65 61 64 73  --enable-threads
0b00: 22 0a 09 09 09 09 3b 3b 0a 09 09 09 2a 2d 7a 69  ".....;;....*-zi
0b10: 70 2d 2a 29 0a 09 09 09 09 74 65 6d 70 6b 69 74  p-*).....tempkit
0b20: 3d 22 24 28 65 63 68 6f 20 22 24 7b 74 65 6d 70  ="$(echo "${temp
0b30: 6b 69 74 7d 22 20 7c 20 73 65 64 20 27 73 40 2d  kit}" | sed 's@-
0b40: 7a 69 70 2d 40 2d 40 27 29 22 0a 09 09 09 09 61  zip-@-@')".....a
0b50: 72 67 73 3d 22 24 7b 61 72 67 73 7d 20 2d 2d 65  rgs="${args} --e
0b60: 6e 61 62 6c 65 2d 6b 69 74 2d 73 74 6f 72 61 67  nable-kit-storag
0b70: 65 3d 7a 69 70 22 0a 09 09 09 09 69 73 7a 69 70  e=zip".....iszip
0b80: 3d 22 31 22 0a 09 09 09 09 3b 3b 0a 09 09 09 2a  ="1".....;;....*
0b90: 2d 73 74 61 74 69 63 74 6b 2d 2a 29 0a 09 09 09  -statictk-*)....
0ba0: 09 74 65 6d 70 6b 69 74 3d 22 24 28 65 63 68 6f  .tempkit="$(echo
0bb0: 20 22 24 7b 74 65 6d 70 6b 69 74 7d 22 20 7c 20   "${tempkit}" | 
0bc0: 73 65 64 20 27 73 40 2d 73 74 61 74 69 63 74 6b  sed 's@-statictk
0bd0: 2d 40 2d 40 27 29 22 0a 09 09 09 09 69 66 20 5b  -@-@')".....if [
0be0: 20 22 24 7b 6e 6f 74 6b 7d 22 20 3d 20 22 30 22   "${notk}" = "0"
0bf0: 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 09 73 74   ]; then......st
0c00: 61 74 69 63 74 6b 3d 22 31 22 0a 09 09 09 09 65  atictk="1".....e
0c10: 6c 73 65 0a 09 09 09 09 09 65 63 68 6f 20 22 24  lse......echo "$
0c20: 7b 6b 69 74 7d 3a 20 55 6e 61 62 6c 65 20 74 6f  {kit}: Unable to
0c30: 20 63 72 65 61 74 65 20 53 74 61 74 69 63 54 6b   create StaticTk
0c40: 20 61 6e 64 20 4e 6f 54 6b 2c 20 69 67 6e 6f 72   and NoTk, ignor
0c50: 69 6e 67 20 53 74 61 74 69 63 54 6b 22 20 3e 26  ing StaticTk" >&
0c60: 32 0a 09 09 09 09 66 69 0a 09 09 09 09 3b 3b 0a  2.....fi.....;;.
0c70: 09 09 09 2a 2d 6e 6f 74 6b 2d 2a 29 0a 09 09 09  ...*-notk-*)....
0c80: 09 74 65 6d 70 6b 69 74 3d 22 24 28 65 63 68 6f  .tempkit="$(echo
0c90: 20 22 24 7b 74 65 6d 70 6b 69 74 7d 22 20 7c 20   "${tempkit}" | 
0ca0: 73 65 64 20 27 73 40 2d 6e 6f 74 6b 2d 40 2d 40  sed 's@-notk-@-@
0cb0: 27 29 22 0a 09 09 09 09 69 66 20 5b 20 22 24 7b  ')".....if [ "${
0cc0: 73 74 61 74 69 63 74 6b 7d 22 20 3d 20 22 30 22  statictk}" = "0"
0cd0: 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 09 6e 6f   ]; then......no
0ce0: 74 6b 3d 22 31 22 0a 09 09 09 09 65 6c 73 65 0a  tk="1".....else.
0cf0: 09 09 09 09 09 65 63 68 6f 20 22 24 7b 6b 69 74  .....echo "${kit
0d00: 7d 3a 20 55 6e 61 62 6c 65 20 74 6f 20 63 72 65  }: Unable to cre
0d10: 61 74 65 20 53 74 61 74 69 63 54 6b 20 61 6e 64  ate StaticTk and
0d20: 20 4e 6f 54 6b 2c 20 69 67 6e 6f 72 69 6e 67 20   NoTk, ignoring 
0d30: 4e 6f 54 6b 22 20 3e 26 32 0a 09 09 09 09 66 69  NoTk" >&2.....fi
0d40: 0a 09 09 09 09 3b 3b 0a 09 09 09 2a 2d 6e 6f 6d  .....;;....*-nom
0d50: 6b 34 2d 2a 29 0a 09 09 09 09 74 65 6d 70 6b 69  k4-*).....tempki
0d60: 74 3d 22 24 28 65 63 68 6f 20 22 24 7b 74 65 6d  t="$(echo "${tem
0d70: 70 6b 69 74 7d 22 20 7c 20 73 65 64 20 27 73 40  pkit}" | sed 's@
0d80: 2d 6e 6f 6d 6b 34 2d 40 2d 40 27 29 22 0a 09 09  -nomk4-@-@')"...
0d90: 09 09 6e 6f 6d 6b 34 3d 22 31 22 0a 09 09 09 09  ..nomk4="1".....
0da0: 69 73 7a 69 70 3d 22 31 22 0a 09 09 09 09 3b 3b  iszip="1".....;;
0db0: 0a 09 09 09 2a 2d 6b 69 74 64 6c 6c 2d 2a 29 0a  ....*-kitdll-*).
0dc0: 09 09 09 09 6b 69 74 64 6c 6c 3d 22 31 22 0a 09  ....kitdll="1"..
0dd0: 09 09 09 3b 3b 0a 09 09 65 73 61 63 0a 09 64 6f  ...;;...esac..do
0de0: 6e 65 0a 0a 09 69 66 20 5b 20 22 24 7b 6b 69 74  ne...if [ "${kit
0df0: 64 6c 6c 7d 22 20 3d 20 22 31 22 20 5d 3b 20 74  dll}" = "1" ]; t
0e00: 68 65 6e 0a 09 09 23 20 43 75 72 72 65 6e 74 6c  hen...# Currentl
0e10: 79 20 6e 6f 20 4b 69 74 44 4c 4c 20 75 73 65 73  y no KitDLL uses
0e20: 20 5a 69 70 0a 09 09 69 73 7a 69 70 3d 22 30 22   Zip...iszip="0"
0e30: 0a 09 66 69 0a 0a 09 66 6f 72 20 76 65 72 73 69  ..fi...for versi
0e40: 6f 6e 20 69 6e 20 24 7b 56 45 52 53 49 4f 4e 53  on in ${VERSIONS
0e50: 7d 3b 20 64 6f 0a 09 09 23 20 57 6f 72 6b 20 61  }; do...# Work a
0e60: 72 6f 75 6e 64 20 63 68 61 6e 67 65 73 20 69 6e  round changes in
0e70: 20 64 65 66 61 75 6c 74 20 62 65 68 61 76 69 6f   default behavio
0e80: 75 72 0a 09 09 69 66 20 5b 20 22 24 7b 76 65 72  ur...if [ "${ver
0e90: 73 69 6f 6e 7d 22 20 3d 20 22 63 76 73 5f 48 45  sion}" = "cvs_HE
0ea0: 41 44 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 6b  AD" ]; then....k
0eb0: 69 74 3d 22 24 28 65 63 68 6f 20 22 24 7b 6b 69  it="$(echo "${ki
0ec0: 74 7d 22 20 7c 20 73 65 64 20 27 73 40 2d 74 68  t}" | sed 's@-th
0ed0: 72 65 61 64 65 64 40 2d 75 6e 74 68 72 65 61 64  readed@-unthread
0ee0: 65 64 40 27 29 22 0a 09 09 09 61 72 67 73 3d 22  ed@')"....args="
0ef0: 24 28 65 63 68 6f 20 22 24 7b 61 72 67 73 7d 22  $(echo "${args}"
0f00: 20 7c 20 73 65 64 20 27 73 40 20 2d 2d 65 6e 61   | sed 's@ --ena
0f10: 62 6c 65 2d 74 68 72 65 61 64 73 40 20 2d 2d 64  ble-threads@ --d
0f20: 69 73 61 62 6c 65 2d 74 68 72 65 61 64 73 40 27  isable-threads@'
0f30: 29 22 0a 09 09 66 69 0a 0a 09 09 23 20 43 72 65  )"...fi....# Cre
0f40: 61 74 65 20 54 63 6c 6b 69 74 0a 09 09 69 66 20  ate Tclkit...if 
0f50: 5b 20 22 24 7b 6b 69 74 64 6c 6c 7d 22 20 3d 20  [ "${kitdll}" = 
0f60: 22 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 63  "1" ]; then....c
0f70: 72 65 61 74 65 64 6b 69 74 3d 22 6c 69 62 74 63  reatedkit="libtc
0f80: 6c 6b 69 74 2a 2e 64 6c 6c 20 6c 69 62 74 63 6c  lkit*.dll libtcl
0f90: 6b 69 74 2a 2e 2a 22 0a 09 09 09 6f 75 74 70 75  kit*.*"....outpu
0fa0: 74 6e 61 6d 65 3d 22 24 7b 54 45 53 54 44 49 52  tname="${TESTDIR
0fb0: 7d 2f 6b 69 74 73 2f 6c 69 62 74 63 6c 6b 69 74  }/kits/libtclkit
0fc0: 2d 24 7b 76 65 72 73 69 6f 6e 7d 2d 24 7b 6b 69  -${version}-${ki
0fd0: 74 7d 22 0a 09 09 09 66 61 69 6c 6f 75 74 70 75  t}"....failoutpu
0fe0: 74 6e 61 6d 65 3d 22 24 7b 54 45 53 54 44 49 52  tname="${TESTDIR
0ff0: 7d 2f 6b 69 74 73 2f 66 61 69 6c 65 64 2f 6c 69  }/kits/failed/li
1000: 62 74 63 6c 6b 69 74 2d 24 7b 76 65 72 73 69 6f  btclkit-${versio
1010: 6e 7d 2d 24 7b 6b 69 74 7d 22 0a 09 09 65 6c 73  n}-${kit}"...els
1020: 65 0a 09 09 09 63 72 65 61 74 65 64 6b 69 74 3d  e....createdkit=
1030: 22 74 63 6c 6b 69 74 2d 24 7b 76 65 72 73 69 6f  "tclkit-${versio
1040: 6e 7d 22 0a 09 09 09 6f 75 74 70 75 74 6e 61 6d  n}"....outputnam
1050: 65 3d 22 24 7b 54 45 53 54 44 49 52 7d 2f 6b 69  e="${TESTDIR}/ki
1060: 74 73 2f 74 63 6c 6b 69 74 2d 24 7b 76 65 72 73  ts/tclkit-${vers
1070: 69 6f 6e 7d 2d 24 7b 6b 69 74 7d 22 0a 09 09 09  ion}-${kit}"....
1080: 66 61 69 6c 6f 75 74 70 75 74 6e 61 6d 65 3d 22  failoutputname="
1090: 24 7b 54 45 53 54 44 49 52 7d 2f 6b 69 74 73 2f  ${TESTDIR}/kits/
10a0: 66 61 69 6c 65 64 2f 74 63 6c 6b 69 74 2d 24 7b  failed/tclkit-${
10b0: 76 65 72 73 69 6f 6e 7d 2d 24 7b 6b 69 74 7d 22  version}-${kit}"
10c0: 0a 09 09 66 69 0a 09 09 62 75 69 6c 64 6c 6f 67  ...fi...buildlog
10d0: 3d 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 2d  ="${outputname}-
10e0: 62 75 69 6c 64 2e 6c 6f 67 22 0a 09 09 66 61 69  build.log"...fai
10f0: 6c 62 75 69 6c 64 6c 6f 67 3d 22 24 7b 66 61 69  lbuildlog="${fai
1100: 6c 6f 75 74 70 75 74 6e 61 6d 65 7d 2d 62 75 69  loutputname}-bui
1110: 6c 64 2e 6c 6f 67 22 0a 09 09 74 65 73 74 72 65  ld.log"...testre
1120: 73 75 6c 74 73 6c 6f 67 3d 22 24 7b 6f 75 74 70  sultslog="${outp
1130: 75 74 6e 61 6d 65 7d 2d 74 65 73 74 73 2e 6c 6f  utname}-tests.lo
1140: 67 22 0a 0a 09 09 69 66 20 5b 20 21 20 2d 66 20  g"....if [ ! -f 
1150: 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 22 20  "${outputname}" 
1160: 5d 3b 20 74 68 65 6e 0a 09 09 09 75 6e 73 65 74  ]; then....unset
1170: 20 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b 47 53   KITCREATOR_PKGS
1180: 20 53 54 41 54 49 43 54 4b 0a 0a 09 09 09 69 66   STATICTK.....if
1190: 20 5b 20 2d 66 20 22 24 7b 66 61 69 6c 6f 75 74   [ -f "${failout
11a0: 70 75 74 6e 61 6d 65 7d 22 20 5d 3b 20 74 68 65  putname}" ]; the
11b0: 6e 0a 09 09 09 09 65 63 68 6f 20 22 53 6b 69 70  n.....echo "Skip
11c0: 70 69 6e 67 20 72 65 62 75 69 6c 64 69 6e 67 20  ping rebuilding 
11d0: 66 61 69 6c 65 64 20 6b 69 74 20 24 7b 76 65 72  failed kit ${ver
11e0: 73 69 6f 6e 7d 2f 24 7b 6b 69 74 7d 20 2e 2e 2e  sion}/${kit} ...
11f0: 22 0a 0a 09 09 09 09 66 61 69 6c 65 64 3d 22 24  "......failed="$
1200: 7b 66 61 69 6c 65 64 7d 20 24 7b 76 65 72 73 69  {failed} ${versi
1210: 6f 6e 7d 2f 24 7b 6b 69 74 7d 2d 62 75 69 6c 64  on}/${kit}-build
1220: 22 0a 0a 09 09 09 09 63 6f 6e 74 69 6e 75 65 0a  "......continue.
1230: 09 09 09 66 69 0a 0a 09 09 09 72 6d 20 2d 66 20  ...fi.....rm -f 
1240: 74 63 6c 73 68 0a 09 09 09 2e 2f 6b 69 74 63 72  tclsh...../kitcr
1250: 65 61 74 6f 72 20 63 6c 65 61 6e 20 3e 2f 64 65  eator clean >/de
1260: 76 2f 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f 6e 75  v/null 2>/dev/nu
1270: 6c 6c 0a 0a 09 09 09 65 63 68 6f 20 22 43 72 65  ll.....echo "Cre
1280: 61 74 69 6e 67 20 54 63 6c 6b 69 74 20 24 7b 76  ating Tclkit ${v
1290: 65 72 73 69 6f 6e 7d 2f 24 7b 6b 69 74 7d 2e 2e  ersion}/${kit}..
12a0: 2e 22 0a 09 09 09 65 63 68 6f 20 22 20 2a 2a 2a  ."....echo " ***
12b0: 20 42 75 69 6c 64 20 73 74 61 72 74 65 64 20 24   Build started $
12c0: 28 77 68 6f 61 6d 69 29 40 24 28 68 6f 73 74 6e  (whoami)@$(hostn
12d0: 61 6d 65 29 20 6f 6e 20 24 28 64 61 74 65 29 22  ame) on $(date)"
12e0: 20 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22   > "${buildlog}"
12f0: 0a 09 09 09 65 63 68 6f 20 27 27 20 3e 3e 20 22  ....echo '' >> "
1300: 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09 09  ${buildlog}"....
1310: 65 63 68 6f 20 22 20 2a 2a 2a 20 42 75 69 6c 64  echo " *** Build
1320: 20 53 63 72 69 70 74 22 20 3e 3e 20 22 24 7b 62   Script" >> "${b
1330: 75 69 6c 64 6c 6f 67 7d 22 0a 0a 09 09 09 69 66  uildlog}".....if
1340: 20 5b 20 22 24 7b 6e 6f 74 6b 7d 22 20 3d 20 22   [ "${notk}" = "
1350: 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 4b  1" ]; then.....K
1360: 49 54 43 52 45 41 54 4f 52 5f 50 4b 47 53 3d 27  ITCREATOR_PKGS='
1370: 69 74 63 6c 20 6d 6b 34 74 63 6c 27 0a 09 09 09  itcl mk4tcl'....
1380: 66 69 0a 0a 09 09 09 69 66 20 5b 20 22 24 7b 6e  fi.....if [ "${n
1390: 6f 6d 6b 34 7d 22 20 3d 20 22 31 22 20 5d 3b 20  omk4}" = "1" ]; 
13a0: 74 68 65 6e 0a 09 09 09 09 69 66 20 5b 20 2d 7a  then.....if [ -z
13b0: 20 22 24 7b 4b 49 54 43 52 45 41 54 4f 52 5f 50   "${KITCREATOR_P
13c0: 4b 47 53 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 09  KGS}" ]; then...
13d0: 09 09 09 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b  ...KITCREATOR_PK
13e0: 47 53 3d 27 69 74 63 6c 20 74 6b 27 0a 09 09 09  GS='itcl tk'....
13f0: 09 65 6c 73 65 0a 09 09 09 09 09 4b 49 54 43 52  .else......KITCR
1400: 45 41 54 4f 52 5f 50 4b 47 53 3d 22 24 28 65 63  EATOR_PKGS="$(ec
1410: 68 6f 20 22 24 7b 4b 49 54 43 52 45 41 54 4f 52  ho "${KITCREATOR
1420: 5f 50 4b 47 53 7d 22 20 7c 20 73 65 64 20 27 73  _PKGS}" | sed 's
1430: 40 6d 6b 34 74 63 6c 40 40 27 29 22 0a 09 09 09  @mk4tcl@@')"....
1440: 09 66 69 0a 09 09 09 66 69 0a 0a 09 09 09 69 66  .fi....fi.....if
1450: 20 5b 20 22 24 7b 6b 69 74 64 6c 6c 7d 22 20 3d   [ "${kitdll}" =
1460: 20 22 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09   "1" ]; then....
1470: 09 69 66 20 5b 20 2d 7a 20 22 24 7b 4b 49 54 43  .if [ -z "${KITC
1480: 52 45 41 54 4f 52 5f 50 4b 47 53 7d 22 20 5d 3b  REATOR_PKGS}" ];
1490: 20 74 68 65 6e 0a 09 09 09 09 09 4b 49 54 43 52   then......KITCR
14a0: 45 41 54 4f 52 5f 50 4b 47 53 3d 27 74 6b 20 69  EATOR_PKGS='tk i
14b0: 74 63 6c 20 6d 6b 34 74 63 6c 20 6b 69 74 64 6c  tcl mk4tcl kitdl
14c0: 6c 27 0a 09 09 09 09 65 6c 73 65 0a 09 09 09 09  l'.....else.....
14d0: 09 4b 49 54 43 52 45 41 54 4f 52 5f 50 4b 47 53  .KITCREATOR_PKGS
14e0: 3d 22 24 7b 4b 49 54 43 52 45 41 54 4f 52 5f 50  ="${KITCREATOR_P
14f0: 4b 47 53 7d 20 6b 69 74 64 6c 6c 22 0a 09 09 09  KGS} kitdll"....
1500: 09 66 69 0a 09 09 09 66 69 0a 0a 09 09 09 65 78  .fi....fi.....ex
1510: 70 6f 72 74 20 4b 49 54 43 52 45 41 54 4f 52 5f  port KITCREATOR_
1520: 50 4b 47 53 0a 0a 09 09 09 69 66 20 5b 20 2d 6e  PKGS.....if [ -n
1530: 20 22 24 7b 4b 49 54 43 52 45 41 54 4f 52 5f 50   "${KITCREATOR_P
1540: 4b 47 53 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 09  KGS}" ]; then...
1550: 09 09 65 63 68 6f 20 22 20 20 4b 49 54 43 52 45  ..echo "  KITCRE
1560: 41 54 4f 52 5f 50 4b 47 53 3d 5c 22 24 7b 4b 49  ATOR_PKGS=\"${KI
1570: 54 43 52 45 41 54 4f 52 5f 50 4b 47 53 7d 5c 22  TCREATOR_PKGS}\"
1580: 22 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67  " >> "${buildlog
1590: 7d 22 0a 09 09 09 09 65 63 68 6f 20 22 20 20 65  }".....echo "  e
15a0: 78 70 6f 72 74 20 4b 49 54 43 52 45 41 54 4f 52  xport KITCREATOR
15b0: 5f 50 4b 47 53 22 20 3e 3e 20 22 24 7b 62 75 69  _PKGS" >> "${bui
15c0: 6c 64 6c 6f 67 7d 22 0a 09 09 09 66 69 0a 0a 09  ldlog}"....fi...
15d0: 09 09 69 66 20 5b 20 22 24 7b 73 74 61 74 69 63  ..if [ "${static
15e0: 74 6b 7d 22 20 3d 20 22 31 22 20 5d 3b 20 74 68  tk}" = "1" ]; th
15f0: 65 6e 0a 09 09 09 09 53 54 41 54 49 43 54 4b 3d  en.....STATICTK=
1600: 22 31 22 0a 09 09 09 09 65 78 70 6f 72 74 20 53  "1".....export S
1610: 54 41 54 49 43 54 4b 0a 0a 09 09 09 09 65 63 68  TATICTK......ech
1620: 6f 20 22 20 20 53 54 41 54 49 43 54 4b 3d 5c 22  o "  STATICTK=\"
1630: 24 7b 53 54 41 54 49 43 54 4b 7d 5c 22 22 20 3e  ${STATICTK}\"" >
1640: 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a  > "${buildlog}".
1650: 09 09 09 09 65 63 68 6f 20 22 20 20 65 78 70 6f  ....echo "  expo
1660: 72 74 20 53 54 41 54 49 43 54 4b 22 20 3e 3e 20  rt STATICTK" >> 
1670: 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09  "${buildlog}"...
1680: 09 66 69 0a 0a 09 09 09 69 66 20 5b 20 22 24 7b  .fi.....if [ "${
1690: 6b 69 74 63 72 65 61 74 6f 72 7d 22 20 21 3d 20  kitcreator}" != 
16a0: 22 2e 2f 6b 69 74 63 72 65 61 74 6f 72 22 20 5d  "./kitcreator" ]
16b0: 3b 20 74 68 65 6e 0a 09 09 09 09 65 63 68 6f 20  ; then.....echo 
16c0: 22 20 20 6d 6b 64 69 72 20 62 75 69 6c 64 22 20  "  mkdir build" 
16d0: 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22  >> "${buildlog}"
16e0: 0a 0a 09 09 09 09 23 20 53 65 76 65 72 61 6c 20  ......# Several 
16f0: 62 75 69 6c 64 20 73 63 72 69 70 74 73 20 72 65  build scripts re
1700: 6c 79 20 6f 6e 20 6d 69 6e 6b 69 74 20 74 6f 20  ly on minkit to 
1710: 77 6f 72 6b 0a 09 09 09 09 69 66 20 67 72 65 70  work.....if grep
1720: 20 27 2e 2f 62 75 69 6c 64 2f 6d 61 6b 65 2d 6d   './build/make-m
1730: 69 6e 6b 69 74 27 20 22 24 7b 6b 69 74 63 72 65  inkit' "${kitcre
1740: 61 74 6f 72 7d 22 20 3e 2f 64 65 76 2f 6e 75 6c  ator}" >/dev/nul
1750: 6c 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 3b 20 74  l 2>/dev/null; t
1760: 68 65 6e 0a 09 09 09 09 09 65 63 68 6f 20 22 20  hen......echo " 
1770: 20 63 61 74 20 3c 3c 20 5c 5f 5f 45 4f 46 5f 5f   cat << \__EOF__
1780: 20 3e 20 2e 2f 62 75 69 6c 64 2f 6d 61 6b 65 2d   > ./build/make-
1790: 6d 69 6e 6b 69 74 22 20 3e 3e 20 22 24 7b 62 75  minkit" >> "${bu
17a0: 69 6c 64 6c 6f 67 7d 22 0a 09 09 09 09 09 73 65  ildlog}"......se
17b0: 64 20 27 73 40 5e 40 20 20 40 27 20 20 27 2e 2f  d 's@^@  @'  './
17c0: 62 75 69 6c 64 2f 6d 61 6b 65 2d 6d 69 6e 6b 69  build/make-minki
17d0: 74 27 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f  t' >> "${buildlo
17e0: 67 7d 22 0a 09 09 09 09 09 65 63 68 6f 20 22 20  g}"......echo " 
17f0: 20 5f 5f 45 4f 46 5f 5f 22 20 3e 3e 20 22 24 7b   __EOF__" >> "${
1800: 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09 09 09 09  buildlog}"......
1810: 65 63 68 6f 20 27 27 20 3e 3e 20 22 24 7b 62 75  echo '' >> "${bu
1820: 69 6c 64 6c 6f 67 7d 22 0a 09 09 09 09 66 69 0a  ildlog}".....fi.
1830: 09 09 09 09 65 63 68 6f 20 22 20 20 63 61 74 20  ....echo "  cat 
1840: 3c 3c 20 5c 5f 5f 45 4f 46 5f 5f 20 3e 20 24 7b  << \__EOF__ > ${
1850: 6b 69 74 63 72 65 61 74 6f 72 7d 22 20 3e 3e 20  kitcreator}" >> 
1860: 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09  "${buildlog}"...
1870: 09 09 73 65 64 20 27 73 40 5e 40 20 20 40 27 20  ..sed 's@^@  @' 
1880: 20 22 24 7b 6b 69 74 63 72 65 61 74 6f 72 7d 22   "${kitcreator}"
1890: 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d   >> "${buildlog}
18a0: 22 0a 09 09 09 09 65 63 68 6f 20 22 20 20 5f 5f  ".....echo "  __
18b0: 45 4f 46 5f 5f 22 20 3e 3e 20 22 24 7b 62 75 69  EOF__" >> "${bui
18c0: 6c 64 6c 6f 67 7d 22 0a 09 09 09 09 65 63 68 6f  ldlog}".....echo
18d0: 20 27 27 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c   '' >> "${buildl
18e0: 6f 67 7d 22 0a 09 09 09 66 69 0a 09 09 09 65 63  og}"....fi....ec
18f0: 68 6f 20 22 20 20 5c 22 24 7b 6b 69 74 63 72 65  ho "  \"${kitcre
1900: 61 74 6f 72 7d 5c 22 20 5c 22 24 7b 76 65 72 73  ator}\" \"${vers
1910: 69 6f 6e 7d 5c 22 20 24 7b 61 72 67 73 7d 22 20  ion}\" ${args}" 
1920: 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22  >> "${buildlog}"
1930: 0a 09 09 09 65 63 68 6f 20 27 27 20 3e 3e 20 22  ....echo '' >> "
1940: 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 09 09 09  ${buildlog}"....
1950: 65 63 68 6f 20 27 27 20 3e 3e 20 22 24 7b 62 75  echo '' >> "${bu
1960: 69 6c 64 6c 6f 67 7d 22 0a 09 09 09 65 63 68 6f  ildlog}"....echo
1970: 20 27 27 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c   '' >> "${buildl
1980: 6f 67 7d 22 0a 09 09 09 65 63 68 6f 20 22 20 2a  og}"....echo " *
1990: 2a 2a 20 42 75 69 6c 64 20 52 65 73 75 6c 74 73  ** Build Results
19a0: 22 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67  " >> "${buildlog
19b0: 7d 22 0a 09 09 09 65 63 68 6f 20 27 27 20 3e 3e  }"....echo '' >>
19c0: 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 0a 0a   "${buildlog}"..
19d0: 09 09 09 62 75 69 6c 64 66 61 69 6c 65 64 3d 22  ...buildfailed="
19e0: 30 22 0a 09 09 09 22 24 7b 6b 69 74 63 72 65 61  0"...."${kitcrea
19f0: 74 6f 72 7d 22 20 22 24 7b 76 65 72 73 69 6f 6e  tor}" "${version
1a00: 7d 22 20 24 7b 61 72 67 73 7d 20 3e 3e 20 22 24  }" ${args} >> "$
1a10: 7b 62 75 69 6c 64 6c 6f 67 7d 22 20 32 3e 26 31  {buildlog}" 2>&1
1a20: 20 7c 7c 20 62 75 69 6c 64 66 61 69 6c 65 64 3d   || buildfailed=
1a30: 22 31 22 0a 09 09 09 67 72 65 70 20 2d 6e 20 27  "1"....grep -n '
1a40: 5e 27 20 2a 2f 62 75 69 6c 64 2e 6c 6f 67 20 3e  ^' */build.log >
1a50: 3e 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22 20  > "${buildlog}" 
1a60: 32 3e 26 31 0a 0a 09 09 09 69 66 20 5b 20 22 24  2>&1.....if [ "$
1a70: 7b 6b 69 74 64 6c 6c 7d 22 20 3d 20 22 31 22 20  {kitdll}" = "1" 
1a80: 5d 3b 20 74 68 65 6e 0a 09 09 09 09 23 20 43 72  ]; then.....# Cr
1a90: 65 61 74 65 20 74 65 73 74 20 64 72 69 76 65 72  eate test driver
1aa0: 73 20 66 6f 72 20 4b 69 74 44 4c 4c 0a 09 09 09  s for KitDLL....
1ab0: 09 28 0a 09 09 09 09 09 65 63 68 6f 20 22 22 0a  .(......echo "".
1ac0: 09 09 09 09 09 65 63 68 6f 20 22 22 0a 09 09 09  .....echo ""....
1ad0: 09 09 65 63 68 6f 20 22 22 0a 09 09 09 09 09 65  ..echo ""......e
1ae0: 63 68 6f 20 22 20 2a 2a 2a 20 42 75 69 6c 64 69  cho " *** Buildi
1af0: 6e 67 20 4b 69 74 44 4c 4c 20 74 65 73 74 20 64  ng KitDLL test d
1b00: 72 69 76 65 72 20 28 74 63 6c 73 68 29 22 0a 09  river (tclsh)"..
1b10: 09 09 09 09 65 63 68 6f 20 22 22 0a 0a 09 09 09  ....echo "".....
1b20: 09 09 63 64 20 6b 69 74 64 6c 6c 2f 62 75 69 6c  ..cd kitdll/buil
1b30: 64 2f 6b 69 74 64 6c 6c 2d 2a 2f 20 7c 7c 20 65  d/kitdll-*/ || e
1b40: 78 69 74 20 31 0a 09 09 09 09 09 6d 61 6b 65 20  xit 1......make 
1b50: 74 63 6c 73 68 0a 09 09 09 09 09 63 70 20 74 63  tclsh......cp tc
1b60: 6c 73 68 20 2e 2e 2f 2e 2e 2f 2e 2e 2f 0a 09 09  lsh ../../../...
1b70: 09 09 29 20 3e 3e 20 22 24 7b 62 75 69 6c 64 6c  ..) >> "${buildl
1b80: 6f 67 7d 22 20 32 3e 26 31 0a 09 09 09 66 69 0a  og}" 2>&1....fi.
1b90: 0a 09 09 09 23 20 50 65 72 66 6f 72 6d 20 77 69  ....# Perform wi
1ba0: 6c 64 63 61 72 64 20 65 78 70 61 6e 73 69 6f 6e  ldcard expansion
1bb0: 0a 09 09 09 63 72 65 61 74 65 64 6b 69 74 3d 22  ....createdkit="
1bc0: 24 28 6c 73 20 2d 66 31 20 24 7b 63 72 65 61 74  $(ls -f1 ${creat
1bd0: 65 64 6b 69 74 7d 20 32 3e 2f 64 65 76 2f 6e 75  edkit} 2>/dev/nu
1be0: 6c 6c 20 7c 20 68 65 61 64 20 2d 6e 20 31 29 22  ll | head -n 1)"
1bf0: 0a 0a 09 09 09 69 66 20 5b 20 21 20 2d 66 20 22  .....if [ ! -f "
1c00: 24 7b 63 72 65 61 74 65 64 6b 69 74 7d 22 20 5d  ${createdkit}" ]
1c10: 3b 20 74 68 65 6e 0a 09 09 09 09 65 63 68 6f 20  ; then.....echo 
1c20: 22 46 61 69 6c 65 64 20 74 6f 20 63 72 65 61 74  "Failed to creat
1c30: 65 20 6b 69 74 20 24 7b 76 65 72 73 69 6f 6e 7d  e kit ${version}
1c40: 2f 24 7b 6b 69 74 7d 22 20 3e 26 32 0a 0a 09 09  /${kit}" >&2....
1c50: 09 09 66 61 69 6c 65 64 3d 22 24 7b 66 61 69 6c  ..failed="${fail
1c60: 65 64 7d 20 24 7b 76 65 72 73 69 6f 6e 7d 2f 24  ed} ${version}/$
1c70: 7b 6b 69 74 7d 2d 62 75 69 6c 64 22 0a 0a 09 09  {kit}-build"....
1c80: 09 09 74 6f 75 63 68 20 22 24 7b 66 61 69 6c 6f  ..touch "${failo
1c90: 75 74 70 75 74 6e 61 6d 65 7d 22 0a 09 09 09 09  utputname}".....
1ca0: 6d 76 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22  mv "${buildlog}"
1cb0: 20 22 24 7b 66 61 69 6c 62 75 69 6c 64 6c 6f 67   "${failbuildlog
1cc0: 7d 22 0a 0a 09 09 09 09 72 6d 20 2d 66 20 74 63  }"......rm -f tc
1cd0: 6c 73 68 0a 0a 09 09 09 09 63 6f 6e 74 69 6e 75  lsh......continu
1ce0: 65 0a 09 09 09 66 69 0a 0a 09 09 09 23 20 56 65  e....fi.....# Ve
1cf0: 72 69 66 79 20 73 61 6e 69 74 79 20 6f 66 20 63  rify sanity of c
1d00: 72 65 61 74 65 64 20 6b 69 74 0a 09 09 09 69 73  reated kit....is
1d10: 73 61 6e 65 3d 31 0a 0a 09 09 09 23 23 20 56 65  sane=1.....## Ve
1d20: 72 69 66 79 20 74 68 61 74 20 57 69 6e 33 32 20  rify that Win32 
1d30: 62 75 69 6c 64 73 20 61 72 65 20 6f 66 20 63 6f  builds are of co
1d40: 72 72 65 63 74 20 74 79 70 65 0a 09 09 09 23 23  rrect type....##
1d50: 20 56 65 72 69 66 79 20 74 68 61 74 20 44 4c 4c   Verify that DLL
1d60: 20 62 75 69 6c 64 73 20 61 72 65 20 6f 66 20 63   builds are of c
1d70: 6f 72 72 65 63 74 20 74 79 70 65 0a 09 09 09 63  orrect type....c
1d80: 61 73 65 20 22 2d 24 7b 76 65 72 73 69 6f 6e 7d  ase "-${version}
1d90: 2d 24 7b 6b 69 74 7d 2d 22 20 69 6e 0a 09 09 09  -${kit}-" in....
1da0: 09 2a 2d 77 69 6e 33 32 2d 6b 69 74 64 6c 6c 2d  .*-win32-kitdll-
1db0: 2a 7c 2a 2d 77 69 6e 33 32 2d 2a 2d 6b 69 74 64  *|*-win32-*-kitd
1dc0: 6c 6c 2d 2a 29 0a 09 09 09 09 09 69 66 20 21 20  ll-*)......if ! 
1dd0: 66 69 6c 65 20 22 24 7b 63 72 65 61 74 65 64 6b  file "${createdk
1de0: 69 74 7d 22 20 7c 20 67 72 65 70 20 27 4d 53 20  it}" | grep 'MS 
1df0: 57 69 6e 64 6f 77 73 20 28 44 4c 4c 29 27 20 3e  Windows (DLL)' >
1e00: 2f 64 65 76 2f 6e 75 6c 6c 3b 20 74 68 65 6e 0a  /dev/null; then.
1e10: 09 09 09 09 09 09 69 73 73 61 6e 65 3d 30 0a 09  ......issane=0..
1e20: 09 09 09 09 66 69 0a 09 09 09 09 09 3b 3b 0a 09  ....fi......;;..
1e30: 09 09 09 2a 2d 6b 69 74 64 6c 6c 2d 2a 29 0a 09  ...*-kitdll-*)..
1e40: 09 09 09 09 69 66 20 21 20 66 69 6c 65 20 22 24  ....if ! file "$
1e50: 7b 63 72 65 61 74 65 64 6b 69 74 7d 22 20 7c 20  {createdkit}" | 
1e60: 67 72 65 70 20 27 73 68 61 72 65 64 20 6f 62 6a  grep 'shared obj
1e70: 65 63 74 27 20 3e 2f 64 65 76 2f 6e 75 6c 6c 3b  ect' >/dev/null;
1e80: 20 74 68 65 6e 0a 09 09 09 09 09 09 69 73 73 61   then.......issa
1e90: 6e 65 3d 30 0a 09 09 09 09 09 66 69 0a 09 09 09  ne=0......fi....
1ea0: 09 09 3b 3b 0a 09 09 09 09 2a 2d 77 69 6e 33 32  ..;;.....*-win32
1eb0: 2d 6e 6f 74 6b 2d 2a 7c 2a 2d 77 69 6e 33 32 2d  -notk-*|*-win32-
1ec0: 2a 2d 6e 6f 74 6b 2d 2a 29 0a 09 09 09 09 09 69  *-notk-*)......i
1ed0: 66 20 21 20 66 69 6c 65 20 22 24 7b 63 72 65 61  f ! file "${crea
1ee0: 74 65 64 6b 69 74 7d 22 20 7c 20 67 72 65 70 20  tedkit}" | grep 
1ef0: 27 4d 53 20 57 69 6e 64 6f 77 73 20 28 63 6f 6e  'MS Windows (con
1f00: 73 6f 6c 65 29 27 20 3e 2f 64 65 76 2f 6e 75 6c  sole)' >/dev/nul
1f10: 6c 3b 20 74 68 65 6e 0a 09 09 09 09 09 09 65 63  l; then.......ec
1f20: 68 6f 20 22 4b 69 74 20 66 61 69 6c 65 64 20 73  ho "Kit failed s
1f30: 61 6e 69 74 79 20 63 68 65 63 6b 20 66 6f 72 20  anity check for 
1f40: 62 65 69 6e 67 20 61 20 63 6f 6e 73 6f 6c 65 20  being a console 
1f50: 61 70 70 6c 69 63 61 74 69 6f 6e 22 20 3e 26 32  application" >&2
1f60: 0a 09 09 09 09 09 09 69 73 73 61 6e 65 3d 30 0a  .......issane=0.
1f70: 09 09 09 09 09 66 69 0a 09 09 09 09 09 3b 3b 0a  .....fi......;;.
1f80: 09 09 09 09 2a 2d 77 69 6e 33 32 2d 2a 29 0a 09  ....*-win32-*)..
1f90: 09 09 09 09 69 66 20 21 20 66 69 6c 65 20 22 24  ....if ! file "$
1fa0: 7b 63 72 65 61 74 65 64 6b 69 74 7d 22 20 7c 20  {createdkit}" | 
1fb0: 67 72 65 70 20 27 4d 53 20 57 69 6e 64 6f 77 73  grep 'MS Windows
1fc0: 20 28 47 55 49 29 27 20 3e 2f 64 65 76 2f 6e 75   (GUI)' >/dev/nu
1fd0: 6c 6c 3b 20 74 68 65 6e 0a 09 09 09 09 09 09 65  ll; then.......e
1fe0: 63 68 6f 20 22 4b 69 74 20 66 61 69 6c 65 64 20  cho "Kit failed 
1ff0: 73 61 6e 69 74 79 20 63 68 65 63 6b 20 66 6f 72  sanity check for
2000: 20 62 65 69 6e 67 20 61 20 47 55 49 20 61 70 70   being a GUI app
2010: 6c 69 63 61 74 69 6f 6e 22 20 3e 26 32 0a 09 09  lication" >&2...
2020: 09 09 09 09 69 73 73 61 6e 65 3d 30 0a 09 09 09  ....issane=0....
2030: 09 09 66 69 0a 09 09 09 09 09 3b 3b 0a 09 09 09  ..fi......;;....
2040: 65 73 61 63 0a 0a 09 09 09 23 23 20 56 65 72 69  esac.....## Veri
2050: 66 79 20 74 68 65 20 62 75 69 6c 64 20 63 6f 6d  fy the build com
2060: 70 6c 65 74 65 64 20 77 69 74 68 6f 75 74 20 77  pleted without w
2070: 61 72 6e 69 6e 67 73 0a 09 09 09 69 66 20 5b 20  arnings....if [ 
2080: 22 24 7b 62 75 69 6c 64 66 61 69 6c 65 64 7d 22  "${buildfailed}"
2090: 20 3d 20 22 31 22 20 5d 3b 20 74 68 65 6e 0a 09   = "1" ]; then..
20a0: 09 09 09 65 63 68 6f 20 22 4b 69 74 20 66 61 69  ...echo "Kit fai
20b0: 6c 65 64 20 73 61 6e 69 74 79 20 63 68 65 63 6b  led sanity check
20c0: 20 66 6f 72 20 42 75 69 6c 64 69 6e 67 22 20 3e   for Building" >
20d0: 26 32 0a 0a 09 09 09 09 69 73 73 61 6e 65 3d 30  &2......issane=0
20e0: 0a 09 09 09 66 69 0a 0a 09 09 09 23 20 4d 61 6b  ....fi.....# Mak
20f0: 65 20 6e 6f 74 65 20 6f 66 20 73 61 6e 69 74 79  e note of sanity
2100: 20 66 61 69 6c 75 72 65 0a 09 09 09 69 66 20 5b   failure....if [
2110: 20 22 24 7b 69 73 73 61 6e 65 7d 22 20 21 3d 20   "${issane}" != 
2120: 22 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09  "1" ]; then.....
2130: 65 63 68 6f 20 22 4b 69 74 20 66 61 69 6c 65 64  echo "Kit failed
2140: 20 73 61 6e 69 74 79 20 24 7b 76 65 72 73 69 6f   sanity ${versio
2150: 6e 7d 2f 24 7b 6b 69 74 7d 22 20 3e 26 32 0a 0a  n}/${kit}" >&2..
2160: 09 09 09 09 66 61 69 6c 65 64 3d 22 24 7b 66 61  ....failed="${fa
2170: 69 6c 65 64 7d 20 24 7b 76 65 72 73 69 6f 6e 7d  iled} ${version}
2180: 2f 24 7b 6b 69 74 7d 2d 73 61 6e 69 74 79 22 0a  /${kit}-sanity".
2190: 0a 09 09 09 09 6d 76 20 22 24 7b 63 72 65 61 74  .....mv "${creat
21a0: 65 64 6b 69 74 7d 22 20 22 24 7b 66 61 69 6c 6f  edkit}" "${failo
21b0: 75 74 70 75 74 6e 61 6d 65 7d 22 0a 09 09 09 09  utputname}".....
21c0: 6d 76 20 22 24 7b 62 75 69 6c 64 6c 6f 67 7d 22  mv "${buildlog}"
21d0: 20 22 24 7b 66 61 69 6c 62 75 69 6c 64 6c 6f 67   "${failbuildlog
21e0: 7d 22 0a 0a 09 09 09 09 72 6d 20 2d 66 20 74 63  }"......rm -f tc
21f0: 6c 73 68 0a 0a 09 09 09 09 63 6f 6e 74 69 6e 75  lsh......continu
2200: 65 0a 09 09 09 66 69 0a 0a 09 09 09 23 20 52 65  e....fi.....# Re
2210: 6e 61 6d 65 20 63 72 65 61 74 65 64 20 6b 69 74  name created kit
2220: 20 74 6f 20 66 69 6e 61 6c 20 64 65 73 74 69 6e   to final destin
2230: 61 74 69 6f 6e 0a 09 09 09 6d 76 20 22 24 7b 63  ation....mv "${c
2240: 72 65 61 74 65 64 6b 69 74 7d 22 20 22 24 7b 6f  reatedkit}" "${o
2250: 75 74 70 75 74 6e 61 6d 65 7d 22 0a 09 09 09 69  utputname}"....i
2260: 66 20 5b 20 2d 66 20 22 74 63 6c 73 68 22 20 5d  f [ -f "tclsh" ]
2270: 3b 20 74 68 65 6e 0a 09 09 09 09 6d 76 20 22 74  ; then.....mv "t
2280: 63 6c 73 68 22 20 22 24 7b 6f 75 74 70 75 74 6e  clsh" "${outputn
2290: 61 6d 65 7d 2d 74 63 6c 73 68 22 0a 09 09 09 66  ame}-tclsh"....f
22a0: 69 0a 0a 09 09 09 23 20 46 6f 72 20 4b 69 74 44  i.....# For KitD
22b0: 4c 4c 2c 20 6d 61 6b 65 20 61 20 6e 6f 74 65 20  LL, make a note 
22c0: 6f 66 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 20  of the original 
22d0: 6e 61 6d 65 0a 09 09 09 69 66 20 5b 20 22 24 7b  name....if [ "${
22e0: 6b 69 74 64 6c 6c 7d 22 20 3d 20 22 31 22 20 5d  kitdll}" = "1" ]
22f0: 3b 20 74 68 65 6e 0a 09 09 09 09 65 63 68 6f 20  ; then.....echo 
2300: 22 24 7b 63 72 65 61 74 65 64 6b 69 74 7d 22 20  "${createdkit}" 
2310: 3e 20 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d  > "${outputname}
2320: 2d 6f 72 69 67 6e 61 6d 65 22 0a 09 09 09 66 69  -origname"....fi
2330: 0a 09 09 66 69 0a 0a 09 09 23 20 54 65 73 74 20  ...fi....# Test 
2340: 7a 69 70 20 73 74 61 74 75 73 0a 09 09 69 66 20  zip status...if 
2350: 75 6e 7a 69 70 20 2d 6c 20 22 24 7b 6f 75 74 70  unzip -l "${outp
2360: 75 74 6e 61 6d 65 7d 22 20 32 3e 26 31 20 7c 20  utname}" 2>&1 | 
2370: 67 72 65 70 20 27 62 6f 6f 74 5c 2e 74 63 6c 27  grep 'boot\.tcl'
2380: 20 3e 2f 64 65 76 2f 6e 75 6c 6c 3b 20 74 68 65   >/dev/null; the
2390: 6e 0a 09 09 09 63 61 6e 75 6e 7a 69 70 3d 22 31  n....canunzip="1
23a0: 22 0a 09 09 65 6c 73 65 0a 09 09 09 63 61 6e 75  "...else....canu
23b0: 6e 7a 69 70 3d 22 30 22 0a 09 09 66 69 0a 0a 09  nzip="0"...fi...
23c0: 09 69 66 20 5b 20 22 24 7b 69 73 7a 69 70 7d 22  .if [ "${iszip}"
23d0: 20 21 3d 20 22 24 7b 63 61 6e 75 6e 7a 69 70 7d   != "${canunzip}
23e0: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 65 63 68  " ]; then....ech
23f0: 6f 20 22 46 61 69 6c 65 64 20 74 6f 20 75 6e 7a  o "Failed to unz
2400: 69 70 20 7a 69 70 6b 69 74 20 6f 72 20 77 61 73  ip zipkit or was
2410: 20 61 62 6c 65 20 74 6f 20 75 6e 7a 69 70 20 6e   able to unzip n
2420: 6f 6e 2d 7a 69 70 6b 69 74 20 24 7b 76 65 72 73  on-zipkit ${vers
2430: 69 6f 6e 7d 2f 24 7b 6b 69 74 7d 22 20 3e 26 32  ion}/${kit}" >&2
2440: 0a 0a 09 09 09 66 61 69 6c 65 64 3d 22 24 7b 66  .....failed="${f
2450: 61 69 6c 65 64 7d 20 24 7b 76 65 72 73 69 6f 6e  ailed} ${version
2460: 7d 2f 24 7b 6b 69 74 7d 2d 7a 69 70 22 0a 0a 09  }/${kit}-zip"...
2470: 09 09 63 6f 6e 74 69 6e 75 65 0a 09 09 66 69 0a  ..continue...fi.
2480: 0a 09 09 23 20 44 6f 20 6e 6f 74 20 63 6f 6e 74  ...# Do not cont
2490: 69 6e 75 65 20 70 61 73 74 20 68 65 72 65 20 66  inue past here f
24a0: 6f 72 20 75 6e 2d 72 75 6e 6e 61 62 6c 65 20 6b  or un-runnable k
24b0: 69 74 73 0a 09 09 69 66 20 5b 20 22 24 7b 72 75  its...if [ "${ru
24c0: 6e 6e 61 62 6c 65 7d 22 20 21 3d 20 22 31 22 20  nnable}" != "1" 
24d0: 5d 3b 20 74 68 65 6e 0a 09 09 09 63 6f 6e 74 69  ]; then....conti
24e0: 6e 75 65 0a 09 09 66 69 0a 0a 09 09 23 20 49 66  nue...fi....# If
24f0: 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65   the name of the
2500: 20 6f 72 69 67 69 6e 61 6c 20 62 75 69 6c 64 20   original build 
2510: 6d 61 74 74 65 72 73 2c 20 73 79 6d 6c 69 6e 6b  matters, symlink
2520: 20 69 74 20 75 70 0a 09 09 69 66 20 5b 20 2d 66   it up...if [ -f
2530: 20 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 2d   "${outputname}-
2540: 6f 72 69 67 6e 61 6d 65 22 20 5d 3b 20 74 68 65  origname" ]; the
2550: 6e 0a 09 09 09 63 72 65 61 74 65 64 6b 69 74 3d  n....createdkit=
2560: 22 24 28 63 61 74 20 22 24 7b 6f 75 74 70 75 74  "$(cat "${output
2570: 6e 61 6d 65 7d 2d 6f 72 69 67 6e 61 6d 65 22 29  name}-origname")
2580: 22 0a 0a 09 09 09 6c 6e 20 2d 73 20 22 24 7b 6f  ".....ln -s "${o
2590: 75 74 70 75 74 6e 61 6d 65 7d 22 20 22 24 7b 63  utputname}" "${c
25a0: 72 65 61 74 65 64 6b 69 74 7d 22 0a 09 09 66 69  reatedkit}"...fi
25b0: 0a 0a 09 09 23 20 50 65 72 66 6f 72 6d 20 62 61  ....# Perform ba
25c0: 74 74 65 72 79 20 6f 66 20 74 65 73 74 73 0a 09  ttery of tests..
25d0: 09 23 23 20 43 6c 65 61 6e 20 74 65 73 74 73 20  .## Clean tests 
25e0: 6c 6f 67 0a 09 09 72 6d 20 2d 66 20 22 24 7b 74  log...rm -f "${t
25f0: 65 73 74 72 65 73 75 6c 74 73 6c 6f 67 7d 22 0a  estresultslog}".
2600: 09 09 66 6f 72 20 74 65 73 74 73 63 70 20 69 6e  ..for testscp in
2610: 20 22 24 7b 54 45 53 54 44 49 52 7d 22 2f 74 65   "${TESTDIR}"/te
2620: 73 74 73 2f 2a 2e 74 63 6c 3b 20 64 6f 0a 09 09  sts/*.tcl; do...
2630: 09 74 65 73 74 73 63 70 5f 74 61 67 3d 22 24 28  .testscp_tag="$(
2640: 62 61 73 65 6e 61 6d 65 20 22 24 7b 74 65 73 74  basename "${test
2650: 73 63 70 7d 22 20 2e 74 63 6c 29 22 0a 09 09 09  scp}" .tcl)"....
2660: 74 65 73 74 73 63 70 70 72 65 3d 22 24 28 64 69  testscppre="$(di
2670: 72 6e 61 6d 65 20 22 24 7b 74 65 73 74 73 63 70  rname "${testscp
2680: 7d 22 29 2f 24 7b 74 65 73 74 73 63 70 5f 74 61  }")/${testscp_ta
2690: 67 7d 2e 73 68 22 0a 09 09 09 73 63 70 6c 6f 67  g}.sh"....scplog
26a0: 66 69 6c 65 3d 22 24 7b 6f 75 74 70 75 74 6e 61  file="${outputna
26b0: 6d 65 7d 2d 24 7b 74 65 73 74 73 63 70 5f 74 61  me}-${testscp_ta
26c0: 67 7d 2e 6c 6f 67 22 0a 0a 09 09 09 23 20 49 66  g}.log".....# If
26d0: 20 61 20 63 6f 6d 6d 61 6e 64 20 69 73 20 72 65   a command is re
26e0: 71 75 69 72 65 64 20 74 6f 20 73 74 61 72 74 20  quired to start 
26f0: 74 68 65 20 6b 69 74 2c 20 70 72 65 70 61 72 65  the kit, prepare
2700: 20 74 6f 20 6b 69 6c 6c 20 69 74 0a 09 09 09 23   to kill it....#
2710: 20 69 6e 20 63 61 73 65 20 6f 66 20 74 69 6d 65   in case of time
2720: 6f 75 74 2e 0a 09 09 09 23 23 20 54 65 6d 70 6f  out.....## Tempo
2730: 72 61 72 69 6c 79 20 64 69 73 61 62 6c 65 64 20  rarily disabled 
2740: 73 69 6e 63 65 20 63 75 72 72 65 6e 74 6c 79 20  since currently 
2750: 69 74 20 69 73 20 63 61 75 73 69 6e 67 0a 09 09  it is causing...
2760: 09 23 23 20 6d 6f 72 65 20 70 72 6f 62 6c 65 6d  .## more problem
2770: 73 20 69 6e 20 74 68 65 20 66 6f 72 6d 20 6f 66  s in the form of
2780: 20 74 65 73 74 73 20 62 65 69 6e 67 20 6b 69 6c   tests being kil
2790: 6c 65 64 0a 09 09 09 23 23 20 70 72 65 6d 61 74  led....## premat
27a0: 75 72 65 6c 79 20 74 68 61 6e 20 77 65 20 61 72  urely than we ar
27b0: 65 20 68 61 76 69 6e 67 20 69 73 73 75 65 73 20  e having issues 
27c0: 77 69 74 68 20 74 65 73 74 73 0a 09 09 09 23 23  with tests....##
27d0: 20 68 61 6e 67 69 6e 67 0a 09 09 09 6b 69 74 72   hanging....kitr
27e0: 75 6e 6b 69 6c 6c 70 69 64 3d 22 22 0a 09 09 09  unkillpid=""....
27f0: 69 66 20 5b 20 22 31 22 20 3d 20 22 30 22 20 2d  if [ "1" = "0" -
2800: 61 20 2d 6e 20 22 24 7b 6b 69 74 72 75 6e 63 6d  a -n "${kitruncm
2810: 64 7d 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09  d}" ]; then.....
2820: 28 0a 09 09 09 09 09 73 6c 65 65 70 20 31 32 30  (......sleep 120
2830: 0a 09 09 09 09 09 6b 69 6c 6c 61 6c 6c 20 22 24  ......killall "$
2840: 28 62 61 73 65 6e 61 6d 65 20 22 24 7b 6f 75 74  (basename "${out
2850: 70 75 74 6e 61 6d 65 7d 22 29 22 20 3e 2f 64 65  putname}")" >/de
2860: 76 2f 6e 75 6c 6c 20 32 3e 2f 64 65 76 2f 6e 75  v/null 2>/dev/nu
2870: 6c 6c 0a 09 09 09 09 29 20 3e 2f 64 65 76 2f 6e  ll.....) >/dev/n
2880: 75 6c 6c 20 32 3e 2f 64 65 76 2f 6e 75 6c 6c 20  ull 2>/dev/null 
2890: 26 0a 09 09 09 09 6b 69 74 72 75 6e 6b 69 6c 6c  &.....kitrunkill
28a0: 70 69 64 3d 22 24 21 22 0a 09 09 09 66 69 0a 0a  pid="$!"....fi..
28b0: 09 09 09 28 0a 09 09 09 09 69 66 20 5b 20 2d 66  ...(.....if [ -f
28c0: 20 22 24 7b 74 65 73 74 73 63 70 70 72 65 7d 22   "${testscppre}"
28d0: 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 09 2e 20   ]; then....... 
28e0: 22 24 7b 74 65 73 74 73 63 70 70 72 65 7d 22 0a  "${testscppre}".
28f0: 09 09 09 09 66 69 0a 0a 09 09 09 09 69 66 20 5b  ....fi......if [
2900: 20 22 24 7b 6b 69 74 64 6c 6c 7d 22 20 3d 20 22   "${kitdll}" = "
2910: 31 22 20 5d 3b 20 74 68 65 6e 0a 09 09 09 09 09  1" ]; then......
2920: 24 7b 6b 69 74 72 75 6e 63 6d 64 7d 20 22 24 7b  ${kitruncmd} "${
2930: 6f 75 74 70 75 74 6e 61 6d 65 7d 2d 74 63 6c 73  outputname}-tcls
2940: 68 22 20 22 24 7b 74 65 73 74 73 63 70 7d 22 20  h" "${testscp}" 
2950: 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 22 20  "${outputname}" 
2960: 22 24 7b 6b 69 74 7d 22 20 22 24 7b 76 65 72 73  "${kit}" "${vers
2970: 69 6f 6e 7d 22 0a 09 09 09 09 65 6c 73 65 0a 09  ion}".....else..
2980: 09 09 09 09 24 7b 6b 69 74 72 75 6e 63 6d 64 7d  ....${kitruncmd}
2990: 20 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 22   "${outputname}"
29a0: 20 22 24 7b 74 65 73 74 73 63 70 7d 22 20 22 24   "${testscp}" "$
29b0: 7b 6f 75 74 70 75 74 6e 61 6d 65 7d 22 20 22 24  {outputname}" "$
29c0: 7b 6b 69 74 7d 22 20 22 24 7b 76 65 72 73 69 6f  {kit}" "${versio
29d0: 6e 7d 22 0a 09 09 09 09 66 69 0a 09 09 09 29 20  n}".....fi....) 
29e0: 3e 20 22 24 7b 73 63 70 6c 6f 67 66 69 6c 65 7d  > "${scplogfile}
29f0: 22 20 32 3e 26 31 0a 0a 09 09 09 69 66 20 5b 20  " 2>&1.....if [ 
2a00: 22 24 3f 22 20 21 3d 20 22 30 22 20 5d 3b 20 74  "$?" != "0" ]; t
2a10: 68 65 6e 0a 09 09 09 09 65 63 68 6f 20 22 53 63  hen.....echo "Sc
2a20: 72 69 70 74 20 66 61 69 6c 65 64 3a 20 24 7b 74  ript failed: ${t
2a30: 65 73 74 73 63 70 5f 74 61 67 7d 20 6f 6e 20 24  estscp_tag} on $
2a40: 7b 76 65 72 73 69 6f 6e 7d 2f 24 7b 6b 69 74 7d  {version}/${kit}
2a50: 22 20 3e 26 32 0a 0a 09 09 09 09 66 61 69 6c 65  " >&2......faile
2a60: 64 3d 22 24 7b 66 61 69 6c 65 64 7d 20 24 7b 76  d="${failed} ${v
2a70: 65 72 73 69 6f 6e 7d 2f 24 7b 6b 69 74 7d 2d 74  ersion}/${kit}-t
2a80: 65 73 74 2d 24 7b 74 65 73 74 73 63 70 5f 74 61  est-${testscp_ta
2a90: 67 7d 22 0a 0a 09 09 09 09 65 63 68 6f 20 22 24  g}"......echo "$
2aa0: 7b 74 65 73 74 73 63 70 5f 74 61 67 7d 3a 20 46  {testscp_tag}: F
2ab0: 41 49 4c 22 20 3e 3e 20 20 22 24 7b 74 65 73 74  AIL" >>  "${test
2ac0: 72 65 73 75 6c 74 73 6c 6f 67 7d 22 0a 0a 09 09  resultslog}"....
2ad0: 09 09 63 6f 6e 74 69 6e 75 65 0a 09 09 09 66 69  ..continue....fi
2ae0: 0a 0a 09 09 09 23 20 4b 69 6c 6c 20 74 68 65 20  .....# Kill the 
2af0: 77 61 74 63 68 64 6f 67 20 66 6f 72 20 74 68 69  watchdog for thi
2b00: 73 20 69 74 65 72 61 74 69 6f 6e 0a 09 09 09 69  s iteration....i
2b10: 66 20 5b 20 2d 6e 20 22 24 7b 6b 69 74 72 75 6e  f [ -n "${kitrun
2b20: 6b 69 6c 6c 70 69 64 7d 22 20 5d 3b 20 74 68 65  killpid}" ]; the
2b30: 6e 0a 09 09 09 09 6b 69 6c 6c 20 2d 39 20 22 24  n.....kill -9 "$
2b40: 7b 6b 69 74 72 75 6e 6b 69 6c 6c 70 69 64 7d 22  {kitrunkillpid}"
2b50: 20 3e 2f 64 65 76 2f 6e 75 6c 6c 20 32 3e 2f 64   >/dev/null 2>/d
2b60: 65 76 2f 6e 75 6c 6c 0a 09 09 09 66 69 0a 0a 09  ev/null....fi...
2b70: 09 09 65 63 68 6f 20 22 24 7b 74 65 73 74 73 63  ..echo "${testsc
2b80: 70 5f 74 61 67 7d 3a 20 50 41 53 53 22 20 3e 3e  p_tag}: PASS" >>
2b90: 20 20 22 24 7b 74 65 73 74 72 65 73 75 6c 74 73    "${testresults
2ba0: 6c 6f 67 7d 22 0a 0a 09 09 09 72 6d 20 2d 66 20  log}".....rm -f 
2bb0: 22 24 7b 73 63 70 6c 6f 67 66 69 6c 65 7d 22 0a  "${scplogfile}".
2bc0: 09 09 64 6f 6e 65 0a 0a 09 09 69 66 20 5b 20 2d  ..done....if [ -
2bd0: 66 20 22 24 7b 6f 75 74 70 75 74 6e 61 6d 65 7d  f "${outputname}
2be0: 2d 6f 72 69 67 6e 61 6d 65 22 20 5d 3b 20 74 68  -origname" ]; th
2bf0: 65 6e 0a 09 09 09 72 6d 20 2d 66 20 22 24 7b 63  en....rm -f "${c
2c00: 72 65 61 74 65 64 6b 69 74 7d 22 0a 09 09 66 69  reatedkit}"...fi
2c10: 0a 09 64 6f 6e 65 0a 64 6f 6e 65 0a 0a 69 66 20  ..done.done..if 
2c20: 5b 20 2d 6e 20 22 24 7b 66 61 69 6c 65 64 7d 22  [ -n "${failed}"
2c30: 20 5d 3b 20 74 68 65 6e 0a 09 65 63 68 6f 20 22   ]; then..echo "
2c40: 46 61 69 6c 65 64 3a 20 24 7b 66 61 69 6c 65 64  Failed: ${failed
2c50: 7d 22 0a 66 69 0a 0a 23 20 54 65 72 6d 69 6e 61  }".fi..# Termina
2c60: 74 65 20 58 76 66 62 0a 6b 69 6c 6c 20 2d 39 20  te Xvfb.kill -9 
2c70: 22 24 7b 58 56 46 42 5f 50 49 44 7d 22 0a 0a 23  "${XVFB_PID}"..#
2c80: 20 43 6c 65 61 6e 75 70 0a 2e 2f 6b 69 74 63 72   Cleanup../kitcr
2c90: 65 61 74 6f 72 20 63 6c 65 61 6e 0a 72 6d 20 2d  eator clean.rm -
2ca0: 66 20 74 63 6c 73 68 0a                          f tclsh.