generate_param_info
2.77 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
if [[ -z ${NEWMETA+x} || -z ${AMDAINSTALLATION+x} ]]; then
echo "check if NEWMETA & AMDAINSTALLATION env variables are defined"
exit
fi
CRT_PWD=`pwd`
cd $AMDAINSTALLATION/AMDA_Kernel/app-generate-paraminfo
export PATH=$AMDAINSTALLATION/AMDA_Kernel/build/${BUILD_TYPE}/bin:$PATH
export DDPATH=$AMDAINSTALLATION/AMDA_Kernel/app-generate-paraminfo
PARAM_INFO_PATH=$NEWMETA/ParamInfo
if [ ! -d "$PARAM_INFO_PATH" ]; then
mkdir "$PARAM_INFO_PATH"
fi
# if predefined param info exists - copy it to NEWMETA/ParamInfo
# to avoid not needed calculations
if [ -d $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED ]; then
cp $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED/info*.xml $PARAM_INFO_PATH
fi
for param_file in $NEWMETA/final/*.xml
do
param_filename=$(basename "${param_file%.*}")
info_file=info_${param_filename}.xml
if [ -e $PARAM_INFO_PATH/$info_file ]
then
echo ${param_filename} exists
else
echo "Generate info file for ${param_filename}"
php $UPDATEDIR/preprocessInfo.php ${param_filename}
fi
done
#modif in app.properties
if [ ! -e ./app.properties ]; then
echo "No app.properties file !!!"
exit
fi
if [ -e ./app.properties.temp ]; then
# rm ./app.properties.temp
echo "Seems ./app.properties has been modified already"
else
while read line
do
if [[ $line == app.param.path* ]]; then
line="app.param.path="$NEWMETA"final/"
fi
if [[ $line == app.dataSetInfo.path* ]]; then
line="app.dataSetInfo.path="$NEWMETA"datasets/"
fi
if [[ $line == app.user.name* ]]; then
line="app.user.name="$DDUSER
fi
if [[ $line == app.plugin* ]]; then
line="app.plugin=./../build/"$BUILD_TYPE"/plugin/"
fi
if [[ $line == app.process.LIB* ]]; then
line="app.process.LIB=-L../build/"$BUILD_TYPE"/lib/ -lParameters"
fi
echo $line >> ./app.properties.temp
done < <(cat $AMDAINSTALLATION/AMDA_Kernel/app-generate-paraminfo/app.properties)
cp ./app.properties.temp $AMDAINSTALLATION/AMDA_Kernel/app-generate-paraminfo/app.properties
fi
DDLogin $DDUSER $DDPASS
for param_file in $NEWMETA/final/*.xml
do
param_filename=$(basename "${param_file%.*}")
info_file=info_${param_filename}.xml
if [ -e $NEWMETA/ParamInfo/$info_file ]
then
echo ${param_filename} exists
else
echo "Generate info file for ${param_filename}"
amdaParameterInfo -p ${param_filename}
if [ $? -eq 0 ]; then
mv $info_file $PARAM_INFO_PATH
fi
fi
done
# copy info for parameter arguments
if [ ! -d $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo ]; then
mkdir $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
fi
cp $PARAM_INFO_PATH/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
cd ${CRT_PWD}