sbsv1/abld/platform/fcloggerutl.pm
changeset 599 fa7a3cc6effd
equal deleted inserted replaced
596:9f25be3da657 599:fa7a3cc6effd
       
     1 # Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Nokia Corporation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description:
       
    14 # FC_LOGGER.PM
       
    15 # 
       
    16 #
       
    17 
       
    18 package FCLoggerUTL;
       
    19 
       
    20 require Exporter;
       
    21 @ISA=qw(Exporter);
       
    22 @EXPORT=qw(
       
    23 	PMCheckFCLoggerVersion
       
    24 );
       
    25 
       
    26 #Function Call Logger
       
    27 sub PMCheckFCLoggerVersion() {
       
    28 	my $exe=$ENV{EPOCROOT}."epoc32\\tools\\fc_logger\\edgcpfe.exe";
       
    29 	#Check if file exists
       
    30 	if (not -e $exe) {
       
    31 		print "WARNING: File doesn't exist $exe \n";
       
    32 		return 0;
       
    33 	}
       
    34 
       
    35 	open FCLPIPE, "$exe -v 2>&1 |";
       
    36 	# Read all output from file into array
       
    37 	my @lines=<FCLPIPE>;
       
    38 	chomp @lines;
       
    39 	# combine into single string with each line starting with a :
       
    40 	my $line=join(":", "", @lines);
       
    41 	close FCLPIPE;
       
    42 
       
    43 	if ($line =~ m/version\s([0-9\.]+)/) {
       
    44 		my $Version      = $1;
       
    45 		$Version		 =~ m/(\d+)\.(\d+)\.?([\d+])?/;
       
    46 		my $MajorVersion = $1;
       
    47 		my $MinorVersion = $2;
       
    48 		my $PatchLevel   = $3;
       
    49 		if ($MajorVersion<3 or $MinorVersion<7) {
       
    50 			print "WARNING: $exe version is less than 3.7.1. The -logfc option will be ignored.\n";
       
    51 			return 0;
       
    52 		}
       
    53 	}
       
    54 	return 1;
       
    55 }