tools/bulk_marking.pl
author markw <markw@symbian.org>
Wed, 17 Nov 2010 15:47:05 +0000
changeset 129 4a58d534bdaa
parent 106 376d4db79ce0
permissions -rw-r--r--
Add CMdaAudioPlayerUtility support to the mediaclientaudio.dll stub. Remove mmfclientutility files as not needed.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2010 Symbian Foundation Ltd.
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
# All rights reserved.
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# This component and the accompanying materials are made available
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
#
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
# Initial Contributors:
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Symbian Foundation - initial contribution.
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
#
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
# Contributors:
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
#
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
# Description: 
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# Read a list of "static dependency" lines and tag them in rom_content.csv
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
use strict;
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
use Getopt::Long;
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    19
my $newcmd = "";
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
my $who;
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    21
my $marking;
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    22
my $other_exes = 0;
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
GetOptions(
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    24
  "c|command=s" => \$newcmd,    # value for the What colum (can be blank)
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
  "m|message=s" => \$marking,   # comment to add to the CSV lines
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
  "u|user=s" => \$who,          # value for the Who column
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    27
  "x" => \$other_exes,          # marking is applied to exes NOT listed
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
  );
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
die("must specify a value for the Why column with the -m option") if (!defined $marking);
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
die("must specify a value for the Who column with the -u option") if (!defined $who);
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
my %romfiles;
82
e044daaa1848 Remove debug print statements, report total number of lines marked.
William Roberts <williamr@symbian.org>
parents: 81
diff changeset
    34
my $mark_count = 0;
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
my $line;
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
while ($line=<>)
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
	{
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
	# PRIVATE\10003A3F\IMPORT\APPS\musui_reg.rsc	/epoc32/data/z/private/10003a3f/apps/musui_reg.rsc	sys\bin\musui.exe
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
	if ($line =~ /^\S+\t\S+\t(\S+)/)
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
		{
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
		my $romfile = $1;
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    42
		$romfiles{lc $romfile} = 1;
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
		next;
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
		}
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
	my ($romfile,$hostfile,$ibyfile,$package,$cmd,@rest) = split /,/, $line;
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    47
	if (!defined $cmd)
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
		{
99
e23a8d7ea8bb Update filter_obyfile.pl to report the "minimal ROM" executables
William Roberts <williamr@symbian.org>
parents: 82
diff changeset
    49
		if ($line =~ /^(\S+)$/)
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
			{
99
e23a8d7ea8bb Update filter_obyfile.pl to report the "minimal ROM" executables
William Roberts <williamr@symbian.org>
parents: 82
diff changeset
    51
			# guess that this is a preserved executable
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    52
			my $exe = "sys\\bin\\". lc $1;
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    53
			$romfiles{$exe} = 1;
82
e044daaa1848 Remove debug print statements, report total number of lines marked.
William Roberts <williamr@symbian.org>
parents: 81
diff changeset
    54
			# print STDERR "Preserving $exe\n";
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
			}
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    56
		next;
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    57
		}
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    58
	
106
376d4db79ce0 Update bulk_marking.pl to handle the optional cmds, which was the key to making the "boot_ktrace_640" reduction work correctly
William Roberts <williamr@symbian.org>
parents: 99
diff changeset
    59
	if ($cmd ne "" && $cmd !~ /_/)
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    60
		{
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    61
		print $line;	# already marked, so leave it alone
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    62
		next;
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    63
		}
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    64
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    65
	my $mark_me = 0;
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    66
	if ($other_exes)
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    67
		{
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    68
		if ($romfile =~ /^sys.bin.(.*)$/i)
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
			{
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    70
			# this is an exe - are we tagging it?
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    71
			if (!defined $romfiles{lc $romfile})
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    72
				{
82
e044daaa1848 Remove debug print statements, report total number of lines marked.
William Roberts <williamr@symbian.org>
parents: 81
diff changeset
    73
				# print STDERR "Marking $romfile\n";
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    74
				$mark_me = 1;
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    75
				}
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
			}
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
		}
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    78
	elsif (defined $romfiles{lc $romfile})
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    79
		{
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    80
		$mark_me = 1;
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    81
		}
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    82
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    83
	if ($mark_me)
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    84
		{
106
376d4db79ce0 Update bulk_marking.pl to handle the optional cmds, which was the key to making the "boot_ktrace_640" reduction work correctly
William Roberts <williamr@symbian.org>
parents: 99
diff changeset
    85
		print STDERR "Overriding $cmd for $romfile\n" if ($cmd ne "" && lc $cmd ne lc $newcmd);
82
e044daaa1848 Remove debug print statements, report total number of lines marked.
William Roberts <williamr@symbian.org>
parents: 81
diff changeset
    86
		$mark_count += 1;
81
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    87
		print join(",", $romfile,$hostfile,$ibyfile,$package,$newcmd,$who,$marking), "\n";
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    88
		}
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    89
	else
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    90
		{
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    91
		print $line;
5796f75bcd93 Add support for marking sys\bin files not in a list (-x) and specifying the command (-c)
William Roberts <williamr@symbian.org>
parents: 34
diff changeset
    92
		}
34
33a3c5f8b4c8 Add "application" to all of the rom_content.csv lines for applications (i.e. executables with a matching _reg.rsc file)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
	}
82
e044daaa1848 Remove debug print statements, report total number of lines marked.
William Roberts <williamr@symbian.org>
parents: 81
diff changeset
    94
e044daaa1848 Remove debug print statements, report total number of lines marked.
William Roberts <williamr@symbian.org>
parents: 81
diff changeset
    95
print STDERR "Marked $mark_count lines\n";