bc_tools/ha_filter.pl
author Dario Sestito <darios@symbian.org>
Mon, 06 Sep 2010 12:00:01 +0100
changeset 295 2b7e66ca13ba
parent 278 247cb9582bd0
permissions -rw-r--r--
Fix for total releasables count not appearing
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
     1
#!/usr/bin/perl
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
     2
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
     3
# Copyright (c) 2009 Symbian Foundation Ltd
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
     4
# This component and the accompanying materials are made available
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
     6
# which accompanies this distribution, and is available
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
     8
#
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
     9
# Initial Contributors:
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    11
#	Maciej Seroka, maciejs@symbian.org
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    12
#
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    13
# Description:
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    14
#   This is a tool for filtering static BC header reports.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    15
#
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    16
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    17
use strict;
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    18
use Getopt::Long;
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    19
use XML::Simple;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    20
use Tie::File;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    21
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    22
my $report;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    23
my $header_list;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    24
my $destfile;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    25
my $pkg_destfile;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    26
my $del_ok_issues = 1; # This variable determines whether to delete OK issues first.
278
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
    27
my $del_comp_issues = 1; # This variable determines whether to delete Compilation errors.
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
    28
my $del_boost_issues = 0; # This variable determines whether to delete issues for Boost API headers.
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    29
my $tsv_file; # If defined then sub-reports per package will be generated.
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    30
my $n;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    31
my $m;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    32
my $p;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    33
my $file_name;
278
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
    34
my $type_id;
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
    35
my $identity_description;
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    36
my $delete_node;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    37
my @lines;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    38
my $line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    39
my @pkgs;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    40
my $nopkg;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    41
my $pkgs_num;
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    42
my ($hdr_to_pkg, $package);
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    43
my $pkg_found;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    44
my $add_pkg;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    45
my $temp_report;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    46
my $current_pkg;
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    47
my $help;
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    48
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    49
sub usage($);
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    50
sub help();
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    51
sub usage_error();
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    52
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    53
my %optmap = (  'headers-report' => \$report,
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    54
			    'public-api-list' => \$header_list,
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    55
			    'xref-file' => \$tsv_file,
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    56
				'help' => \$help);
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    57
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    58
GetOptions(\%optmap,
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    59
          'headers-report=s',
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    60
          'public-api-list=s',
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    61
          'xref-file=s',
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    62
		  'help!') 
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    63
          or usage_error();
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    64
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    65
if ($help) {
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    66
	help();
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    67
}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    68
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    69
# --headers-report is mandatory.
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    70
usage_error(), unless (defined($report));
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    71
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    72
# --public-headers is mandatory.
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    73
usage_error(), unless (defined($header_list));
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    74
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    75
# Define output file based on the headers report name.
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
    76
$destfile = "filtered_" . $report;
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    77
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    78
# Parse the input XML into hashrefs.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    79
print "Parsing " . $report . "... ";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    80
my $current_report = XMLin("./$report", keeproot => 1,
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    81
    forcearray => [ 'header', 'baselineversion', 'currentversion', 'timestamp', 'day', 'month', 'year', 'hour', 'minute', 'second', #
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    82
	'haversion', 'formatversion', 'cmdlineparms', 'parm', 'pname', 'pvalue', 'knownissuesversion', 'os', 'version', 'buildweek', 'issuelist',#
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    83
	'headerfile', 'filename', 'comparefilename', 'status', 'comment', 'issue', 'checksum', 'shortname', 'issueid', 'typeid', 'identityid', #
224
ade7819ee16c Fixed saving compilationerror element in headers reports
Maciej Seroka <maciejs@symbian.org>
parents: 221
diff changeset
    84
	'identitydescription', 'typestring', 'cause', 'documentation', 'ignoreinformation', 'linenumber', 'severity', 'scseverity', 'compilationerror'], keyattr => [] );
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    85
print "complete \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    86
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    87
# Get number of header files.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    88
my $header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    89
print "Number of all header files with issues: $header_num \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    90
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    91
# Delete known issues.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    92
if ($del_ok_issues) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    93
	$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    94
	while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    95
		$file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0];
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    96
		# Delete the node if known issue.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    97
		if ($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'status'}->[0] eq "OK") {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    98
			print "Known issue: $file_name ...deleted\n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    99
			splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   100
			$header_num--;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   101
		} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   102
