telephonyserverplugins/attestltsy/config/modifycenrep.pl
author Tom Pritchard <tomp@symbian.org>
Tue, 02 Mar 2010 21:40:14 +0000
branchAT_Test_LTSY
changeset 10 4d82aaca4452
child 51 6012a0dcf61c
permissions -rw-r--r--
Updating the config scripts and adding support for updating the CCE CenRep file
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;
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    20
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    21
# 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
    22
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
    23
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
    24
my $cenrepbak = "/epoc32/release/winscw/UDEB/z/private/10202be9/10282E7F.bak";
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    25
my $file2string;
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    26
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    27
# 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
    28
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
    29
{
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    30
$/ =undef;
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    31
$file2string = <$CENREPREAD>;
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
close($CENREPREAD);
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    34
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    35
# 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
    36
$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
    37
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    38
# 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
    39
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
    40
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
    41
close($CENREPOUT);
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    42
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    43
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    44
# Now backup the old and copy the new files
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    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
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    46
rename($newcenrep, $cenrep) or die "Couldn't copy feature data file '$newcenrep'\n";
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    47
4d82aaca4452 Updating the config scripts and adding support for updating the CCE CenRep file
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    48
print "\tCCE CenRep Setup\n";