-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcmsset_default.sh
executable file
·72 lines (61 loc) · 1.76 KB
/
cmsset_default.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
cms_basedir=@CMS_PREFIX@
here=${cms_basedir}
export PATH=${cms_basedir}/common:$PATH
if [ "$VO_CMS_SW_DIR" != "" ]
then
here=$VO_CMS_SW_DIR
else
if [ ! "X$OSG_APP" = "X" ] && [ -d "$OSG_APP/cmssoft/cms" ]; then
here="$OSG_APP/cmssoft/cms"
fi
fi
if [ ! $SCRAM_ARCH ]
then
SCRAM_ARCH=$(${cms_basedir}/common/cmsarch)
if [ ! -d ${here}/${SCRAM_ARCH}/etc/profile.d ]
then
SCRAM_ARCH=$(echo ${SCRAM_ARCH} | cut -d_ -f1 | sed -E 's/^(cs|cc|alma|rocky|rhel)/el/')_$(echo ${SCRAM_ARCH} | cut -d_ -f2-)
fi
export SCRAM_ARCH
fi
#ZSH: load bash bashcompinit for command auto completion
if [[ $(ps -p$$ --no-headers -o cmd | cut -d' ' -f1) =~ ^.*zsh$ ]] ; then
autoload -U +X compinit && compinit -u
autoload -U +X bashcompinit && bashcompinit
fi
for arch in share ${SCRAM_ARCH} ; do
if [ -d $here/${arch}/etc/profile.d ]
then
for pkg in $(/bin/ls $here/${arch}/etc/profile.d/ | grep 'S.*[.]sh')
do
source $here/${arch}/etc/profile.d/$pkg
done
unset pkg
fi
done
if [ ! $CMS_PATH ]
then
export CMS_PATH=$here
fi
# decouple SITECONF location form CMS_PATH to allow sub-sites:
if [ ! $SITECONFIG_PATH ]
then
export SITECONFIG_PATH=${CMS_PATH}/SITECONF/local
fi
# aliases
function cmsenv(){ eval `scramv1 runtime -sh` ; }
function cmsrel(){ scramv1 project CMSSW $@; }
#zsh: export -f does not work so ignore the following errors
export -f cmsenv >/dev/null 2>&1 || true
export -f cmsrel >/dev/null 2>&1 || true
if [ -f $SITECONFIG_PATH/JobConfig/cmsset_local.sh ]; then
. $SITECONFIG_PATH/JobConfig/cmsset_local.sh
fi
if [ ! $CVSROOT ]
then
CVSROOT=:gserver:cmssw.cvs.cern.ch:/local/reps/CMSSW
export CVSROOT
fi
MANPATH=${CMS_PATH}/share/man:${MANPATH}
export MANPATH
unset here cms_basedir arch