Blame view

update_amda/cp2amda 2.02 KB
4c77b9b1   Elena.Budnik   final update
1
2
#!/bin/bash

99ae8744   Benjamin Renard   Use config variab...
3
4
5
6
SCRIPT=$(readlink -f "$0")
export UPDATEDIR=$(dirname "$SCRIPT")
. $UPDATEDIR/updateEnv.sh

cb36b2fe   Elena.Budnik   proper dirs perms
7
8
9
10
if [ ! -d "$LocalData" ]; then
	mkdir -m 775 $LocalData
fi

0577d36f   Elena.Budnik   new location for ...
11
# copy all info files
99ae8744   Benjamin Renard   Use config variab...
12
13
if [ ! -d "$DataSetInfo" ]; then
	mkdir $DataSetInfo
0577d36f   Elena.Budnik   new location for ...
14
fi
99ae8744   Benjamin Renard   Use config variab...
15
cp -f $NEWMETA/datasets/*.xml    $DataSetInfo
4c77b9b1   Elena.Budnik   final update
16

99ae8744   Benjamin Renard   Use config variab...
17
18
if [ ! -d $InstrumentInfo ]; then
	mkdir $InstrumentInfo
0577d36f   Elena.Budnik   new location for ...
19
fi
99ae8744   Benjamin Renard   Use config variab...
20
cp -f $NEWMETA/instruments/*.xml $InstrumentInfo
4c77b9b1   Elena.Budnik   final update
21

99ae8744   Benjamin Renard   Use config variab...
22
23
if [ ! -d $MissionInfo ]; then
	mkdir $MissionInfo
0577d36f   Elena.Budnik   new location for ...
24
fi
99ae8744   Benjamin Renard   Use config variab...
25
cp -f $NEWMETA/missions/*.xml    $MissionInfo
4c77b9b1   Elena.Budnik   final update
26

0577d36f   Elena.Budnik   new location for ...
27
# copy all Templates if exist
99ae8744   Benjamin Renard   Use config variab...
28
29
30
if [ -f "$AMDAINTERNALDIR/ParamTemplateList.xml" ]; then
	if [ ! -d "$ParamTemplate" ]; then
		mkdir $ParamTemplate
0577d36f   Elena.Budnik   new location for ...
31
32
	fi
	
99ae8744   Benjamin Renard   Use config variab...
33
34
   php $UPDATEDIR/mvTemplates.php  
   cp $AMDAINTERNALDIR/ParamTemplateList.xml $ParamTemplate
0577d36f   Elena.Budnik   new location for ...
35
36
fi

a0ca0101   Elena.Budnik   permissions dir
37
# copy all parameter descriptions 
99ae8744   Benjamin Renard   Use config variab...
38
if [ ! -d "$PARAMS_LOCALDB_DIR" ]; then
a0ca0101   Elena.Budnik   permissions dir
39
	mkdir -m 775 $PARAMS_LOCALDB_DIR
0577d36f   Elena.Budnik   new location for ...
40
fi  
99ae8744   Benjamin Renard   Use config variab...
41
cp $NEWMETA/final/*.xml  $PARAMS_LOCALDB_DIR
4873699c   Elena.Budnik   args generation f...
42
43

# if internal parameters not shown in the tree exist => copy them to AMDA Installation without processing
99ae8744   Benjamin Renard   Use config variab...
44
45
if [ -d "$AMDAINTERNALDIR/INTERNAL_PARAM_DEF" ]; then
	cp $AMDAINTERNALDIR/INTERNAL_PARAM_DEF/*  $PARAMS_LOCALDB_DIR
4873699c   Elena.Budnik   args generation f...
46
47
fi 

0577d36f   Elena.Budnik   new location for ...
48
# if special help exitsts => copy it to NEWMETA
99ae8744   Benjamin Renard   Use config variab...
49
if [ -d "$AMDAINTERNALDIR/HELP_PREDEFINED" ]; then 
4c77b9b1   Elena.Budnik   final update
50
	cp $AMDAINTERNALDIR/HELP_PREDEFINED/*  $NEWMETA/help
0577d36f   Elena.Budnik   new location for ...
51
fi
4c77b9b1   Elena.Budnik   final update
52
 
0577d36f   Elena.Budnik   new location for ...
53
# copy all help files
99ae8744   Benjamin Renard   Use config variab...
54
55
if [ ! -d "$HelpAuto" ]; then
	mkdir -p $HelpAuto	
4c77b9b1   Elena.Budnik   final update
56
fi 
99ae8744   Benjamin Renard   Use config variab...
57
cp $NEWMETA/help/*  $HelpAuto
4c77b9b1   Elena.Budnik   final update
58

99ae8744   Benjamin Renard   Use config variab...
59
60
61
if [ -d "$AMDAINTERNALDIR/HELP_PREDEFINED/img" ]; then
	if [ ! -d "$HelpAuto/img" ]; then
		mkdir $HelpAuto/img
4c77b9b1   Elena.Budnik   final update
62
	fi
99ae8744   Benjamin Renard   Use config variab...
63
	cp $AMDAINTERNALDIR/HELP_PREDEFINED/img/*   $HelpAuto/img
4c77b9b1   Elena.Budnik   final update
64
65
66
fi

# copy info for parameter arguments
99ae8744   Benjamin Renard   Use config variab...
67
68
69
if [ -d "$NEWMETA/ParamInfo" ]; then
	if [ ! -d "$PARAMS_LOCALINFO_DIR" ]; then
		mkdir $PARAMS_LOCALINFO_DIR
0577d36f   Elena.Budnik   new location for ...
70
	fi 
99ae8744   Benjamin Renard   Use config variab...
71
	cp $NEWMETA/ParamInfo/info*.xml $PARAMS_LOCALINFO_DIR
fe226876   Benjamin Renard   Merge branch mast...
72
        cp $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED/info*.xml $PARAMS_LOCALINFO_DIR
4c77b9b1   Elena.Budnik   final update
73
74
fi 

0577d36f   Elena.Budnik   new location for ...
75
# copy LocalParams.xml created by makeTree.php to AMDA installation 
99ae8744   Benjamin Renard   Use config variab...
76
77
78
if [ -d "$LocalData" ] && [ -f "$UPDATEDIR/LocalParams.xml" ]; then
	mv $UPDATEDIR/LocalParams.xml $LocalData
fi