author | William Roberts <williamr@symbian.org> |
Tue, 26 Oct 2010 11:32:26 +0100 | |
changeset 81 | 5796f75bcd93 |
parent 34 | 33a3c5f8b4c8 |
child 82 | e044daaa1848 |
permissions | -rw-r--r-- |
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; |
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 |
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
|
35 |
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
|
36 |
{ |
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 |
# 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
|
38 |
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
|
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 |
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
|
41 |
$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
|
42 |
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
|
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 |
|
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 |
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
|
46 |
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
|
47 |
{ |
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
|
48 |
if ($other_exes && $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
|
49 |
{ |
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
|
50 |
# guess that this is a preserved filename |
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
|
51 |
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
|
52 |
$romfiles{$exe} = 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 |
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
|
54 |
} |
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
|
55 |
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
|
56 |
} |
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 |
if ($cmd ne "") |
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
|
59 |
{ |
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 |
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
|
61 |
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
|
62 |
} |
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 |
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
|
65 |
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
|
66 |
{ |
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 |
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
|
68 |
{ |
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
|
69 |
# 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
|
70 |
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
|
71 |
{ |
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 |
print STDERR "Marking $romfile\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
|
73 |
$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
|
74 |
} |
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
|
75 |
} |
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 |
} |
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
|
77 |
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
|
78 |
{ |
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 |
$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
|
80 |
} |
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 |
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
|
83 |
{ |
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 |
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
|
85 |
} |
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
|
86 |
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
|
87 |
{ |
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 |
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
|
89 |
} |
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
|
90 |
} |