bc_tools/ha_filter.pl
author Simon Howkins <simonh@symbian.org>
Thu, 13 May 2010 12:34:20 +0100
changeset 261 d01a4084d621
parent 246 ade7819ee16c
child 305 247cb9582bd0
permissions -rw-r--r--
Extended to put the preferred column headings into the table. Also made a few other simplifications.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
234
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;
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    18
use Getopt::Long;
234
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.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    27
my $del_comp_issues = 0; # This variable determines whether to delete Compilation errors.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    28
my $del_boost_issues = 1; # This variable determines whether to delete issues for Boost API headers.
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    29
my $tsv_file; # If defined then sub-reports per package will be generated.
234
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;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    34
my $delete_node;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    35
my @lines;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    36
my $line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    37
my @pkgs;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    38
my $nopkg;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    39
my $pkgs_num;
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    40
my ($hdr_to_pkg, $package);
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    41
my $pkg_found;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    42
my $add_pkg;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    43
my $temp_report;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    44
my $current_pkg;
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    45
my $help;
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    46
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    47
sub usage($);
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    48
sub help();
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    49
sub usage_error();
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    50
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    51
my %optmap = (  'headers-report' => \$report,
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    52
			    'public-api-list' => \$header_list,
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    53
			    'xref-file' => \$tsv_file,
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    54
				'help' => \$help);
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    55
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    56
GetOptions(\%optmap,
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    57
          'headers-report=s',
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    58
          'public-api-list=s',
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    59
          'xref-file=s',
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    60
		  'help!') 
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    61
          or usage_error();
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    62
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    63
if ($help) {
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    64
	help();
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    65
}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    66
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    67
# --headers-report is mandatory.
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    68
usage_error(), unless (defined($report));
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    69
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    70
# --public-headers is mandatory.
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    71
usage_error(), unless (defined($header_list));
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    72
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    73
# Define output file based on the headers report name.
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
    74
$destfile = "filtered_" . $report;
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    75
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    76
# Parse the input XML into hashrefs.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    77
print "Parsing " . $report . "... ";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    78
my $current_report = XMLin("./$report", keeproot => 1,
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    79
    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
    80
	'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
    81
	'headerfile', 'filename', 'comparefilename', 'status', 'comment', 'issue', 'checksum', 'shortname', 'issueid', 'typeid', 'identityid', #
246
ade7819ee16c Fixed saving compilationerror element in headers reports
Maciej Seroka <maciejs@symbian.org>
parents: 241
diff changeset
    82
	'identitydescription', 'typestring', 'cause', 'documentation', 'ignoreinformation', 'linenumber', 'severity', 'scseverity', 'compilationerror'], keyattr => [] );
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    83
print "complete \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    84
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    85
# Get number of header files.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    86
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
    87
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
    88
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    89
# Delete known issues.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    90
if ($del_ok_issues) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    91
	$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    92
	while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    93
		$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
    94
		# Delete the node if known issue.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    95
		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
    96
			print "Known issue: $file_name ...deleted\n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    97
			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
    98
			$header_num--;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
    99
		} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   100
#			print "Unknown issue: $file_name \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   101
			$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   102
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   103
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   104
	# Get number of header files again.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   105
	$header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   106
	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
   107
}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   108
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   109
# Delete compilation issues.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   110
# 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
   111
if ($del_comp_issues) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   112
	$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   113
	while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   114
		$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
   115
		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
   116
			($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
   117
			print "$file_name has compilation errors \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   118
			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
   119
			$header_num--;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   120
		} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   121
			$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   122
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   123
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   124
	# Get number of header files again
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   125
	$header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   126
	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
   127
}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   128
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   129
# 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
   130
