tools/bulk_marking.pl
changeset 34 33a3c5f8b4c8
child 81 5796f75bcd93
equal deleted inserted replaced
33:900525f287f9 34:33a3c5f8b4c8
       
     1 # Copyright (c) 2010 Symbian Foundation Ltd.
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of the License "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Symbian Foundation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description: 
       
    14 # Read a list of "static dependency" lines and tag them in rom_content.csv
       
    15 
       
    16 use strict;
       
    17 use Getopt::Long;
       
    18 
       
    19 my $marking;
       
    20 my $who;
       
    21 GetOptions(
       
    22   "m|message=s" => \$marking,   # comment to add to the CSV lines
       
    23   "u|user=s" => \$who,          # value for the Who column
       
    24   );
       
    25 
       
    26 die("must specify a value for the Why column with the -m option") if (!defined $marking);
       
    27 die("must specify a value for the Who column with the -u option") if (!defined $who);
       
    28 
       
    29 my %romfiles;
       
    30 my $line;
       
    31 while ($line=<>)
       
    32 	{
       
    33 	# PRIVATE\10003A3F\IMPORT\APPS\musui_reg.rsc	/epoc32/data/z/private/10003a3f/apps/musui_reg.rsc	sys\bin\musui.exe
       
    34 	if ($line =~ /^\S+\t\S+\t(\S+)/)
       
    35 		{
       
    36 		my $romfile = $1;
       
    37 		$romfiles{$romfile} = 1;
       
    38 		next;
       
    39 		}
       
    40 
       
    41 	my ($romfile,$hostfile,$ibyfile,$package,$cmd,@rest) = split /,/, $line;
       
    42 	next if (!defined $cmd);
       
    43 	
       
    44 	if (defined $romfiles{$romfile})
       
    45 		{
       
    46 		if ($cmd eq "")
       
    47 			{
       
    48 			# mark this one
       
    49 			print join(",", $romfile,$hostfile,$ibyfile,$package,"",$who,$marking), "\n";
       
    50 			next;
       
    51 			}
       
    52 		else
       
    53 			{
       
    54 			print STDERR "Skipping $romfile line - already marked as $cmd,",join(",", @rest);
       
    55 			}
       
    56 		}
       
    57 	print $line;
       
    58 	}