#			print "Unknown issue: $file_name \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   103
			$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   104
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   105
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   106
	# Get number of header files again.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   107
	$header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   108
	print "Number of remaining header files with issues: $header_num \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   109
}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   110
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   111
# Delete compilation issues.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   112
# Assumption: Compilation issue is always the top issue (and probably the only one)
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   113
if ($del_comp_issues) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   114
	$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   115
	while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   116
		$file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0];
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   117
		if (($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'issue'}->[0]->{'typestring'}->[0] eq "has compilation errors") && #
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   118
			($current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'status'}->[0] ne "OK")) { # Delete the node if compilation error.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   119
			print "$file_name has compilation errors \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   120
			splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   121
			$header_num--;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   122
		} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   123
			$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   124
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   125
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   126
	# Get number of header files again
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   127
	$header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   128
	print "Number of header files with non-compilation issues: $header_num \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   129
}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   130
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   131
# Delete Boost API related issues (Boost API headers are not present in any of the Public SDK!).
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   132
if ($del_boost_issues) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   133
	$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   134
	while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   135
		$file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0];
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   136
		# Delete the node if Boost API header.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   137
		if ($file_name =~ m/\\boost/) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   138
			print "Boost API: $file_name \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   139
			splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   140
			$header_num--;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   141
		} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   142
			$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   143
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   144
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   145
	# Get number of header files again.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   146
	$header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   147
	print "Number of non-Boost API header files: $header_num \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   148
}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   149
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   150
# Delete non-public API issues.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   151
$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   152
while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   153
	$file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0];
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   154
	$delete_node = 1;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   155
	# Load Public API definitions.
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   156
	open FILE, "<$header_list" or die("Failed to read $header_list: $!\n");
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   157
	while ($line = <FILE>) { # Check against header list.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   158
		chomp $line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   159
		if (lc($file_name) eq lc($line)) {	# Mark the node to NOT be deleted.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   160
			$delete_node = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   161
			last;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   162
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   163
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   164
	# Close Public API definition file.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   165
	close FILE;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   166
	# Delete the node if non-public issue.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   167
	if ($delete_node) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   168
		print "Header file: $file_name not found in Public API definition file... deleted\n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   169
		splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   170
		$header_num--;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   171
	} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   172
		$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   173
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   174
}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   175
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   176
# Get number of header files again.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   177
$header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   178
print "Final number of header files with issues: $header_num \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   179
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   180
# Write new XML to dest file.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   181
open OUT,">$destfile" or die("Cannot open file \"$destfile\" for writing. $!\n");
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   182
print OUT XMLout($current_report, keeproot => 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   183
close OUT;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   184
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   185
# Insert:	<?xml version="1.0" encoding="ASCII" standalone="no" ?>
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   186
#			<?xml-stylesheet type="text/xsl" href="BBCResults.xsl"?>
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   187
tie @lines, 'Tie::File', $destfile or die ("Cannot tie file \"$destfile\". $!\n");
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   188
unshift @lines, "<?xml-stylesheet type=\"text/xsl\" href=\"BBCResults.xsl\"?>";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   189
unshift @lines, "<?xml version=\"1.0\" encoding=\"ASCII\" standalone=\"no\" ?>";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   190
untie @lines;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   191
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   192
if (defined($tsv_file)) { # Generate sub-reports per package.
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   193
	# Create the list of packages that link to remaining header files and generate sub-report for Removed header files.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   194
	$nopkg = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   195
	$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   196
	while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   197
		$file_name = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0];
278
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
   198
		$type_id = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'issue'}->[0]->{'typeid'}->[0];
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
   199
		$identity_description = $current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'issue'}->[0]->{'identitydescription'}->[0];
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   200
		$pkg_found = 0;
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   201
		open FILE, "<$tsv_file" or die("Failed to read $tsv_file: $!\n");
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   202
		while ($line = <FILE>)
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   203
		{
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   204
			chomp $line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   205
			($hdr_to_pkg,$package) = split /\t/,$line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   206
			$hdr_to_pkg =~ s/\//\\/g;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   207
			$hdr_to_pkg =~ s/\\epoc32\\include\\//;
278
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
   208
			if ((lc($file_name) eq lc($hdr_to_pkg)) && (!(($type_id eq "0") && ($identity_description eq "File")))) {
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   209
				print "Package found: $package for header file: $file_name \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   210
				$pkg_found = 1;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   211
				$pkgs_num = @pkgs;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   212
				if ($pkgs_num == 0) { # Add the first package name by default.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   213
					push @pkgs, $package;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   214
				} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   215
					$add_pkg = 1;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   216
					$p = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   217
					while ($p < $pkgs_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   218
						if ($package eq @pkgs[$p]) { # Do not add a new package name.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   219
							$add_pkg = 0; 
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   220
						}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   221
						$p++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   222
					}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   223
					if ($add_pkg) { # Add the new package name.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   224
						push @pkgs, $package;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   225
					}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   226
				}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   227
				last;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   228
			}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   229
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   230
		close FILE;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   231
		if ($pkg_found == 0) {
278
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
   232
			print "Removed header file: $file_name \n";
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   233
			$nopkg++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   234
			$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   235
		} else { # Delete the node.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   236
			splice(@{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   237
			$header_num--;				
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   238
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   239
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   240
	print "Number of removed header files: " . $nopkg . "\n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   241
	if ($nopkg > 0) { # Save sub-report for removed header files.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   242
		# Write new XML to dest file.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   243
		$pkg_destfile = "removed_" . $report;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   244
		open OUT,">$pkg_destfile" or die("Cannot open file \"$pkg_destfile\" for writing. $!\n");
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   245
		print OUT XMLout($current_report, keeproot => 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   246
		close OUT;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   247
		# Insert:	<?xml version="1.0" encoding="ASCII" standalone="no" ?>
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   248
		#			<?xml-stylesheet type="text/xsl" href="BBCResults.xsl"?>
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   249
		tie @lines, 'Tie::File', $pkg_destfile or die ("Cannot tie file \"$pkg_destfile\". $!\n");
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   250
		unshift @lines, "<?xml-stylesheet type=\"text/xsl\" href=\"BBCResults.xsl\"?>";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   251
		unshift @lines, "<?xml version=\"1.0\" encoding=\"ASCII\" standalone=\"no\" ?>";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   252
		untie @lines;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   253
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   254
	print "Number of packages: " . @pkgs . "\n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   255
	# Generate sub reports for all packages.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   256
	foreach $current_pkg (@pkgs) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   257
		# Parse the stripped input XML into hashrefs.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   258
		print "Parsing " . $destfile . "... ";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   259
		$temp_report = XMLin("./$destfile", keeproot => 1,
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   260
		 forcearray => [ 'header', 'baselineversion', 'currentversion', 'timestamp', 'day', 'month', 'year', 'hour', 'minute', 'second', #
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   261
		 'haversion', 'formatversion', 'cmdlineparms', 'parm', 'pname', 'pvalue', 'knownissuesversion', 'os', 'version', 'buildweek', 'issuelist',#
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   262
		 'headerfile', 'filename', 'comparefilename', 'status', 'comment', 'issue', 'checksum', 'shortname', 'issueid', 'typeid', 'identityid', #
224
ade7819ee16c Fixed saving compilationerror element in headers reports
Maciej Seroka <maciejs@symbian.org>
parents: 221
diff changeset
   263
		 'identitydescription', 'typestring', 'cause', 'documentation', 'ignoreinformation', 'linenumber', 'severity', 'scseverity', 'compilationerror'], keyattr => [] );
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   264
		print "complete \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   265
		$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   266
		$header_num = @{$temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   267
		print "Processing header files for $current_pkg... \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   268
		while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   269
			$file_name = $temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0];
278
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
   270
			$type_id = $temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'issue'}->[0]->{'typeid'}->[0];
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
   271
			$identity_description = $temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'issue'}->[0]->{'identitydescription'}->[0];
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   272
			$pkg_found = 0;
224
ade7819ee16c Fixed saving compilationerror element in headers reports
Maciej Seroka <maciejs@symbian.org>
parents: 221
diff changeset
   273
			open FILE, "<$tsv_file" or die("Failed to read $tsv_file: $!\n");
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   274
			while ($line = <FILE>)
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   275
			{
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   276
				chomp $line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   277
				($hdr_to_pkg,$package) = split /\t/,$line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   278
				$hdr_to_pkg =~ s/\//\\/g;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   279
				$hdr_to_pkg =~ s/\\epoc32\\include\\//;	
278
247cb9582bd0 Updated scripts for filtering BC reports
Maciej Seroka <maciejs@symbian.org>
parents: 224
diff changeset
   280
				if ((lc($file_name) eq lc($hdr_to_pkg)) && ($current_pkg eq $package) && (!(($type_id eq "0") && ($identity_description eq "File")))) {
215
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   281
					$pkg_found = 1;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   282
					print "$file_name added to $package \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   283
				}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   284
			}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   285
			close FILE;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   286
			if ($pkg_found == 0) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   287
				splice(@{$temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}},$n, 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   288
				$header_num--;		
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   289
			} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   290
				$n++
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   291
			}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   292
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   293
		$header_num = @{$temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   294
		print "Number of header files for $current_pkg: $header_num \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   295
		# Write new XML to dest file.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   296
		$pkg_destfile = $current_pkg . "_" . $report;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   297
		open OUT,">$pkg_destfile" or die("Cannot open file \"$pkg_destfile\" for writing. $!\n");
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   298
		print OUT XMLout($temp_report, keeproot => 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   299
		close OUT;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   300
		# Insert:	<?xml version="1.0" encoding="ASCII" standalone="no" ?>
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   301
		#			<?xml-stylesheet type="text/xsl" href="BBCResults.xsl"?>
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   302
		tie @lines, 'Tie::File', $pkg_destfile or die ("Cannot tie file \"$pkg_destfile\". $!\n");
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   303
		unshift @lines, "<?xml-stylesheet type=\"text/xsl\" href=\"BBCResults.xsl\"?>";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   304
		unshift @lines, "<?xml version=\"1.0\" encoding=\"ASCII\" standalone=\"no\" ?>";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   305
		untie @lines;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   306
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   307
}
221
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   308
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   309
exit 0;
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   310
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   311
sub usage($)
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   312
{
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   313
    my $error = shift;
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   314
    my $fh = $error == 0 ? *STDOUT : *STDERR;
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   315
    print $fh "ha_filter.pl\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   316
            "Specify the headers report and public API list\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   317
            "synopsis:\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   318
            "  ha_filter.pl --help\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   319
            "  ha_filter.pl [--headers-report=XML_FILE] [--public-api-list=TXT_FILE] [--xref-file=TSV_FILE] \n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   320
            "options:\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   321
            "  --help                        Display this help and exit.\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   322
            "  --headers-report=XML_FILE     XML_FILE is the name of the headers report xml file.\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   323
            "  --public-api-list=TXT_FILE    TXT_FILE is the file containing the list of public header files.\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   324
            "  --xref-file=TSV_FILE          TSV_FILE is the file containing the index of header files linked to packages generated by summarise_tsv.pl.\n";
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   325
    exit $error;            
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   326
}
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   327
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   328
sub help()
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   329
{
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   330
    usage(0);
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   331
}
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   332
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   333
sub usage_error()
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   334
{
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   335
    usage(1);
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 215
diff changeset
   336
}