Logo coherent WaveBurst  
Library Reference Guide
Logo
cwb_publish.C
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 // obsolete
20 
21 {
23  TB.checkFile(gSystem->Getenv("CWB_ROOTLOGON_FILE"));
24  TB.checkFile(gSystem->Getenv("CWB_PARAMETERS_FILE"));
25  TB.checkFile(gSystem->Getenv("CWB_UPARAMETERS_FILE"));
26 
27  TString cwb_pp_data_dir=TString(gSystem->Getenv("CWB_PP_DATA_DIR"));
28  if(cwb_pp_data_dir.Sizeof()>1) {
29  sprintf(pp_dir,"%s/%s",pp_dir,cwb_pp_data_dir.Data());
30  }
31 
32 
34  spp_dir.ReplaceAll(report_dir+TString("/"),"");
35 
36  char cmd[512];
37  if(TString(gSystem->Getenv("CWB_PUBLISH_OPTION")).CompareTo("clean")==0) {
38  cout << "clean publish dir" << endl;
39  sprintf(cmd,"rm %s/%s/%s",www_dir,data_label,spp_dir.Data());
40  cout << endl;
41  cout << cmd << endl;
42  gSystem->Exec(cmd);
43  } else {
44  TB.checkFile(pp_dir);
45 
46  sprintf(cmd,"mkdir %s/%s",www_dir,data_label);
47  cout << endl;
48  cout << cmd << endl;
49  gSystem->Exec(cmd);
50 
51  sprintf(cmd,"ln -sf %s/%s %s/%s/%s",work_dir,pp_dir,www_dir,data_label,spp_dir.Data());
52  cout << cmd << endl;
53  cout << endl;
54  gSystem->Exec(cmd);
55  }
56 
57  exit(0);
58 }
TString("c")
char www_dir[512]
Definition: test_config1.C:157
CWB::Toolbox TB
TString spp_dir
Definition: cwb_publish.C:33
char report_dir[512]
Definition: test_config1.C:149
static bool checkFile(TString fName, bool question=false, TString message="")
Definition: Toolbox.cc:4670
exit(0)
sprintf(cmd,"mkdir %s/%s", www_dir, data_label)
char data_label[512]
Definition: test_config1.C:160
TString cwb_pp_data_dir
Definition: cwb_publish.C:27
char pp_dir[512]
Definition: test_config1.C:155
char cmd[512]
Definition: cwb_publish.C:36
char work_dir[512]
Definition: test_config1.C:143