diff -r 85578ba0aa08 -r be14ecca790f bldsystemtools/commonbldutils/getlatestrel.pl --- a/bldsystemtools/commonbldutils/getlatestrel.pl Fri Apr 16 16:10:01 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -#!/usr/bin/perl - -=head1 NAME - -Getlatestrel.pl - -=head1 SYNOPSIS - -Getlatestrel.pl - -=head1 DESCRIPTION - -This script is designed to use latestver from the CBR tools to find at get the -latest version of a component. - -If a baseline version is provided, then it will install the version of the component -released as part of that specified baseline. - -=head1 COPYRIGHT - -Copyright (c) 2008 Symbian Ltd. All rights reserved - -=cut - -use strict; - -use Getopt::Long; - -my ($iComp, $iSource, $iVersion, $iBaselineComponent, $iBaselineVersion) = ProcessCommandLine(); - -if ($iSource) -{ - $iSource = "-s"; -} else { - $iSource = ""; -} -if (!defined $iVersion) -{ - if (defined $iBaselineVersion) { - - if (!defined $iBaselineComponent) { - $iBaselineComponent = "gt_techview_baseline"; - } - my $envout= `envsize -v $iBaselineComponent $iBaselineVersion 2>&1`; - - # match component - if ($envout =~ m/(Adding up size of )$iComp (.*)/) { - print "INFO: Component $iComp version $2 found for baseline $iBaselineComponent $iBaselineVersion\n"; - $iVersion = $2; - }elsif ($envout =~ m/(didn't exist)/) { - print "WARNING: Baseline $iBaselineVersion didn't exist, unable to check $iBaselineComponent, geting latest version\n"; - $iVersion = `latestver $iComp`; - } - } else { - $iVersion = `latestver $iComp`; - } -} - -chomp($iVersion); - -my $getreloutput = `getrel -vv $iSource -o $iComp $iVersion`; - -if (($getreloutput =~ /^Installing $iComp $iVersion/) || - ($getreloutput =~ /^Switching $iComp/) || - ($getreloutput =~ /already installed and clean/)) { - - print $getreloutput; -} else { - print "ERROR: could not getrel $iComp $iVersion - $getreloutput\n"; -} - - - -# ProcessCommandLine -# -# Inputs -# -# Outputs -# $ilog - logfile location -# -# Description -# This function processes the commandline -sub ProcessCommandLine { - my ($iHelp, $iComp, $iSource, $iVersion, $iBaselineComponent, $iBaselineVersion); - - GetOptions('h' => \$iHelp, 'c=s' => \$iComp, 's' => \$iSource, 'v=s' => \$iVersion, 'bc=s' => \$iBaselineComponent, 'bv=s' => \$iBaselineVersion); - - if (($iHelp) || (!defined $iComp)) - { - &Usage(); - } else { - return($iComp, $iSource, $iVersion, $iBaselineComponent, $iBaselineVersion); - } -} - -# Usage -# -# Output Usage Information. -# - -sub Usage { - print <