#! /bin/sh # # importarch # # Shell script to import a particular set of machine files in the # the BaBar code system from another site # # Bob Jacobsen Mar 1995 # # Options: # -p Reference a production version. (required) # # Arguments: # Name of release # # [] which directory copy (optional) # # Note that the directory structure is assumed to exist. # # Note that the BFDISTr environment variable should # contain an access route (similar to CVSROOTr), for # example "jake@unixhub.slac.stanford.edu:/nfs/juno/u5/dist" # # Modifications # # Apr 11, 1996 L.Lista Added single directory copy # ################################################################ # process options test=0 prod=0 #amj:FNAL: getopts has replaced getopt as recommended usage on SGI and # DECUnix. Only getopts exists in the cygnus NT system. while getopts tpv c do case $c in p) prod=1; test=0;; esac done shift `expr $OPTIND - 1` if [ "$prod" -ne 1 ]; then echo "-p option is currently required" exit 2 fi # check for correct number of arguments if [ "$#" -ne 2 ]; then if [ "$#" -ne 3 ]; then echo "Two or three arguments required" exit 2 fi fi release=$1 arch=$2 directory='*' if [ ${3:-''} != '' ] then directory=$3 fi # make sure the package directory exists if [ -r $BFDIST/packages/$package ]; then : else mkdir $BFDIST/packages/$package fi # parse the remote access # set the pathname OIFS=$IFS IFS=: set $BFDISTr IFS=$OIFS rempathname=$2 sitestring=$1 # find site and user OIFS=$IFS IFS=@ set $sitestring IFS=$OIFS if [ $# -eq 2 ]; then remuser=" -l $1 " else remuser="" fi shiftcount=`expr $# - 1` shift $shiftcount remsite=$1 # some machines need "remsh" instead of "rsh" rsh="rsh" if [ `echo $BFARCH | cut -c1-5` = HP-UX ]; then rsh="remsh" fi # OSF compress and uncompress truncate files compress="compress" uncompress="uncompress" if [ `echo $BFARCH | cut -c1-3` = OSF ]; then compress="cat" uncompress="cat" fi # copy it echo "copying $directory/$arch" cd $BFDIST/releases/$release $rsh $remsite $remuser \(cd $rempathname/releases/$release\; tar cf - $directory/$arch \| $compress\)| $uncompress | tar xf - exit