telephonyserverplugins/attestltsy/config/modifycenrep.pl
branchAT_Test_LTSY
changeset 51 6012a0dcf61c
parent 10 4d82aaca4452
equal deleted inserted replaced
34:7c3d96ebb735 51:6012a0dcf61c
    15 # This script modifies the CCE plugin cenrep file to use the CS plugin rather than the VCC one.
    15 # This script modifies the CCE plugin cenrep file to use the CS plugin rather than the VCC one.
    16 # 
    16 # 
    17 #
    17 #
    18 
    18 
    19 use strict;
    19 use strict;
       
    20 use File::Copy;
    20 
    21 
    21 # Open the cenrep files
    22 # Open the cenrep files
    22 my $cenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.txt";
    23 my $cenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.txt";
    23 my $newcenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.tmp";
    24 my $newcenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.tmp";
    24 my $cenrepbak = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.bak";
    25 my $cenrepbak = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.bak";
       
    26 my $cenreprom = "/epoc32/data/z/private/10202be9/10282E7F.txt";
       
    27 my $cenreprombak = "/epoc32/data/z/private/10202be9/10282E7F.bak";
    25 my $file2string;
    28 my $file2string;
    26 
    29 
    27 # Open the file in UNICODE-16 and read the whole contents into a string
    30 # Open the file in UNICODE-16 and read the whole contents into a string
    28 open(my $CENREPREAD, "<:raw:encoding(UTF-16LE):crlf:utf8", $cenrep) or die "Couldn't open current cenrep file";
    31 open(my $CENREPREAD, "<:raw:encoding(UTF-16LE):crlf:utf8", $cenrep) or die "Couldn't open current cenrep file";
    29 {
    32 {
    40 print $CENREPOUT $file2string;
    43 print $CENREPOUT $file2string;
    41 close($CENREPOUT);
    44 close($CENREPOUT);
    42 
    45 
    43 
    46 
    44 # Now backup the old and copy the new files
    47 # Now backup the old and copy the new files
    45 rename($cenrep, $cenrepbak) or die "Couldn't backup feature data file '$cenrep'\n" unless (-e $cenrepbak); # OK for this to fail as it probably just means there's already a backup
    48 rename($cenreprom, $cenreprombak) or die "Couldn't backup ROM cenrep file '$cenrep'\n" unless (-e $cenrepbak); # OK for this to fail as it probably just means there's already a backup
    46 rename($newcenrep, $cenrep) or die "Couldn't copy feature data file '$newcenrep'\n";
    49 copy($newcenrep, $cenreprom) or die "Couldn't copy the cenrep file for ROM usage '$cenreprom'\n";
       
    50 rename($cenrep, $cenrepbak) or die "Couldn't backup cenrep file '$cenrep'\n" unless (-e $cenrepbak); # OK for this to fail as it probably just means there's already a backup
       
    51 rename($newcenrep, $cenrep) or die "Couldn't copy cenrep file '$newcenrep'\n";
    47 
    52 
    48 print "\tCCE CenRep Setup\n";
    53 print "\tCCE CenRep Setup\n";