1 [@--# Copyright (c) 2003-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 # Template processed by GenDiamondsXml.pm |
|
15 # |
|
16 #--@] |
|
17 <?xml version="1.0" encoding="utf-8"?> |
|
18 <diamonds-build> |
|
19 <schema>[@--$ENV{DiamondsSchemaNum}--@]</schema> |
|
20 [@-- |
|
21 use myutils; |
|
22 use FaultsData; |
|
23 my $iDir = &myutils::getiDir(); |
|
24 my $iSnapshot = &myutils::getiSnapshot(); |
|
25 my $iProduct = &myutils::getiProduct(); |
|
26 my $iLinkPath = &myutils::getiLinkPath(); |
|
27 my ($errorCount,$warningCount,$AdvNotesCount) = (0,0,0); |
|
28 my @temp = FaultsData::stageSummary($iDir, $iSnapshot, $iProduct, $iLinkPath, $iStage); |
|
29 my @tempArr; |
|
30 if( -e "faultCount") |
|
31 { |
|
32 open(FAULTCOUNT,"<faultCount") or warn "FAULTCOUNT:$!"; |
|
33 @tempArr = <FAULTCOUNT>; |
|
34 close(FAULTCOUNT); |
|
35 $errorCount = trim ($tempArr[0]); |
|
36 $warningCount = trim ($tempArr[1]); |
|
37 $AdvNotesCount = trim ($tempArr[2]); |
|
38 } |
|
39 else |
|
40 { |
|
41 @tempArr = (0,0,0); |
|
42 } |
|
43 |
|
44 $OUT .= "<faults>"; |
|
45 if ($temp[0][0]) |
|
46 { |
|
47 foreach my $t (@temp) |
|
48 { |
|
49 $OUT .= |
|
50 " |
|
51 <component> |
|
52 <name>@$t[0]#$iStage</name> |
|
53 "; |
|
54 if (@$t[1]) {$OUT .= " <total severity=\"error\">@$t[1]</total>\n";} |
|
55 if (@$t[3]) {$OUT .= " <total severity=\"warning\">@$t[3]</total>\n";} |
|
56 if (@$t[5]) {$OUT .= " <total severity=\"advisory_notes\">@$t[5]</total>\n";} |
|
57 $OUT .= " </component>\n"; |
|
58 |
|
59 $errorCount = @$t[1] + $errorCount; |
|
60 $warningCount = @$t[3] + $warningCount; |
|
61 $AdvNotesCount = @$t[5] + $AdvNotesCount; |
|
62 } |
|
63 } |
|
64 $OUT .= " <total severity=\"error\">$errorCount</total>\n"; |
|
65 $OUT .= " <total severity=\"warning\">$warningCount</total>\n"; |
|
66 $OUT .= " <total severity=\"advisory_notes\">$AdvNotesCount</total>\n"; |
|
67 $OUT .= " </faults>"; |
|
68 |
|
69 #save the error numbers until now |
|
70 open(FAULTCOUNT,">faultCount") or warn "FAULTCOUNT:$!"; |
|
71 print FAULTCOUNT "$errorCount\n"; |
|
72 print FAULTCOUNT "$warningCount\n"; |
|
73 print FAULTCOUNT "$AdvNotesCount\n"; |
|
74 close (FAULTCOUNT); |
|
75 |
|
76 sub trim |
|
77 { |
|
78 my $string = shift; |
|
79 $string =~ s/^\s+//; |
|
80 $string =~ s/\s+$//; |
|
81 return $string; |
|
82 } |
|
83 --@] |
|
84 </diamonds-build> |
|
85 |
|