tools/bulk_marking.pl
author William Roberts <williamr@symbian.org>
Mon, 25 Oct 2010 17:26:54 +0100
changeset 80 3ab0df073c86
parent 34 33a3c5f8b4c8
child 81 5796f75bcd93
permissions -rw-r--r--
Add support for "slim", which is "stem" + removal of some exports and checking of import details For this to work, the static_dependencies.txt file needs to contain the augmented dependency information. To help with this, it can now consume a mixture of both rom_content.csv lines and static_dependencies.txt lines: the best way to update the information would be something like (edit rom_content.csv to add "slim" to XXX.dll) findstr /i "xxx.dll" rom_content.csv > slim.txt findstr /i "xxx.dll" static_dependencies.txt >> slim.txt perl ..\tools\static_dependencies.pl -u static_dependencies.txt slim.txt > new_dependencies.txt This will notice the "slim" marking for xxx.dll, and record the detailed import and export lists for xxx.dll and everything which links to it. The new information will look something like sys\bin\xxx.dll /epoc32/release/armv5/urel/stem_xxx.dll exports=1-98.100-102:euser[100039e5].dll sys\bin\yyy.dll /epoc32/release/armv5/urel/yyy.dll euser[100039e5].dll:xxx[102750c7].dll@2.4-5.77.104-106:scppnwdl.dll sys\bin\zzz.dll /epoc32/release/armv5/urel/zzz.dll euser[100039e5].dll:xxx[102750c7].dll@23.25.74-77:scppnwdl.dll Only executables for which there is a "slim" marking will have this level of detail. The filtering script now does the detailed cross-checking of imports to exports for "slim" executables. In this case, it will observe the stem_xxx.dll does not export ordinal 104, and so the filtering will include deleting sys\bin\yyy.dll (xxx.dll Missing ordinal 104) sys\bin\zzz.dll will be acceptable, because it only uses ordinals which are still present in stem_xxx.dll
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
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
    19
my $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
    20
my $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
    21
GetOptions(
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
    22
  "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
    23
  "u|user=s" => \$who,          # value for the Who column
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
    24
  );
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
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
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
    27
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
    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
my %romfiles;
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
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
    31
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
    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
	# 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
    34
	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
    35
		{
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
		my $romfile = $1;
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
		$romfiles{$romfile} = 1;
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
		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
    39
		}
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,$hostfile,$ibyfile,$package,$cmd,@rest) = split /,/, $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
    42
	next if (!defined $cmd);
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
	
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
	if (defined $romfiles{$romfile})
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
		if ($cmd eq "")
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
    47
			{
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
			# mark this one
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
    49
			print join(",", $romfile,$hostfile,$ibyfile,$package,"",$who,$marking), "\n";
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
			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
    51
			}
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
    52
		else
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
    53
			{
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
    54
			print STDERR "Skipping $romfile line - already marked as $cmd,",join(",", @rest);
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
			}
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
    56
		}
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
    57
	print $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
    58
	}