File indexing completed on 2024-04-06 12:08:34
0001
0002 use DirHandle;
0003
0004 ($#ARGV >= 2) || die "Usage::install_env.pl libdir moddir conffile";
0005 $libdir = @ARGV[0];
0006 $moddir = @ARGV[1];
0007 $confpath = @ARGV[2];
0008 !(-e $libdir) || die "ERROR::$libdir exists. Please remove it or choose another name";
0009 !(-e $moddir) || die "ERROR::$moddir exists. Please remove it or choose another name";
0010 $pid = $$;
0011 $envfile = "/tmp/cmsswenv$pid.tmp";
0012 print "creating emvironment file $envfile\n";
0013 system `scramv1 runtime -sh > $envfile`;
0014
0015 system `echo "export SEAL_PLUGINS=\"$ENV{SEAL_PLUGINS}\"\;" >> $envfile`;
0016 system `echo "export CMSSW_RELEASE_BASE=\"$ENV{CMSSW_RELEASE_BASE}\"\;" >> $envfile`;
0017 system `echo "export ORACLE_HOME=\"$ENV{ORACLE_HOME}\"\;" >> $envfile`;
0018 system `echo "export TNS_ADMIN=\"$ENV{TNS_ADMIN}\"\;" >> $envfile`;
0019 system `echo "export ROOTSYS=\"$ENV{ROOTSYS}\"\;" >> $envfile`;
0020 system `echo "export SEAL=\"$ENV{SEAL}\"\;" >> $envfile`;
0021 system `echo "export SEAL_KEEP_MODULES=\"$ENV{SEAL_KEEP_MODULES}\"\;" >> $envfile`;
0022 system `echo "export POOL_OUTMSG_LEVEL=\"$ENV{POOL_OUTMSG_LEVEL}\"\;" >> $envfile`;
0023 system `echo "export POOL_STORAGESVC_DB_AGE_LIMIT=\"$ENV{POOL_STORAGESVC_DB_AGE_LIMIT}\"\;" >> $envfile`;
0024 system `echo "export CMSSW_DATA_PATH=\"$ENV{CMSSW_DATA_PATH}\"\;" >> $envfile`;
0025 system `echo "export CMSSW_SEARCH_PATH=\"$ENV{CMSSW_SEARCH_PATH}\"\;" >> $envfile`;
0026
0027 print "creating library clones at $libdir\n";
0028 `copyFUlibs.pl $envfile $libdir`;
0029 print "creating module clones at $moddir\n";
0030 `copyFUmodules.pl $envfile $moddir`;
0031 print "fixing libs and mods at $libdir, $moddir\n";
0032 `fix_libs.pl $libdir $moddir`;
0033 print "recreating edm cache file in $libdir\n";
0034 `reset_edm_cache.pl $libdir $moddir --`;
0035 print "recreating seal cache file in $moddir\n";
0036 `reset_seal_cache.pl $libdir $moddir --`;
0037 print "preparing config string for DuckCad at $confpath\n";
0038 open(CONF,"$envfile");
0039 open(OUT, ">$confpath");
0040 print OUT "LD_LIBRARY_PATH=$libdir ";
0041 print OUT "SEAL_PLUGINS=$moddir ";
0042 while(<CONF>) {
0043 s/export (.+)/$1/;
0044 s/;//;
0045 s/"//g;
0046 s/\n//;
0047 print OUT "$_ " if /XDAQ_ROOT/;
0048 print OUT "$_ " if !/^SCRAMRT/ & /POOL_STORAGESVC_DB_AGE_LIMIT/;
0049 print OUT "$_ " if !/^SCRAMRT/ & /SEAL=/;
0050 print OUT "$_ " if !/^SCRAMRT/ & /SEAL_KEEP_MODULES/;
0051 print OUT "$_ " if !/^SCRAMRT/ & /ROOTSYS/;
0052 print OUT "$_ " if !/^SCRAMRT/ & /POOL_OUTMSG_LEVEL/;
0053 print OUT "$_ " if !/^SCRAMRT/ & /CMSSW_VERSION/;
0054 print OUT "$_ " if !/^SCRAMRT/ & /CMSSW_BASE/;
0055 print OUT "$_ " if !/^SCRAMRT/ & /TNS_ADMIN/;
0056 print OUT "$_ " if !/^SCRAMRT/ & /CMSSW_SEARCH_PATH/;
0057 }