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/condbpro
0005 root=/data/O2O
0006 cmsswroot=/cvmfs/cms.cern.ch/
0007 extroot=/data/ext
0008 release=CMSSW_10_0_5
0009 arch=slc6_amd64_gcc630
0010 sourceroot=CondCore/Utilities/o2o/templates
0011 source=$cmsswroot/$arch/cms/cmssw/$release/src/$sourceroot
0012 
0013 files=( setup.sh
0014         setStrip.sh
0015         SiStripDCS.sh
0016         ecal_laser.sh
0017         EcalLaser.sh
0018         EcalLaserTest.sh
0019         EcalLaser_express.sh
0020         EcalLaser_expressTest.sh )
0021 
0022 folders=( EcalLaser
0023           EcalLaserTest
0024           EcalLaser_express
0025           EcalLaser_expressTest
0026           SiStrip )
0027 
0028 cd $root
0029 if [ ! -d scripts ]; then
0030     mkdir scripts
0031 fi
0032 if [ ! -d logs ]; then
0033     mkdir logs
0034 fi
0035 
0036 sed_fmt () {
0037   var=$(echo $1 | sed -e "s#/#\\\/#g")
0038 }
0039 
0040 replace_params () {
0041   params=( @root
0042            @home
0043            @cmsswroot
0044            @extroot )
0045   tgt_file=$1
0046   var=''
0047   # replace path params
0048   sed_fmt $root
0049   tgt_root=$var
0050   sed -i -e s/@root/$tgt_root/g $tgt_file
0051   sed_fmt $cmsswroot
0052   tgt_cmsswroot=$var
0053   sed -i -e s/@cmsswroot/$tgt_cmsswroot/g $tgt_file
0054   sed_fmt $extroot
0055   tgt_extroot=$var
0056   sed -i -e s/@extroot/$tgt_extroot/g $tgt_file
0057   sed_fmt $home
0058   tgt_home=$var
0059   # relace non-path params
0060   sed -i -e s/@home/$tgt_home/g $tgt_file
0061   sed -i -e s/@release/$release/g $tgt_file
0062   sed -i -e s/@arch/$arch/g $tgt_file
0063 }
0064 
0065 for file in "${files[@]}"
0066 do
0067     cp $source/$file scripts/
0068     tgt_file=scripts/$file
0069     replace_params $tgt_file
0070 done
0071 for f in "${folders[@]}"
0072 do  
0073     if [ ! -d $f ]; then
0074         mkdir -p $f
0075     fi
0076     if [ ! -d logs/$f ]; then
0077         mkdir logs/$f
0078     fi
0079 done