Hex Artifact Content

Artifact fcb2d0c6dca0435ad0d42ba21d2b2a727c59b6a8:


0000: 23 21 20 2f 62 69 6e 2f 62 61 73 68 0a 0a 54 43  #! /bin/bash..TC
0010: 4c 56 45 52 53 3d 22 38 2e 34 2e 31 39 22 0a 65  LVERS="8.4.19".e
0020: 78 70 6f 72 74 20 54 43 4c 56 45 52 53 0a 0a 6d  xport TCLVERS..m
0030: 6f 64 65 3d 22 62 75 69 6c 64 22 0a 69 66 20 5b  ode="build".if [
0040: 20 22 24 31 22 20 3d 20 22 63 6c 65 61 6e 22 20   "$1" = "clean" 
0050: 5d 3b 20 74 68 65 6e 0a 09 6d 6f 64 65 3d 22 63  ]; then..mode="c
0060: 6c 65 61 6e 22 0a 66 69 0a 69 66 20 5b 20 22 24  lean".fi.if [ "$
0070: 31 22 20 3d 20 22 64 69 73 74 63 6c 65 61 6e 22  1" = "distclean"
0080: 20 5d 3b 20 74 68 65 6e 0a 09 6d 6f 64 65 3d 22   ]; then..mode="
0090: 64 69 73 74 63 6c 65 61 6e 22 0a 66 69 0a 0a 66  distclean".fi..f
00a0: 61 69 6c 65 64 70 6b 67 73 3d 22 22 0a 62 75 69  ailedpkgs="".bui
00b0: 6c 64 66 61 69 6c 65 64 3d 22 30 22 0a 66 6f 72  ldfailed="0".for
00c0: 20 70 6b 67 20 69 6e 20 74 63 6c 20 74 6b 20 69   pkg in tcl tk i
00d0: 74 63 6c 20 6d 6b 34 74 63 6c 20 74 63 6c 76 66  tcl mk4tcl tclvf
00e0: 73 20 6d 65 6d 63 68 61 6e 20 6b 69 74 73 68 3b  s memchan kitsh;
00f0: 20 64 6f 0a 09 69 66 20 5b 20 22 24 7b 6d 6f 64   do..if [ "${mod
0100: 65 7d 22 20 3d 20 22 64 69 73 74 63 6c 65 61 6e  e}" = "distclean
0110: 22 20 5d 3b 20 74 68 65 6e 0a 09 09 72 6d 20 2d  " ]; then...rm -
0120: 72 66 20 22 24 7b 70 6b 67 7d 2f 73 72 63 22 0a  rf "${pkg}/src".
0130: 09 66 69 0a 0a 09 69 66 20 5b 20 22 24 7b 6d 6f  .fi...if [ "${mo
0140: 64 65 7d 22 20 3d 20 22 63 6c 65 61 6e 22 20 2d  de}" = "clean" -
0150: 6f 20 22 24 7b 6d 6f 64 65 7d 22 20 3d 20 22 64  o "${mode}" = "d
0160: 69 73 74 63 6c 65 61 6e 22 20 5d 3b 20 74 68 65  istclean" ]; the
0170: 6e 0a 09 09 72 6d 20 2d 66 20 22 24 7b 70 6b 67  n...rm -f "${pkg
0180: 7d 2f 62 75 69 6c 64 2e 6c 6f 67 22 0a 09 09 72  }/build.log"...r
0190: 6d 20 2d 72 66 20 22 24 7b 70 6b 67 7d 2f 6f 75  m -rf "${pkg}/ou
01a0: 74 22 20 22 24 7b 70 6b 67 7d 2f 69 6e 73 74 22  t" "${pkg}/inst"
01b0: 20 22 24 7b 70 6b 67 7d 2f 62 75 69 6c 64 22 0a   "${pkg}/build".
01c0: 0a 09 09 63 6f 6e 74 69 6e 75 65 0a 09 66 69 0a  ...continue..fi.
01d0: 0a 09 66 61 69 6c 65 64 3d 22 30 22 0a 09 28 0a  ..failed="0"..(.
01e0: 09 09 63 64 20 22 24 7b 70 6b 67 7d 22 20 7c 7c  ..cd "${pkg}" ||
01f0: 20 65 78 69 74 20 31 0a 0a 09 09 2e 2f 62 75 69   exit 1...../bui
0200: 6c 64 2e 73 68 20 3e 20 62 75 69 6c 64 2e 6c 6f  ld.sh > build.lo
0210: 67 20 32 3e 26 31 20 7c 7c 20 65 78 69 74 20 31  g 2>&1 || exit 1
0220: 0a 09 29 20 7c 7c 20 66 61 69 6c 65 64 3d 22 31  ..) || failed="1
0230: 22 0a 0a 09 69 66 20 5b 20 22 24 7b 66 61 69 6c  "...if [ "${fail
0240: 65 64 7d 22 20 3d 20 22 31 22 20 5d 3b 20 74 68  ed}" = "1" ]; th
0250: 65 6e 0a 09 09 66 61 69 6c 65 64 70 6b 67 73 3d  en...failedpkgs=
0260: 22 24 7b 66 61 69 6c 65 64 70 6b 67 73 7d 20 24  "${failedpkgs} $
0270: 7b 70 6b 67 7d 22 0a 09 66 69 0a 0a 09 63 61 73  {pkg}"..fi...cas
0280: 65 20 22 24 7b 70 6b 67 7d 22 20 69 6e 0a 09 09  e "${pkg}" in...
0290: 74 63 6c 29 0a 09 09 09 54 43 4c 43 4f 4e 46 49  tcl)....TCLCONFI
02a0: 47 44 49 52 3d 24 28 66 69 6e 64 20 22 24 28 70  GDIR=$(find "$(p
02b0: 77 64 29 2f 74 63 6c 2f 62 75 69 6c 64 22 20 2d  wd)/tcl/build" -
02c0: 6e 61 6d 65 20 74 63 6c 43 6f 6e 66 69 67 2e 73  name tclConfig.s
02d0: 68 20 7c 20 68 65 61 64 20 2d 31 20 7c 20 73 65  h | head -1 | se
02e0: 64 20 27 73 40 2f 5b 5e 2f 5d 2a 24 40 40 27 29  d 's@/[^/]*$@@')
02f0: 0a 09 09 09 65 78 70 6f 72 74 20 54 43 4c 43 4f  ....export TCLCO
0300: 4e 46 49 47 44 49 52 0a 09 09 09 3b 3b 0a 09 09  NFIGDIR....;;...
0310: 6d 65 6d 63 68 61 6e 29 0a 09 09 09 66 61 69 6c  memchan)....fail
0320: 65 64 3d 22 30 22 0a 09 09 09 3b 3b 0a 09 65 73  ed="0"....;;..es
0330: 61 63 0a 0a 09 69 66 20 5b 20 22 24 7b 66 61 69  ac...if [ "${fai
0340: 6c 65 64 7d 22 20 3d 20 22 31 22 20 5d 3b 20 74  led}" = "1" ]; t
0350: 68 65 6e 0a 09 09 62 75 69 6c 64 66 61 69 6c 65  hen...buildfaile
0360: 64 3d 22 31 22 0a 09 66 69 0a 64 6f 6e 65 0a 0a  d="1"..fi.done..
0370: 69 66 20 5b 20 2d 6e 20 22 24 7b 66 61 69 6c 65  if [ -n "${faile
0380: 64 70 6b 67 73 7d 22 20 5d 3b 20 74 68 65 6e 0a  dpkgs}" ]; then.
0390: 09 65 63 68 6f 20 22 46 61 69 6c 65 64 20 74 6f  .echo "Failed to
03a0: 20 62 75 69 6c 64 3a 24 7b 66 61 69 6c 65 64 70   build:${failedp
03b0: 6b 67 73 7d 22 0a 66 69 0a 0a 69 66 20 5b 20 22  kgs}".fi..if [ "
03c0: 24 7b 62 75 69 6c 64 66 61 69 6c 65 64 7d 22 20  ${buildfailed}" 
03d0: 21 3d 20 22 30 22 20 5d 3b 20 74 68 65 6e 0a 09  != "0" ]; then..
03e0: 65 63 68 6f 20 27 57 41 52 4e 49 4e 47 3a 20 42  echo 'WARNING: B
03f0: 75 69 6c 64 20 69 73 20 6c 69 6b 65 6c 79 20 69  uild is likely i
0400: 6e 63 6f 6d 70 6c 65 74 65 20 6f 72 20 66 61 69  ncomplete or fai
0410: 6c 65 64 2e 27 20 3e 26 32 0a 66 69 0a 0a 63 70  led.' >&2.fi..cp
0420: 20 27 6b 69 74 73 68 2f 62 75 69 6c 64 27 2f 6b   'kitsh/build'/k
0430: 69 74 73 68 2d 2a 2f 6b 69 74 20 22 74 63 6c 6b  itsh-*/kit "tclk
0440: 69 74 2d 24 7b 54 43 4c 56 45 52 53 7d 22 0a 0a  it-${TCLVERS}"..
0450: 65 78 69 74 20 22 24 7b 62 75 69 6c 64 66 61 69  exit "${buildfai
0460: 6c 65 64 7d 22 0a                                led}".