telephonyserverplugins/attestltsy/config/modifycenrep.pl
author Tom Pritchard <tomp@symbian.org>
Fri, 16 Jul 2010 17:42:23 +0100
branchAT_Test_LTSY
changeset 51 6012a0dcf61c
parent 10 4d82aaca4452
permissions -rw-r--r--
Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     1
#!perl -w
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     2
# Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     3
# All rights reserved.
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     5
# under the terms of "Eclipse Public License v1.0"
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     8
#
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation - initial contribution.
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    11
#
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    12
# Contributors:
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    13
#
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    14
# Description:
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    15
# This script modifies the CCE plugin cenrep file to use the CS plugin rather than the VCC one.
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    16
# 
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    17
#
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    18
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    19
use strict;
51
6012a0dcf61c Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents: 10
diff changeset
    20
use File::Copy;
10
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    21
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    22
# Open the cenrep files
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    23
my $cenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.txt";
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    24
my $newcenrep = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.tmp";
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    25
my $cenrepbak = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.bak";
51
6012a0dcf61c Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents: 10
diff changeset
    26
my $cenreprom = "/epoc32/data/z/private/10202be9/10282E7F.txt";
6012a0dcf61c Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents: 10
diff changeset
    27
my $cenreprombak = "/epoc32/data/z/private/10202be9/10282E7F.bak";
10
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    28
my $file2string;
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    29
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    30
# Open the file in UNICODE-16 and read the whole contents into a string
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    31
open(my $CENREPREAD, "<:raw:encoding(UTF-16LE):crlf:utf8", $cenrep) or die "Couldn't open current cenrep file";
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    32
{
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    33
$/ =undef;
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    34
$file2string = <$CENREPREAD>;
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    35
}
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    36
close($CENREPREAD);
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    37
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    38
# Modify the crucial line to the new UID for CS calls rather than VCC
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    39
$file2string =~ s/0x9001 string \"536924074\"/0x9001 string \"271067365\"/g;
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    40
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    41
# Write out the contents into a new UNICODE-16 encoded file
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    42
open(my $CENREPOUT, ">:raw:encoding(UTF-16LE):crlf:utf8", $newcenrep) or die "Couldn't open new cenrep file for output";
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    43
print $CENREPOUT $file2string;
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    44
close($CENREPOUT);
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    45
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    46
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    47
# Now backup the old and copy the new files
51
6012a0dcf61c Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents: 10
diff changeset
    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
6012a0dcf61c Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents: 10
diff changeset
    49
copy($newcenrep, $cenreprom) or die "Couldn't copy the cenrep file for ROM usage '$cenreprom'\n";
6012a0dcf61c Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents: 10
diff changeset
    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
6012a0dcf61c Updating the config scripts for use with beagle ROMs and updating the PDD name for the UART connection used on target along with some .iby file updates
Tom Pritchard <tomp@symbian.org>
parents: 10
diff changeset
    51
rename($newcenrep, $cenrep) or die "Couldn't copy cenrep file '$newcenrep'\n";
10
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    52
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    53
print "\tCCE CenRep Setup\n";