#! /bin/sh # # importrelonly # # Shell script to import a release in the # the BaBar code system from another site # # Neil Geddes, July 1995, based on importrel # # (Test releases are not yet supported) # # Options: # -p Reference a production release. (required) # -a Target architectures (one per required architecture, # overrides default = $BFARCH) # # Arguments: # Number of release # # 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" # # It would be very useful to only tar and transmit "interesting" # subdirectories based on which BFARCH values a site wants to # receive. # # Modifications: # # 03-Jul-1995 NiG Add support for selecting arhcitectures # based on $BFARCH # 04-Jul-1995 NiG Add -a option to specify architectures # ################################################################ # process options test=0 prod=0 ArchList="" #amj:FNAL: getopts has replaced getopt as recommended usage on SGI and # DECUnix. Only getopts exists in the cygnus NT system. while getopts tp:va: c do case $c in p) prod=1; release=$OPTARG ; test=0;; a) ArchList="$ArchList -a $OPTARG";; esac done shift `expr $OPTIND - 1` if [ "$prod" -ne 1 ]; then echo "-p option is currently required" exit 2 fi #NiG check for correct number of arguments #NiG if [ "$#" -ne 1 ]; then #NiG echo "One argument required" #NiG exit 2 #NiG fi if [ "$ArchList" = "" ] ; then ArchList="-a $BFARCH" fi # make sure the release directory exists if [ -r $BFDIST/releases ]; then : else mkdir $BFDIST/releases 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 # check existance of release here if [ -r $BFDIST/releases/$release ]; then echo Release $release already here exit fi # some machines call "rsh" "remsh" rsh="rsh" if [ `echo $BFARCH | cut -c1-5` = HP-UX ]; then rsh="remsh" fi # In case somebody doesnt have compress compress="compress" uncompress="uncompress" #if [ "$BFARCH" = "???" ]; then # compress="cat" # uncompress="cat" #fi # copy it cd $BFDIST/releases # First make a list of files we want $rsh $remsite $remuser \(cd $rempathname/releases\; ~/makeReleaseList -r $release $ArchList \> $USER.filelist \) # Now ship the files across $rsh $remsite $remuser \(cd $rempathname/releases\; \ cpio -o \< $USER.filelist \| $compress \) \ | $uncompress | cpio -id # and pick up the versions if needed for var in `ls $BFDIST/releases/$release` do line=`ls -ltd $BFDIST/releases/$release/$var | grep -i " ->"` if [ "$line" ]; then OIFS=$IFS IFS=/ set $line IFS=$OIFS shiftcount=`expr $# - 2` shift $shiftcount package=$1 version=$2 echo importver -p $package $version importver -p $package $version fi done exit