bldsystemtools/commonbldutils/BCupdateXML.pl
changeset 0 83f4b4db085c
child 1 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     1 #!perl -w
       
     2 # Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description:
       
    15 # Script to perform Build Launch Checks
       
    16 # 
       
    17 #
       
    18 
       
    19 use strict;
       
    20 use Getopt::Long;
       
    21 use FindBin;
       
    22 use lib "$FindBin::Bin";
       
    23 use BuildLaunchChecks;
       
    24 
       
    25 my %BCData;
       
    26 
       
    27 # Process the commandline
       
    28 my ($iBuildLaunch) = ProcessCommandLine();
       
    29 
       
    30 ($BCData{'BCToolsBaseBuildNo'}) = BuildLaunchChecks::GetBCValue(\%ENV);
       
    31 
       
    32 BuildLaunchChecks::UpdateXML($iBuildLaunch, \%BCData);
       
    33 
       
    34 
       
    35 # ProcessCommandLine
       
    36 #
       
    37 # Inputs
       
    38 #
       
    39 # Outputs
       
    40 # $iBuildLaunch (BuildLaunch xml file)
       
    41 #
       
    42 # Description
       
    43 # This function processes the commandline
       
    44 #
       
    45 
       
    46 sub ProcessCommandLine {
       
    47   my ($iBuildLaunch, $iHelp);
       
    48  
       
    49   GetOptions('x=s'   => \$iBuildLaunch, 'h' => \$iHelp )|| die Usage();
       
    50 
       
    51   if ((!defined $iBuildLaunch) || ($iHelp))
       
    52   {
       
    53     Usage();
       
    54   } else {
       
    55     return $iBuildLaunch;
       
    56   }
       
    57 
       
    58 }
       
    59 
       
    60 # Usage
       
    61 #
       
    62 # Description
       
    63 # Output Usage Information and exit whole script.
       
    64 #
       
    65 
       
    66 sub Usage {
       
    67   print <<USAGE_EOF;
       
    68 
       
    69   Usage: BCupdateXML.pl [options]
       
    70 
       
    71   options:
       
    72 
       
    73   -x  XML file to add BCToolsBaseBuildNo to
       
    74   -h  Usage
       
    75 USAGE_EOF
       
    76   exit 1;
       
    77 }