sbsv1_os/e32toolp/group/setver.bat
changeset 0 83f4b4db085c
child 1 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     1 @rem
       
     2 @rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 @rem All rights reserved.
       
     4 @rem This component and the accompanying materials are made available
       
     5 @rem under the terms of "Eclipse Public License v1.0"
       
     6 @rem which accompanies this distribution, and is available
       
     7 @rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 @rem
       
     9 @rem Initial Contributors:
       
    10 @rem Nokia Corporation - initial contribution.
       
    11 @rem
       
    12 @rem Contributors:
       
    13 @rem
       
    14 @rem Description:
       
    15 @rem
       
    16 @echo off
       
    17 
       
    18 goto Invoke
       
    19 
       
    20 #!perl
       
    21 
       
    22 #
       
    23 # use to set the version in relevant e32toolp files.
       
    24 #
       
    25 # Add new files requiring this service to the @InputFiles list below.
       
    26 #
       
    27 # Each file must contain the text to be changed in the form
       
    28 # 'version=xxx', where xxx is a 3 digit number.
       
    29 #
       
    30 
       
    31 use strict;
       
    32 
       
    33 my @InputFiles=qw(
       
    34 	\E32TOOLP\E32UTIL\E32TPVER.PM
       
    35 );
       
    36 	
       
    37 die "Usage:\nSETVER [version]\n" unless $#ARGV==0;
       
    38 
       
    39 my $Version=shift @ARGV;
       
    40 
       
    41 die "Unexpected version format\n" unless $Version=~/\d{3}/o;
       
    42 
       
    43 my $FILE;
       
    44 foreach $FILE (@InputFiles) {
       
    45 	open FILE, $FILE or die "Can't open \"$FILE\": $!\n";
       
    46 	my $FileText='';
       
    47 	my $Unchanged=1;
       
    48 	while (<FILE>) {
       
    49 		if ($Unchanged) {
       
    50 			$Unchanged=0 if s/^(.*version=)\d{3}([^\d]*.*)$/$1$Version$2/io;
       
    51 		}
       
    52 		$FileText.=$_;
       
    53 	}
       
    54 	open FILE,">$FILE" or die "Can't open \"$FILE\": $!\n";
       
    55 	print FILE $FileText;
       
    56 	close FILE or die "Can't close \"$FILE\": $!\n";
       
    57 }
       
    58 
       
    59 __END__
       
    60 
       
    61 :Invoke
       
    62 @rem command.com is rubbish and does not understand "%*"
       
    63 @shift
       
    64 @perl -x \E32TOOLP\GROUP\SETVER.BAT %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
       
    65 
       
    66 
       
    67 
       
    68 
       
    69 
       
    70 
       
    71 
       
    72 
       
    73 
       
    74 
       
    75 
       
    76 
       
    77 
       
    78