Files
sicspsi/tecs/didi
2004-07-06 13:12:37 +00:00

94 lines
1.8 KiB
Tcsh
Executable File

#!/bin/tcsh
set what="$1"
set where="$2"
set destlist=( type@osf1 \
AMOR@amor:tecs/ FOCUS@focus:tecs/ TRICS@trics:tecs/ \
alpha=/afs/psi.ch/project/sinq/tru64/stow/tecs/bin/ \
type@linux \
linux=/afs/psi.ch/project/sinq/linux/stow/tecs/bin/ \
TASP@tasp:tecs/ DMC@dmc:tecs/ HRPT@hrpt:tecs/ \
MORPHEUS@morpheus:tecs/ SANS@sans:tecs/ SANS2@sans2:tecs/ \
type@darwin \
macosx=/afs/psi.ch/project/sinq/mac_os/stow/tecs/bin/ \
)
set dests=""
set destl=""
foreach dest ($destlist)
set ext="${dest:s/=/ /}"
set ext=($ext)
if ("$ext" != "$dest") then
set dest="$ext[2]"
set d="$ext[1]"
else
set d=""
endif
set ext=${dest:s/@/ /}
set ext=($ext)
if ("$ext[1]" == type) then
set type=$ext[2]
else
if ("$d" == "") set d=$ext[1]
if ($?type) then
set t_$d=$type
else
echo "type undefined"
exit
endif
set d_$d=$dest
set dests=($dests $d)
endif
end
set items=(TecsServer TecsClient six keep_running cfg)
echo ""
echo " all $items"
echo -n "distribute what: "
if ("$what" == "") then
set what=$<
endif
if ($what == all) then
set what=($items)
endif
echo ""
echo " all $dests"
echo "distribute where: "
if ("$where" == "") then
set where=$<
endif
if ($where == all) then
set where=($dests)
endif
set this=${0:h}
if ($this == $0) then
set this=./
endif
cd $this
set makeit=1
set obj=../../obj/$SICS_VERSION/psi/tecs
foreach dest ($where)
alias get 'set d=$'"d_$dest;"'set t=$'"t_$dest"
get
foreach item ($what)
echo $item D $d T $t
if ($item == cfg) then
if ($makeit) then
make config
set makeit=0
endif
echo tecs $d
rsync -e ssh -rCtv --delete-excluded $obj/cfg $d
else if ("$t" == "$OSTYPE") then
echo $item to $d
rsync -e ssh -vt $obj/$item $d
endif
end
end