Hex Artifact Content

Artifact e83aa4603b72d919e0f26c747d30113d55e9d80b:


0000: 23 21 20 2f 62 69 6e 2f 62 61 73 68 0a 0a 54 41  #! /bin/bash..TA
0010: 52 47 45 54 3d 22 24 31 22 0a 73 68 69 66 74 0a  RGET="$1".shift.
0020: 0a 62 75 69 6c 64 69 64 3d 22 24 28 28 20 68 6f  .buildid="$(( ho
0030: 73 74 6e 61 6d 65 3b 20 69 64 20 2d 75 3b 20 70  stname; id -u; p
0040: 77 64 20 29 20 7c 20 6f 70 65 6e 73 73 6c 20 73  wd ) | openssl s
0050: 68 61 31 20 7c 20 73 65 64 20 27 73 40 5e 2e 2a  ha1 | sed 's@^.*
0060: 3d 20 2a 40 40 27 29 22 0a 77 6f 72 6b 64 69 72  = *@@')".workdir
0070: 3d 22 2f 74 6d 70 2f 77 6f 72 6b 2d 6b 69 74 63  ="/tmp/work-kitc
0080: 72 65 61 74 6f 72 2d 24 7b 62 75 69 6c 64 69 64  reator-${buildid
0090: 7d 22 0a 0a 72 73 79 6e 63 20 2d 61 71 20 2d 2d  }"..rsync -aq --
00a0: 64 65 6c 65 74 65 20 2d 65 20 73 73 68 20 2e 20  delete -e ssh . 
00b0: 22 24 7b 54 41 52 47 45 54 7d 3a 24 7b 77 6f 72  "${TARGET}:${wor
00c0: 6b 64 69 72 7d 2f 22 20 7c 7c 20 65 78 69 74 20  kdir}/" || exit 
00d0: 31 0a 0a 28 0a 09 6e 65 77 41 72 67 76 3d 28 22  1..(..newArgv=("
00e0: 24 40 22 29 3b 20 64 65 63 6c 61 72 65 20 2d 70  $@"); declare -p
00f0: 20 6e 65 77 41 72 67 76 0a 09 64 65 63 6c 61 72   newArgv..declar
0100: 65 20 2d 70 20 77 6f 72 6b 64 69 72 0a 09 65 78  e -p workdir..ex
0110: 70 6f 72 74 0a 09 63 61 74 20 3c 3c 20 5c 5f 45  port..cat << \_E
0120: 4f 46 5f 0a 63 64 20 22 24 7b 77 6f 72 6b 64 69  OF_.cd "${workdi
0130: 72 7d 22 20 7c 7c 20 65 78 69 74 20 31 0a 65 78  r}" || exit 1.ex
0140: 70 6f 72 74 20 50 41 54 48 3d 22 24 7b 50 41 54  port PATH="${PAT
0150: 48 7d 3a 2f 75 73 72 2f 6c 6f 63 61 6c 2f 62 69  H}:/usr/local/bi
0160: 6e 3a 2f 75 73 72 2f 62 69 6e 22 0a 2e 2f 6b 69  n:/usr/bin"../ki
0170: 74 63 72 65 61 74 6f 72 20 22 24 7b 6e 65 77 41  tcreator "${newA
0180: 72 67 76 5b 40 5d 7d 22 0a 65 78 69 74 20 22 24  rgv[@]}".exit "$
0190: 3f 22 0a 5f 45 4f 46 5f 0a 29 20 7c 20 73 73 68  ?"._EOF_.) | ssh
01a0: 20 22 24 7b 54 41 52 47 45 54 7d 22 20 62 61 73   "${TARGET}" bas
01b0: 68 20 2d 73 0a 72 65 74 76 61 6c 3d 22 24 3f 22  h -s.retval="$?"
01c0: 0a 0a 72 6d 20 2d 66 20 2a 2f 62 75 69 6c 64 2e  ..rm -f */build.
01d0: 6c 6f 67 0a 73 73 68 20 22 24 7b 54 41 52 47 45  log.ssh "${TARGE
01e0: 54 7d 22 20 22 77 6f 72 6b 64 69 72 3d 27 24 7b  T}" "workdir='${
01f0: 77 6f 72 6b 64 69 72 7d 27 3b 20 22 27 63 64 20  workdir}'; "'cd 
0200: 22 24 7b 77 6f 72 6b 64 69 72 7d 22 20 26 26 20  "${workdir}" && 
0210: 74 61 72 20 2d 63 66 20 2d 20 74 63 6c 6b 69 74  tar -cf - tclkit
0220: 2d 2a 20 6c 69 62 74 63 6c 6b 69 74 2a 20 2a 2f  -* libtclkit* */
0230: 62 75 69 6c 64 2e 6c 6f 67 20 32 3e 2f 64 65 76  build.log 2>/dev
0240: 2f 6e 75 6c 6c 27 20 7c 20 74 61 72 20 2d 78 66  /null' | tar -xf
0250: 20 2d 0a 0a 23 20 43 6c 65 61 6e 2d 75 70 20 69   -..# Clean-up i
0260: 66 20 61 70 70 72 6f 70 72 69 61 74 65 0a 63 61  f appropriate.ca
0270: 73 65 20 22 24 28 70 77 64 29 22 20 69 6e 0a 09  se "$(pwd)" in..
0280: 2f 68 6f 6d 65 2f 72 6b 65 65 6e 65 2f 2a 29 0a  /home/rkeene/*).
0290: 09 09 3b 3b 0a 09 2a 29 0a 09 09 73 73 68 20 22  ..;;..*)...ssh "
02a0: 24 7b 54 41 52 47 45 54 7d 22 20 22 77 6f 72 6b  ${TARGET}" "work
02b0: 64 69 72 3d 27 24 7b 77 6f 72 6b 64 69 72 7d 27  dir='${workdir}'
02c0: 3b 20 22 27 72 6d 20 2d 72 66 20 22 24 7b 77 6f  ; "'rm -rf "${wo
02d0: 72 6b 64 69 72 7d 22 27 0a 09 09 3b 3b 0a 65 73  rkdir}"'...;;.es
02e0: 61 63 0a 0a 65 78 69 74 20 22 24 7b 72 65 74 76  ac..exit "${retv
02f0: 61 6c 7d 22 0a                                   al}".