if ($del_boost_issues) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   131
	$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   132
	while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   133
		$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
   134
		# Delete the node if Boost API header.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   135
		if ($file_name =~ m/\\boost/) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   136
			print "Boost API: $file_name \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   137
			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
   138
			$header_num--;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   139
		} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   140
			$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   141
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   142
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   143
	# Get number of header files again.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   144
	$header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   145
	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
   146
}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   147
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   148
# Delete non-public API issues.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   149
$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   150
while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   151
	$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
   152
	$delete_node = 1;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   153
	# Load Public API definitions.
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   154
	open FILE, "<$header_list" or die("Failed to read $header_list: $!\n");
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   155
	while ($line = <FILE>) { # Check against header list.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   156
		chomp $line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   157
		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
   158
			$delete_node = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   159
			last;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   160
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   161
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   162
	# Close Public API definition file.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   163
	close FILE;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   164
	# Delete the node if non-public issue.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   165
	if ($delete_node) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   166
		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
   167
		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
   168
		$header_num--;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   169
	} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   170
		$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   171
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   172
}
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
# Get number of header files again.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   175
$header_num = @{$current_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   176
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
   177
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   178
# Write new XML to dest file.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   179
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
   180
print OUT XMLout($current_report, keeproot => 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   181
close OUT;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   182
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   183
# 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
   184
#			<?xml-stylesheet type="text/xsl" href="BBCResults.xsl"?>
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   185
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
   186
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
   187
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
   188
untie @lines;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   189
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   190
if (defined($tsv_file)) { # Generate sub-reports per package.
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   191
	# 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
   192
	$nopkg = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   193
	$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   194
	while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   195
		$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
   196
		$pkg_found = 0;
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   197
		open FILE, "<$tsv_file" or die("Failed to read $tsv_file: $!\n");
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   198
		while ($line = <FILE>)
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   199
		{
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   200
			chomp $line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   201
			($hdr_to_pkg,$package) = split /\t/,$line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   202
			$hdr_to_pkg =~ s/\//\\/g;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   203
			$hdr_to_pkg =~ s/\\epoc32\\include\\//;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   204
			if (lc($file_name) eq lc($hdr_to_pkg)) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   205
				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
   206
				$pkg_found = 1;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   207
				$pkgs_num = @pkgs;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   208
				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
   209
					push @pkgs, $package;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   210
				} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   211
					$add_pkg = 1;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   212
					$p = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   213
					while ($p < $pkgs_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   214
						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
   215
							$add_pkg = 0; 
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   216
						}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   217
						$p++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   218
					}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   219
					if ($add_pkg) { # Add the new package name.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   220
						push @pkgs, $package;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   221
					}
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
				last;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   224
			}
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
		close FILE;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   227
		if ($pkg_found == 0) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   228
			print "Package not found for header file: $file_name \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   229
			$nopkg++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   230
			$n++;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   231
		} else { # Delete the node.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   232
			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
   233
			$header_num--;				
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   234
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   235
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   236
	print "Number of removed header files: " . $nopkg . "\n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   237
	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
   238
		# Write new XML to dest file.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   239
		$pkg_destfile = "removed_" . $report;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   240
		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
   241
		print OUT XMLout($current_report, keeproot => 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   242
		close OUT;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   243
		# 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
   244
		#			<?xml-stylesheet type="text/xsl" href="BBCResults.xsl"?>
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   245
		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
   246
		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
   247
		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
   248
		untie @lines;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   249
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   250
	print "Number of packages: " . @pkgs . "\n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   251
	# Generate sub reports for all packages.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   252
	foreach $current_pkg (@pkgs) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   253
		# Parse the stripped input XML into hashrefs.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   254
		print "Parsing " . $destfile . "... ";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   255
		$temp_report = XMLin("./$destfile", keeproot => 1,
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   256
		 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
   257
		 '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
   258
		 'headerfile', 'filename', 'comparefilename', 'status', 'comment', 'issue', 'checksum', 'shortname', 'issueid', 'typeid', 'identityid', #
246
ade7819ee16c Fixed saving compilationerror element in headers reports
Maciej Seroka <maciejs@symbian.org>
parents: 241
diff changeset
   259
		 'identitydescription', 'typestring', 'cause', 'documentation', 'ignoreinformation', 'linenumber', 'severity', 'scseverity', 'compilationerror'], keyattr => [] );
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   260
		print "complete \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   261
		$n = 0;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   262
		$header_num = @{$temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   263
		print "Processing header files for $current_pkg... \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   264
		while ($n < $header_num) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   265
			$file_name = $temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}->[$n]->{'shortname'}->[0];
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   266
			$pkg_found = 0;
246
ade7819ee16c Fixed saving compilationerror element in headers reports
Maciej Seroka <maciejs@symbian.org>
parents: 241
diff changeset
   267
			open FILE, "<$tsv_file" or die("Failed to read $tsv_file: $!\n");
234
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   268
			while ($line = <FILE>)
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   269
			{
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   270
				chomp $line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   271
				($hdr_to_pkg,$package) = split /\t/,$line;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   272
				$hdr_to_pkg =~ s/\//\\/g;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   273
				$hdr_to_pkg =~ s/\\epoc32\\include\\//;	
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   274
				if ((lc($file_name) eq lc($hdr_to_pkg)) && ($current_pkg eq $package)) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   275
					$pkg_found = 1;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   276
					print "$file_name added to $package \n";
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   277
				}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   278
			}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   279
			close FILE;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   280
			if ($pkg_found == 0) {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   281
				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
   282
				$header_num--;		
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   283
			} else {
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   284
				$n++
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   285
			}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   286
		}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   287
		$header_num = @{$temp_report->{'bbcresults'}->{'issuelist'}->[0]->{'headerfile'}};
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   288
		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
   289
		# Write new XML to dest file.
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   290
		$pkg_destfile = $current_pkg . "_" . $report;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   291
		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
   292
		print OUT XMLout($temp_report, keeproot => 1);
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   293
		close OUT;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   294
		# 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
   295
		#			<?xml-stylesheet type="text/xsl" href="BBCResults.xsl"?>
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   296
		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
   297
		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
   298
		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
   299
		untie @lines;
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   300
	}
74890d706f0c Added tools for filtering bc reports and updating known issues file
maciejs
parents:
diff changeset
   301
}
241
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   302
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   303
exit 0;
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   304
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   305
sub usage($)
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   306
{
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   307
    my $error = shift;
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   308
    my $fh = $error == 0 ? *STDOUT : *STDERR;
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   309
    print $fh "ha_filter.pl\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   310
            "Specify the headers report and public API list\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   311
            "synopsis:\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   312
            "  ha_filter.pl --help\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   313
            "  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: 234
diff changeset
   314
            "options:\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   315
            "  --help                        Display this help and exit.\n" .
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   316
            "  --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: 234
diff changeset
   317
            "  --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: 234
diff changeset
   318
            "  --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: 234
diff changeset
   319
    exit $error;            
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   320
}
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   321
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   322
sub help()
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   323
{
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   324
    usage(0);
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   325
}
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   326
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   327
sub usage_error()
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   328
{
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   329
    usage(1);
b7a101a82e4b Added 'help' for ha_filter.pl
Maciej Seroka <maciejs@symbian.org>
parents: 234
diff changeset
   330
}