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