Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:48

0001 #!/bin/sh                                                                                                                                                                 
0002 
0003 home=~
0004 localhome=/data/popconpro
0005 root=/data/O2O
0006 cmsswroot=/opt/offline
0007 extroot=/data/ext
0008 release=CMSSW_10_0_5
0009 arch=slc7_amd64_gcc630
0010 sourceroot=CondCore/Utilities/o2o/templates
0011 source=$cmsswroot/$arch/cms/cmssw/$release/src/$sourceroot
0012 
0013 files=( setup.sh
0014         runStart.sh
0015         runTestStart.sh
0016         runStop.sh
0017         runTestStop.sh 
0018         EcalDAQ.sh
0019         EcalDAQTest.sh
0020         EcalDCS.sh
0021         EcalDCSTest.sh
0022         EcalTPG.sh
0023         RunInfoStart.sh
0024         RunInfoStop.sh
0025         RunInfoStartTest.sh
0026         RunInfoStopTest.sh )
0027 
0028 folders=( EcalDAQ 
0029           EcalDAQTest 
0030           EcalDCS 
0031           EcalDCSTest 
0032           EcalTPG 
0033           RunInfoStart
0034           RunInfoStop 
0035           RunInfoStartTest 
0036           RunInfoStopTest  )
0037 
0038 cd $root
0039 if [ ! -d scripts ]; then
0040     mkdir scripts
0041 fi
0042 if [ ! -d logs ]; then
0043     mkdir logs
0044 fi
0045 
0046 sed_fmt () {
0047   var=$(echo $1 | sed -e "s#/#\\\/#g")
0048 }
0049 
0050 replace_params () {
0051   params=( @root
0052            @home
0053            @cmsswroot
0054            @extroot )
0055   tgt_file=$1
0056   var=''
0057   # replace path params
0058   sed_fmt $root
0059   tgt_root=$var
0060   sed -i -e s/@root/$tgt_root/g $tgt_file
0061   sed_fmt $cmsswroot
0062   tgt_cmsswroot=$var
0063   sed -i -e s/@cmsswroot/$tgt_cmsswroot/g $tgt_file
0064   sed_fmt $extroot
0065   tgt_extroot=$var
0066   sed -i -e s/@extroot/$tgt_extroot/g $tgt_file
0067   sed_fmt $home
0068   tgt_home=$var
0069   # relace non-path params
0070   sed -i -e s/@home/$tgt_home/g $tgt_file
0071   sed -i -e s/@release/$release/g $tgt_file
0072   sed -i -e s/@arch/$arch/g $tgt_file
0073 }
0074 
0075 for file in "${files[@]}"
0076 do
0077     cp $source/$file scripts/
0078     tgt_file=scripts/$file
0079     replace_params $tgt_file
0080 done
0081 for f in "${folders[@]}"
0082 do  
0083     if [ ! -d $f ]; then
0084         mkdir -p $f
0085     fi
0086     if [ ! -d logs/$f ]; then
0087         mkdir logs/$f
0088     fi
0089 done