** Warning **

Issuing rollback() due to DESTROY without explicit disconnect() of DBD::mysql::db handle dbname=lxr at /lxr/lib/LXR/Common.pm line 1113.

Last-Modified: Wed, 18 Jun 2024 02:20:49 GMT Content-Type: text/html; charset=utf-8 /CMSSW_14_1_X_2024-06-17-2300/PhysicsTools/NanoAODTools/standalone/checkoutStandalone.sh
Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:46

0001 #! /bin/bash -e
0002 #
0003 # Check out PhysicsTools/NanoAODToos as a standalone package. 
0004 # 
0005 
0006 DEST="MyProject"
0007 REPO=https://github.com/cms-sw/cmssw.git
0008 BRANCH=master
0009 
0010 while getopts ":d:r:b:" opt; do
0011     case $opt in
0012         d) DEST=$OPTARG ;;
0013         r) REPO=$OPTARG ;;
0014         b) BRANCH=$OPTARG ;;
0015         :) echo "Error: -${OPTARG} requires an argument."
0016            exit 1;;
0017         *) echo "Options:"
0018            echo "-d  destination folder (default: MyProject)"
0019            echo "-r  repository (default: https://github.com/cms-sw/cmssw.git)"
0020            echo "-b  branch (default: master)"
0021            exit 1
0022     esac
0023 done
0024 
0025 echo "Checking out NanoAODTools in standalone mode in folder $DEST"
0026 
0027 # check if a shared reference repository is available, otherwise set up a personal one
0028 if [ "$CMSSW_GIT_REFERENCE" = "" ]; then
0029   if [ -e /cvmfs/cms-ib.cern.ch/git/cms-sw/cmssw.git ] ; then
0030     CMSSW_GIT_REFERENCE=/cvmfs/cms-ib.cern.ch/git/cms-sw/cmssw.git
0031   elif [ -e /cvmfs/cms.cern.ch/cmssw.git.daily ] ; then
0032     CMSSW_GIT_REFERENCE=/cvmfs/cms.cern.ch/cmssw.git.daily
0033   else
0034     CMSSW_GIT_REFERENCE=None
0035   fi
0036 fi
0037 
0038 
0039 if [ "$CMSSW_GIT_REFERENCE" != "None" ]; then
0040     git clone --branch $BRANCH --no-checkout --reference $CMSSW_GIT_REFERENCE $REPO $DEST
0041 else
0042     # No reference repository available: make a local shallow clone
0043     git clone --branch $BRANCH --depth 1 --no-checkout $REPO $DEST
0044 fi
0045 
0046 # Setup sparse checkout (manually, to skip top-level files)
0047 cd $DEST
0048 git config core.sparsecheckout true
0049 {
0050   echo "/.gitignore"
0051   echo "/.clang-tidy"
0052   echo "/.clang-format"
0053   echo "!/*/"
0054   echo "/PhysicsTools/"
0055   echo "!/PhysicsTools/*/"
0056   echo "/PhysicsTools/NanoAODTools/"
0057 } > .git/info/sparse-checkout
0058 git read-tree -mu HEAD
0059 
0060 # Initialize python module paths
0061 source PhysicsTools/NanoAODTools/standalone/env_standalone.sh build