#!/bin/csh -f # # Grabs everything need for a particular kit and transfers to the host machine. # Assumes you have peer scp and write access to /build on remote machine. # # Written by Kevin P. Inscoe (kevin@inscoe.org) - Feb. 16, 2004 # # Globals set kitdir = "/pub/soft/build" set kitdot = "kit" set srcdir = "/pub/soft/src/" set blddir = "/pub/soft/build/" # How were we invoked? if ( $1 == "-l" ) then cd /pub/soft/build; find . -name '*.kit' -print -exec head -1 {} \; exit endif if ( $#argv < 2 ) then echo "usage: kit -l " echo " " echo "Copies the needed files for a particular kit to host" echo " " echo "Use -l to list available kits." exit 1 endif # Set the destination and source set host = $2 set dest = "`echo $host`:/build/." # Copy over kit contents if ( -e $kitdir/$1.$kitdot ) then set kit_manifest = `head -2 $kitdir/$1.$kitdot | tail -1` foreach item ( $kit_manifest ) set src = "`echo $srcdir`$item" echo "Copying $src to $dest..." /usr/local/bin/scp "$src" $dest end set kit_build_procedure = `head -3 $kitdir/$1.$kitdot | tail -1` set bld = "`echo $blddir`$kit_build_procedure" /usr/local/bin/scp "$bld" $dest # Copy over the base tools echo "Copying base compiler tools to $dest..." set base_tools = `head -4 $kitdir/$1.$kitdot | tail -1` foreach tool ( $base_tools ) echo "Copying $tool to $dest..." /usr/local/bin/scp $tool $dest end else echo "kit: ERROR: can't read kit file $kitdir/$1.$kitdot" exit 1 endif # That's it Bucky we is outta here... echo " " echo "Kit tranfer completed. Now login as root to $host and issue command: " echo " " echo " # batch" echo " at> /build/$kit_build_procedure > /build/build.log 2>&1" echo " at> " echo " commands will be executed using /bin/ksh" echo " job 1077058684.b at Tue Feb 17 17:58:04 2004" echo " " tail -1 $kitdir/$1.$kitdot echo " "