sbsv1_os/e32toolp/platform/lockit_info.pm
branchRCL_3
changeset 13 7416fe50a180
parent 2 99082257a271
equal deleted inserted replaced
8:5e76a11e104b 13:7416fe50a180
    30 	Lockit_SrcFile
    30 	Lockit_SrcFile
    31 	Open_InfoFile
    31 	Open_InfoFile
    32 	Close_InfoFile
    32 	Close_InfoFile
    33 );
    33 );
    34 
    34 
    35 use strict;
       
    36 use Pathutl;
    35 use Pathutl;
    37 my $epocroot;
    36 my $epocroot;
    38 my $epocPath;
    37 my $epocPath;
    39 
    38 
    40 sub Check_Epocroot 
    39 sub Check_Epocroot 
    83 	else {
    82 	else {
    84 		$FilePath = Setup_LockitPath($CWDir, $ResrcFile, $FileType);
    83 		$FilePath = Setup_LockitPath($CWDir, $ResrcFile, $FileType);
    85 
    84 
    86 		# update rppfile in epoc32\localisation if -l option specified and generating resource
    85 		# update rppfile in epoc32\localisation if -l option specified and generating resource
    87 		copy("$RppFile", "$FilePath\\$ResrcFile.rpp");
    86 		copy("$RppFile", "$FilePath\\$ResrcFile.rpp");
    88 	}
       
    89 
       
    90 	# update bitmaps in epoc32\localisation if -l option and bitmaps specified
       
    91 	if ($CWDir && ($Bitmaps ne ""))
       
    92 	{
       
    93 		my $BmpRef;
       
    94 		$Bitmaps =~ s/ +|\t/ /g; # replace tabs and more spaces with single space
       
    95 		$Bitmaps =~s/^ //g; # remove leading space
       
    96 		$Bitmaps =~s/ $//g; # remove trailing space
       
    97 
       
    98 		my (@AifBitmaps) = split(/ /, $Bitmaps);
       
    99 		foreach $BmpRef (@AifBitmaps) {
       
   100 			$BmpRef =~ /^([^\\]+)(\\.*)$/;
       
   101 			my $CDepth = $1;
       
   102 			my $bmp = $2;
       
   103 			Copy_Files($bmp, $FilePath);
       
   104 			my $file_base= basename($bmp);
       
   105 			chmod (0666,"$FilePath\\$file_base");
       
   106 		}
       
   107 	}
    87 	}
   108 
    88 
   109 	if (defined $ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} &&  ($ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} eq 'alpha')) {
    89 	if (defined $ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} &&  ($ENV{ABLD_TOOLSMOD_COMPATIBILITY_MODE} eq 'alpha')) {
   110 		if (LineExists($ResrcFile.$lang, $RscTarget) == 0)
    90 		if (LineExists($ResrcFile.$lang, $RscTarget) == 0)
   111 		{
    91 		{
   194 
   174 
   195 ## create necessary directories
   175 ## create necessary directories
   196 sub Create_InfoFile ()
   176 sub Create_InfoFile ()
   197 	{
   177 	{
   198 	my ($CreateLockitPath, $CreateInfoFile, $Datadir) = @_;
   178 	my ($CreateLockitPath, $CreateInfoFile, $Datadir) = @_;
   199 	if ( !-e "$CreateLockitPath") { mkpath($CreateLockitPath); }
   179 	if (($CreateLockitPath !~ /mbm$/i) && (!-e "$CreateLockitPath")) { mkpath($CreateLockitPath); }
   200 	if ( !-e "$epocPath\\group") { mkpath("$epocPath\\group"); }
   180 	if ( !-e "$epocPath\\group") { mkpath("$epocPath\\group"); }
   201 	if ( !-e "$epocPath\\group\\$CreateInfoFile.info") {	
   181 	if ( !-e "$epocPath\\group\\$CreateInfoFile.info") {	
   202 		open INFO,">$epocPath\\group\\$CreateInfoFile.info" or die "ERROR: Can not create file \"$CreateInfoFile\"\n"; 
   182 		open INFO,">$epocPath\\group\\$CreateInfoFile.info" or die "ERROR: Can not create file \"$CreateInfoFile\"\n"; 
   203 		print INFO "DATADIR: $Datadir\n";
   183 		print INFO "DATADIR: $Datadir\n";
   204 		close INFO;
   184 		close INFO;
   323 
   303 
   324 		if($FileType =~ /RSS|ACL|ABW|AIF|A[0-9]/i && $Bitmaps eq ""){
   304 		if($FileType =~ /RSS|ACL|ABW|AIF|A[0-9]/i && $Bitmaps eq ""){
   325 			$LockitPath .= "\\$BaseResrc.rpp";
   305 			$LockitPath .= "\\$BaseResrc.rpp";
   326 		}
   306 		}
   327 		else {
   307 		else {
   328 			$LockitPath .= "\\$Bitmaps";
   308 			undef $LockitPath;
   329 		}
   309 		}
   330 	}
   310 	}
   331 
   311 
   332 	my %loggedFiles;
   312 	my %loggedFiles;
   333 	$loggedFiles{lc($_)} = 1 foreach keys (%Files);
   313 	$loggedFiles{lc($_)} = 1 foreach keys (%Files);
   334 	
   314 	
   335 	$Files{$LockitPath} = 1 if !($loggedFiles{lc($LockitPath)});
   315 	$Files{$LockitPath} = 1 if (defined $LockitPath) && (!($loggedFiles{lc($LockitPath)}));
   336 	$Files{$LockitInfoPath} = 1 if !($loggedFiles{lc($LockitInfoPath)});
   316 	$Files{$LockitInfoPath} = 1 if !($loggedFiles{lc($LockitInfoPath)});
   337 	
   317 	
   338 	return %Files;
   318 	return %Files;
   339 }
   319 }
   340 
   320