tools/repair_obyfile.pl
author William Roberts <williamr@symbian.org>
Mon, 18 Oct 2010 12:30:30 +0100
changeset 66 fc9981c83de7
parent 57 a44af1db196f
permissions -rw-r--r--
Add weatherinfo demo to syborg_stem_rom.oby Removed "Out" from etel.dll because it's too severe and kills the startup scripts Didn't add "In" to weatherinfo.exe because we are currently losing QtGui.dll due to dependency on MediaClientAudio.dll
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2010 Symbian Foundation Ltd.
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
# All rights reserved.
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# This component and the accompanying materials are made available
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
#
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
# Initial Contributors:
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Symbian Foundation - initial contribution.
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
#
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
# Contributors:
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
#
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
# Description: 
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# Process file ROM log to make it suitable for re-use by buildrom.pl
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
use strict;
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    17
use Getopt::Long;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    18
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    19
my $featurelist = "syborg_stem_features.iby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    20
GetOptions(
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    21
  "f|features=s" => \$featurelist,   # name of featurelist file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    22
  );
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    23
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    24
print "ROM_IMAGE[0] {\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    25
print "#include \"$featurelist\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    26
8
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
my $line;
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
while ($line = <>)
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
	{
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
	# Put back original auto-btmap statements for any "mbm_rom" derived files
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
	$line =~ s/data="(.*mbm)_rom"(\s+)"(.*)"/auto-bitmap=$1$2$3/;
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
	
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
	# Put back original __ECOM_PLUGIN lines
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
	# REM expanded __ECOM_PLUGIN(\epoc32\release\ARMV5\urel,Sys\Bin,\epoc32\data\Z,Resource\Plugins, a3fFourCCConvertorPlugin.dll , a3fFourCCConvertorPlugin.dll ) 
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
	if ($line =~ /^REM expanded\s+__ECOM_PLUGIN/)
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
		{
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
		$line =~ s/REM expanded\s+//;
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
		my $discarded = <>;		# discard the derived file= line for the plugin
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
		}
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
	
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
	if ($line =~ /REM processed spidata/)
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
		{
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
		next;		# discard this line - it will be regenerated by the __ECOM_PLUGIN
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
		}
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    45
		
57
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
    46
	if ($line =~ /REM processed \s*patchdata/i)
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
    47
		{
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
    48
		$line =~ s/REM processed\s+//;	# reinstate the original patchdata line
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
    49
		my $discarded = <>;		# discard the final "patchdata ... addr" line
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
    50
		}
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
    51
		
8
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
	$line =~ s/REM processed //;	# re-enable other directives
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
	
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
	if ($line =~ /^time=/)
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
		{
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
		$line = "time=##TODAY## 12:00:00\n";
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
		}
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
	
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    59
	# remove lines added by buildrom for generated files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    60
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    61
	if ($line =~ /^data=\S+\\([^\\]+)\s+"\S+"/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    62
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    63
		my $file = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    64
		if ($file =~ /features.dat|ecom-\d-\d\.s/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    65
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    66
			# print STDERR "Discarded: $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    67
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    68
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    69
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    70
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    71
	if ($line =~ /^REM (ROM_IMAGE\[\d\])$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    72
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    73
		$line = "$1 {\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    74
		print "}\n";		# close the preceeding ROM_IMAGE
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    75
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    76
8
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
	print $line;
36cb9eb36988 Add tools\repair_obyfile.pl to process imaker generated .oby file back into suitable input for buildrom.pl
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
	}
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    79
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents: 8
diff changeset
    80
print "}\n";