Commit ceccbf4f authored by claes's avatar claes

upgrade.sh for 4.3

parent 31ee6469
...@@ -16,6 +16,7 @@ endif ...@@ -16,6 +16,7 @@ endif
vpath %.sh $(hw_source):$(os_source):$(co_source) vpath %.sh $(hw_source):$(os_source):$(co_source)
vpath %.pwr_com $(hw_source):$(os_source):$(co_source) vpath %.pwr_com $(hw_source):$(os_source):$(co_source)
vpath %.awk $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source) source_dirs = $(hw_source) $(os_source) $(co_source)
...@@ -37,10 +38,21 @@ pwr_com_sources := $(sort \ ...@@ -37,10 +38,21 @@ pwr_com_sources := $(sort \
) \ ) \
) )
awk_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.awk) \
), $(notdir $(file)) \
) \
)
export_sh := $(patsubst %.sh, $(exe_dir)/%.sh, $(sh_sources)) export_sh := $(patsubst %.sh, $(exe_dir)/%.sh, $(sh_sources))
clean_sh := $(patsubst %.sh, clean_%.sh, $(sh_sources)) clean_sh := $(patsubst %.sh, clean_%.sh, $(sh_sources))
export_pwr_com := $(patsubst %.pwr_com, $(exe_dir)/%.pwr_com, $(pwr_com_sources)) export_pwr_com := $(patsubst %.pwr_com, $(exe_dir)/%.pwr_com, $(pwr_com_sources))
clean_pwr_com := $(patsubst %.pwr_com, clean_%.pwr_com, $(pwr_com_sources)) clean_pwr_com := $(patsubst %.pwr_com, clean_%.pwr_com, $(pwr_com_sources))
export_awk := $(patsubst %.awk, $(exe_dir)/%.awk, $(awk_sources))
clean_awk := $(patsubst %.awk, clean_%.awk, $(awk_sources))
.PHONY : all init copy lib exe clean realclean\ .PHONY : all init copy lib exe clean realclean\
...@@ -50,7 +62,7 @@ all : init copy ...@@ -50,7 +62,7 @@ all : init copy
init : init :
copy : $(export_sh) $(export_pwr_com) copy : $(export_sh) $(export_pwr_com) $(export_awk)
lib : lib :
...@@ -58,7 +70,7 @@ exe : ...@@ -58,7 +70,7 @@ exe :
clean : clean :
realclean : clean $(clean_sh) $(clean_pwr_com) realclean : clean $(clean_sh) $(clean_pwr_com) $(clean_awk)
$(export_sh) : $(exe_dir)/%.sh : %.sh $(export_sh) : $(exe_dir)/%.sh : %.sh
@ echo "Exporting $< ..." @ echo "Exporting $< ..."
...@@ -69,10 +81,17 @@ $(export_pwr_com) : $(exe_dir)/%.pwr_com : %.pwr_com ...@@ -69,10 +81,17 @@ $(export_pwr_com) : $(exe_dir)/%.pwr_com : %.pwr_com
@ echo "Exporting $< ..." @ echo "Exporting $< ..."
@ $(cp) $(cpflags) $(source) $(target) @ $(cp) $(cpflags) $(source) $(target)
$(export_awk) : $(exe_dir)/%.awk : %.awk
@ echo "Exporting $< ..."
@ $(cp) $(cpflags) $(source) $(target)
$(clean_sh) : clean_%.sh : %.sh $(clean_sh) : clean_%.sh : %.sh
@ rm $(exe_dir)/$*.sh @ rm $(exe_dir)/$*.sh
$(clean_pwr_com) : clean_%.pwr_com : %.pwr_com $(clean_pwr_com) : clean_%.pwr_com : %.pwr_com
@ rm $(exe_dir)/$*.pwr_com @ rm $(exe_dir)/$*.pwr_com
$(clean_awk) : clean_%.awk : %.awk
@ rm $(exe_dir)/$*.awk
#! /bin/bash #! /bin/bash
# #
# Proview $Id: upgrade.sh,v 1.11 2006-09-07 14:14:07 claes Exp $ # Proview $Id: upgrade.sh,v 1.12 2007-01-23 13:16:56 claes Exp $
# Copyright (C) 2005 SSAB Oxelsund AB. # Copyright (C) 2005 SSAB Oxelsund AB.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
...@@ -50,9 +50,10 @@ reload_dumpdb() ...@@ -50,9 +50,10 @@ reload_dumpdb()
dump_file=$pwrp_db/$cdb.wb_dmp dump_file=$pwrp_db/$cdb.wb_dmp
echo "Dumping volume $cdb in $dump_file" echo "Dumping volume $cdb in $dump_file"
export pwr_load=$v41_root/os_linux/hw_x86/exp/load # export pwr_load=$v41_root/os_linux/hw_x86/exp/load
$v41_root/os_linux/hw_x86/exp/exe/wb_cmd -v $cdb wb dump/out=\"$dump_file\" # $v41_root/os_linux/hw_x86/exp/exe/wb_cmd -v $cdb wb dump/out=\"$dump_file\"
export pwr_load=$pwrb_root/os_linux/hw_x86/exp/load # export pwr_load=$pwrb_root/os_linux/hw_x86/exp/load
wb_cmd -v $cdb wb dump/out=\"$dump_file\"
done done
} }
...@@ -183,7 +184,7 @@ reload_cnvdump() ...@@ -183,7 +184,7 @@ reload_cnvdump()
if [ $db = "wb.db" ]; then if [ $db = "wb.db" ]; then
db="" db=""
else else
source $pwr_exe/upgrade_cnvdmp.sh $dmpfile $pwrp_tmp/t.wb_dmp awk -f $pwr_exe/upgrade_dmp.awk $dmpfile > $pwrp_tmp/t.wb_dmp
mv $pwrp_tmp/t.wb_dmp $dmpfile mv $pwrp_tmp/t.wb_dmp $dmpfile
fi fi
done done
...@@ -458,9 +459,8 @@ usage() ...@@ -458,9 +459,8 @@ usage()
{ {
cat << EOF cat << EOF
upgrade.sh Upgrade from V3.4 or V3.9 to V4.0. upgrade.sh Upgrade from V4.2.0 to V4.3.0
Arguments Project name.
Pass Pass
...@@ -468,12 +468,12 @@ usage() ...@@ -468,12 +468,12 @@ usage()
classvolumes Create loadfiles for classvolumes. classvolumes Create loadfiles for classvolumes.
renamedb Rename old databases. renamedb Rename old databases.
dirvolume Load the directory volume. dirvolume Load the directory volume.
cnvdump Convert dumpfiles.
loaddb Load dumpfiles. loaddb Load dumpfiles.
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.
Note!
EOF EOF
} }
...@@ -510,8 +510,8 @@ for db in $tmp; do ...@@ -510,8 +510,8 @@ for db in $tmp; do
fi fi
done done
passes="dumpdb classvolumes renamedb dirvolume loaddb compile createload createboot" passes="dumpdb classvolumes renamedb dirvolume cnvdump loaddb compile createload createboot"
echo "Pass: $passes" #echo "Pass: $passes"
echo "" echo ""
echo -n "Enter start pass [dumpdb] > " echo -n "Enter start pass [dumpdb] > "
read start_pass read start_pass
......
BEGIN {
innum = 0;
inbody = 0;
par = "";
}
{
if ( $3 == "CStoNumSp") {
innum = 1;
inbody = 0;
}
if ( innum) {
if ( $1 == "Body" && $2 == "DevBody") {
inbody = 1;
}
if ( inbody) {
if ( $1 == "EndBody") {
printf( "Attr Object = \"%s\"\n", par);
printf( "%s\n", $0);
innum = 0;
}
else if ( $1 == "EndObject") {
innum = 0;
printf( "%s\n", $0);
}
else if ( $1 == "Attr" && $2 == "Object") {
par = substr( $4, 2, length($4)-2);
}
else if ( $1 == "Attr" && $2 == "Parameter") {
par = par "." substr($4,2,length($4)-2);
printf( "Attr Object = \"%s\"\n", par);
innum = 0;
}
else {
printf( "%s\n", $0);
}
}
else {
printf( "%s\n", $0);
}
}
else {
printf( "%s\n", $0);
}
}
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