diff -r 85578ba0aa08 -r be14ecca790f bldsystemtools/commonbldutils/renumber.pl --- a/bldsystemtools/commonbldutils/renumber.pl Fri Apr 16 16:10:01 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -# Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# Script to renumber the XML command file -# -# - -use strict; -use Getopt::Long; -use File::Copy; - -# Process the commandline -my ($iDataSource) = ProcessCommandLine(); - -&Renumber($iDataSource); - - -# ProcessCommandLine -# -# Inputs -# -# Outputs -# $iDataSource (XML file to process) -# -# Description -# This function processes the commandline - -sub ProcessCommandLine { - my ($iHelp, $iPort, $iDataSource, $iLogFile); - GetOptions('h' => \$iHelp, 'd=s' =>\$iDataSource ); - - if (($iHelp) || (!defined $iDataSource)) - { - Usage(); - } elsif (! -e $iDataSource) { - die "Cannot open $iDataSource"; - } else { - return($iDataSource); - } -} - -# Usage -# -# Description -# Output Usage Information. -# - -sub Usage { - print <$iDataSource" or die "Can't read $iDataSource"; - - while ($iLine=) - { - if ($iLine =~ /ID=\"\d+\"/) - { - $iLine =~ s/ID="\d+"\s+Stage="\d+"/ID="$iNum" Stage="$iNum"/; - $iNum++; - } - elsif ($iLine =~ /Order="\d+"/) - { - $iLine =~ s/Order="\d+"/Order="$iOrder"/; - $iOrder++; - } - print XMLOUT $iLine; - - } - - close XML; -}