Commit c74971b4 authored by Claes Sjofors's avatar Claes Sjofors

Upgrade script for 4.7.1

parent 6f6df6ce
...@@ -87,11 +87,12 @@ reload_classvolumes() ...@@ -87,11 +87,12 @@ reload_classvolumes()
list=`eval ls -1d $pwrp_db/*.wb_load` list=`eval ls -1d $pwrp_db/*.wb_load`
echo "" echo ""
echo "Found classvolumes: "
for file in $list; do for file in $list; do
volume=`eval grep pwr_eClass_ClassVolume $file | awk '{ print $2 }'` volume=`eval head -n 1 $file | grep pwr_eClass_ClassVolume | awk '{ print $2 }'`
if [ "$volume" == "" ]; then if [ "$volume" == "" ]; then
volume=`eval grep ClassVolume $file | awk '{ print $2 }'` volume=`eval head -n 1 $file | grep ClassVolume | awk '{ print $2 }'`
volumelow=`eval grep ClassVolume $file | awk '{ print tolower($2) }'` volumelow=`eval head -n 1 $file | grep ClassVolume | awk '{ print tolower($2) }'`
fi fi
if [ "$volume" != "" ]; then if [ "$volume" != "" ]; then
echo $file echo $file
...@@ -263,17 +264,29 @@ reload_cnvobjects() ...@@ -263,17 +264,29 @@ reload_cnvobjects()
return return
fi fi
reload_continue "Pass convert objects in loaded db" echo "***"
echo "*** Note! "
echo "*** This pass should only be executed of you upgrade"
echo "*** from V4.6, not if you upgrade from V4.7.0 "
echo "***"
list=`eval ls -1d $pwrp_db/*.db` echo -n "Do you want to execute this pass ? [y/n] "
for file in $list; do read repl
file=${file##/*/}
file=${file%%.*}
if [ $file != "directory" ] && [ $file != "rt_eventlog" ]; then if [ "$repl" == "y" ]; then
wb_cmd -v $file @$pwr_exe/upgrade_pb.pwr_com
fi reload_continue "Pass convert objects in loaded db"
done
list=`eval ls -1d $pwrp_db/*.db`
for file in $list; do
file=${file##/*/}
file=${file%%.*}
if [ $file != "directory" ] && [ $file != "rt_eventlog" ]; then
wb_cmd -v $file @$pwr_exe/upgrade_pb.pwr_com
fi
done
fi
reload_status=$reload__success reload_status=$reload__success
} }
...@@ -542,18 +555,15 @@ usage() ...@@ -542,18 +555,15 @@ usage()
{ {
cat << EOF cat << EOF
upgrade.sh Upgrade from V4.6 to V4.7 upgrade.sh Upgrade from V4.7.0 to V4.7.1
Pass Pass
dumpdb Dump database to textfile \$pwrp_db/'volume'.wb_dmp
directorystructure Change directory structure.
classvolumes Create loadfiles for classvolumes. classvolumes Create loadfiles for classvolumes.
renamedb Rename old databases. renamedb Rename old databases.
dirvolume Create directory volume. cnvdump Convert the dump files.
loaddb Load dumpfiles. loaddb Load dumpfiles.
cnvobjects Convert objects in the database.
compile Compile all plcprograms in the database compile Compile all plcprograms in the database
createload Create new loadfiles. createload Create new loadfiles.
createboot Create bootfiles for all nodes in the project. createboot Create bootfiles for all nodes in the project.
...@@ -594,14 +604,14 @@ for db in $tmp; do ...@@ -594,14 +604,14 @@ for db in $tmp; do
fi fi
done done
passes="dumpdb directorystructure classvolumes renamedb dirvolume loaddb cnvobjects compile createload createboot" passes="classvolumes renamedb cnvdump loaddb compile createload createboot"
#echo "Pass: $passes" #echo "Pass: $passes"
echo "" echo ""
echo -n "Enter start pass [dumpdb] > " echo -n "Enter start pass [classvolumes] > "
read start_pass read start_pass
if [ -z $start_pass ]; then if [ -z $start_pass ]; then
start_pass="dumpdb" start_pass="classvolumes"
fi fi
for cpass in $passes; do for cpass in $passes; do
......
BEGIN { BEGIN {
innum = 0; innum = 0;
inbody = 0; inbody = 0;
pos = 0;
par = ""; par = "";
} }
{ {
if ( $3 == "CStoNumSp") { if ( $3 == "BaseFcPPO5PbModule" || $3 == "BaseFcPPO3PbModule" ||
$3 == "ABB_ACS_PPO5" || $3 == "ABB_ACC_PPO5") {
innum = 1; innum = 1;
inbody = 0; inbody = 0;
} }
if ( innum) { if ( innum) {
if ( $1 == "Body" && $2 == "DevBody") { if ( $1 == "Body" && $2 == "RtBody") {
inbody = 1; inbody = 1;
} }
if ( inbody) { if ( inbody) {
if ( $1 == "EndBody") { if ( $1 == "EndBody") {
printf( "Attr Object = \"%s\"\n", par);
printf( "%s\n", $0); printf( "%s\n", $0);
innum = 0; innum = 0;
} }
...@@ -23,13 +24,24 @@ BEGIN { ...@@ -23,13 +24,24 @@ BEGIN {
innum = 0; innum = 0;
printf( "%s\n", $0); printf( "%s\n", $0);
} }
else if ( $1 == "Attr" && $2 == "Object") { else if ( $1 == "Attr") {
par = substr( $4, 2, length($4)-2); pos = index($2, ".");
} if ( pos != 0) {
else if ( $1 == "Attr" && $2 == "Parameter") { a1 = substr( $2, 1, pos - 1);
par = par "." substr($4,2,length($4)-2); a2 = substr( $2, pos + 1, length($2) - pos + 1);
printf( "Attr Object = \"%s\"\n", par);
innum = 0; if ( substr( a1, 1, 2) == "I_" || substr( a1, 1, 2) == "O_") {
# printf( "Attr Io.%s.%s = %s\n", a1, a2, $4);
$2 = "Io." $2;
printf( " %s\n", $0);
}
else {
printf( "%s\n", $0);
}
}
else {
printf( "%s\n", $0);
}
} }
else { else {
printf( "%s\n", $0); printf( "%s\n", $0);
......
...@@ -40,9 +40,18 @@ main ...@@ -40,9 +40,18 @@ main
int i; int i;
string rttconfig; string rttconfig;
string webhandler; string webhandler;
string c;
!verify(1); !verify(1);
op = GetNodeObject();
op = op + "-OpDefault";
c = GetObjectClass( op);
if ( c != "")
printf( "Database is already converted\n");
exit();
endif
! For all OpPlace objects ! For all OpPlace objects
op = GetClassList( "OpPlace"); op = GetClassList( "OpPlace");
while ( op != "") while ( op != "")
......
ifndef lib_local_mk
lib_local_mk := 1
vpath %.pwsg $(hw_source):$(os_source):$(co_source)
vpath %.dat $(hw_source):$(os_source):$(co_source)
pwsg_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/pwr_*.pwsg) \
), $(notdir $(file)) \
) \
)
export_pwsg := $(addprefix $(exe_dir)/,$(pwsg_sources))
clean_pwsg := $(patsubst %.pwsg, clean_%.pwsg, $(pwsg_sources))
l_copy := $(export_pwsg) $(exe_dir)/pwr_ge_setup.dat $(src_dir)/ge_colors.dat
l_clean_copy := $(clean_pwsg) clean_dat
clean_dat :
@ $(rm) $(rmflags) $(exe_dir)/pwr_ge_setup.dat
@ $(rm) $(rmflags) $(src_dir)/ge_colors.dat
$(exe_dir)/pwr_ge_setup.dat : pwr_ge_setup.dat
@ $(log_export)
@ copy/nolog $(source) $(target)
$(src_dir)/ge_colors.dat : ge_colors.dat
@ $(log_export)
@ $(cp) $(source) $(target)
$(exe_dir)/%.pwsg : %.pwsg
@ $(log_export)
@ $(cp) $(source) $(target)
$(clean_pwsg) : clean_%.pwsg : %.pwsg
@ $(rm) $(rmflags) $(exe_dir)/$(notdir $<)
endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment