8 otsdaqVersion =
"s64-e15 prof";
11 os.path.isdir(os.environ[
'PRODUCTS']);
13 print "PRODUCTS variable not set.";
15 print "export PRODUCTS=`pwd`";
21 cmd=os.environ[
'PRODUCTS'];
25 if(os.path.isfile(
'pullProducts')):
26 os.remove(
'pullProducts');
29 cmd=
'curl -O http://scisoft.fnal.gov/scisoft/bundles/tools/pullProducts';
34 cmd=
'chmod +x pullProducts';
41 cmd =
'curl -s http://scisoft.fnal.gov/scisoft/bundles/otsdaq/ | grep id=\\"v | grep -oP \'(?<=id=\\")[^\\">]*\'';
43 process = subprocess.Popen(cmd, shell=
True, stdout=subprocess.PIPE, stderr=subprocess.PIPE);
44 otsdaq_version,err = process.communicate();
45 if(err !=
'' and not err.find(
'Total')):
46 print "There was an error executing \"" + cmd +
"\"";
47 print "Error:\n" + err;
49 otsdaq_versions = otsdaq_version.rstrip().split();
58 process = subprocess.Popen(cmd, shell=
True, stdout=subprocess.PIPE, stderr=subprocess.PIPE);
59 operatingSystem,err = process.communicate();
61 print "There was an error executing \"" + cmd +
"\"";
62 print "Error:\n" + err;
64 if "el6" in operatingSystem:
67 elif "el7" in operatingSystem:
76 for otsdaq_version
in reversed(otsdaq_versions):
77 print "Fetching products for otsdaq_version: " + otsdaq_version;
78 print "This step might take longer than you wish so be patient..."
79 cmd =
"./pullProducts . " + host_os +
" otsdaq-" + otsdaq_version +
" " + otsdaqVersion;
81 process = subprocess.Popen(cmd, shell=
True, stdout=subprocess.PIPE, stderr=subprocess.PIPE);
82 operatingSystem,err = process.communicate();
84 print "There was an error executing \"" + cmd +
"\"";
85 print "Error:\n" + err;
86 if( err.find(
'MANIFEST') == -1):
88 print "Trying to fetch an older otsdaq_version..."
95 cmd=
"rm -f *.bz2 *.txt";