sdkcreationmw/sdkbuild/SDK_WINSCW/SDK_lang.pm
author Shabe Razvi <shaber@symbian.org>
Thu, 04 Nov 2010 17:22:05 +0000
changeset 4 b3b823debf08
parent 0 b26acd06ea60
permissions -rw-r--r--
Workaround for Bug 3917 - CWinsockInterface::DataSent calls NotifyDataSent which is not implemented.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     1
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     2
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     3
# All rights reserved.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     4
# This component and the accompanying materials are made available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     5
# under the terms of "Eclipse Public License v1.0"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     6
# which accompanies this distribution, and is available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     8
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     9
# Initial Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    11
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    12
# Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    13
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    14
# Description: 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    15
#
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    16
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    17
package SDK_lang;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    18
use SDK_vars;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    19
use SDK_utils;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    20
use File::Find;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    21
use File::Path;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    22
use File::Basename;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    23
use File::Copy;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    24
use Cwd;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    25
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    26
our ($VERSION, @ISA, @EXPORT);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    27
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    28
$VERSION = 1.00;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    29
@ISA = qw(Exporter);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    30
@EXPORT = qw(copy_language_zips create_lang_package);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    31
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    32
sub copy_language_zips {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    33
  my ($href) = @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    34
  enter_sub("Copying the language zips from $$href{Platform_Languages} -> $$href{S60_Root}\\Languages");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    35
  my $curr_dir = cwd();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    36
  my $lang_dir = "$$href{S60_Root}\\Languages";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    37
	print "Deleted dir  - $lang_dir\n" if ((-e $lang_dir) && do_rmdir_all($lang_dir));
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    38
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    39
  foreach my $pl_lang_path ( split (/ /, $iniH{Platform_Languages}) ){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    40
  	if($_ =~ m/japan/g) # Added by dinesh since japanese is not required in the N97 SDK
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    41
		{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    42
			print "Skipping copying of $_ file\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    43
			next;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    44
		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    45
	  map { my $cmd ="xcopy $pl_lang_path\\$_ $$href{S60_Root}\\Languages\\$_ /f /r /i /s /Y "; system ($cmd)==0 or print "$cmd\n";} qw(*_delta_*.zip);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    46
  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    47
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    48
  #Copy the possible patches
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    49
  if (-e $$href{Languages_Patch}) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    50
    my $cmd = "xcopy $$href{Languages_Patch}\\*.zip $lang_dir\\ /f /r /i /s /Y";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    51
    system ($cmd)==0 or print "$cmd\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    52
  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    53
};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    54
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    55
sub create_lang_package {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    56
  local ($S60_Root, $lang_dir, $graylist, $blacklist, $dest_dir) = @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    57
  enter_sub($lang_dir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    58
  my $curr_dir = cwd;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    59
  local $emu_dirs = join " ", map { "epoc32\\$_\\*" } @emu_src_dirs;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    60
  return unless (chdir $lang_dir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    61
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    62
  local $lang_wa_dir = "$iniH{Sce_Root}\\lang_wa";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    63
	print "Deleted dir  - $lang_wa_dir\n" if ((-e $lang_wa_dir) && do_rmdir_all($lang_wa_dir));
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    64
    mkpath($lang_wa_dir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    65
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    66
  #Copy language zips to wa
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    67
  foreach (<*.zip>){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    68
    if (/delta_/){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    69
    	if($_ =~ m/japan/g) # Added by dinesh since japanese is not required in the N97 SDK
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    70
			{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    71
				print "Skipping copying of $_ file\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    72
				next;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    73
			}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    74
      $cmd = "xcopy $_ $lang_wa_dir /F /I /Y";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    75
      system ($cmd)==0 or print "$cmd\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    76
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    77
  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    78
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    79
  return unless (chdir "$lang_wa_dir");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    80
  print "\ngvn: lang_wa_dir is $lang_wa_dir\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    81
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    82
  print "Rename language zips === started ", scalar localtime(), "\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    83
  foreach (<*.zip>){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    84
  	print "\ngvn: ZIP PROCESSED is: $_\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    85
    SWITCH: {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    86
        /china/     && do {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    87
                            system ("rename $_ zh_CN.zip")==0 and print "$_ >-> zh_CN.zip\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    88
                            $cmd = "copy /V $iniH{S60_Root}\\s60\\misc\\release\\S60LocFiles\\data\\31.zip $lang_dir\\package_31.zip";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    89
        										print "$cmd\n"; system ($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    90
                            last SWITCH;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    91
                       };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    92
        /japan/     && do {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    93
                            system ("rename $_ ja_JP.zip")==0 and print "$_ >-> ja_JP.zip\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    94
                            $cmd = "copy /V $iniH{S60_Root}\\s60\\misc\\release\\S60LocFiles\\data\\32.zip $lang_dir\\package_32.zip";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    95
        										print "$cmd\n"; system ($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    96
                            last SWITCH;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    97
                       };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    98
        /western/   && do {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    99
                            system ("rename $_ en_US.zip")==0 and print "$_ >-> en_US.zip\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   100
                            $cmd = "copy /V $iniH{S60_Root}\\s60\\misc\\release\\S60LocFiles\\data\\01.zip $lang_dir\\package_01.zip";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   101
        										print "$cmd\n"; system ($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   102
                            last SWITCH;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   103
                       };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   104
        /arabic/    && do {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   105
                            system ("rename $_ ar_SA.zip")==0 and print "$_ >-> ar_SA.zip\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   106
                            $cmd = "copy /V $iniH{S60_Root}\\s60\\misc\\release\\S60LocFiles\\data\\37.zip $lang_dir\\package_37.zip";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   107
        										print "$cmd\n"; system ($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   108
                            last SWITCH;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   109
                       };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   110
        /urdu/     && do {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   111
                            system ("rename $_ ur_PK.zip")==0 and print "$_ >-> ur_PK.zip\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   112
                            $cmd = "copy /V $iniH{S60_Root}\\s60\\misc\\release\\S60LocFiles\\data\\94.zip $lang_dir\\package_94.zip";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   113
        										print "$cmd\n"; system ($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   114
                            last SWITCH;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   115
                       };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   116
        /hindi/    && do {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   117
                            system ("rename $_ hi_IN.zip")==0 and print "$_ >-> hi_IN.zip\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   118
                            $cmd = "copy /V $iniH{S60_Root}\\s60\\misc\\release\\S60LocFiles\\data\\58.zip $lang_dir\\package_58.zip";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   119
        										print "$cmd\n"; system ($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   120
                            last SWITCH;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   121
                       };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   122
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   123
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   124
  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   125
  #Creating localization zip by adding all the package_*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   126
  $cmd = "zip -r $lang_dir\\localisation.zip $lang_dir\\package_*.zip";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   127
  print "$cmd\n"; system ($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   128
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   129
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   130
	create_lang_zips(\%sdk_lang_codes, $lang_dir, $lang_wa_dir, $dest_dir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   131
	create_lang_zips(\%extra_lang_codes, $lang_dir, $lang_wa_dir, "$iniH{Sce_Root}\\sdk_lang_extra",\%lang_names);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   132
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   133
	#Now Create language packages.zip in sdk_lang_extra
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   134
	create_lang_package_zip(\%sdk_lang_codes,$lang_wa_dir,$S60_Root,$graylist, $blacklist);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   135
	create_lang_package_zip(\%extra_lang_codes,$lang_wa_dir,$S60_Root,$graylist, $blacklist,\%lang_names);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   136
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   137
	#Now create Forum Nokia specific extra language package zips
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   138
	print "\n Create FORUM NOKIA standard extra language zips";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   139
	create_FN_extralang_zip(\%extra_lang_codes,\%lang_names);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   140
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   141
    mkpath("$lang_wa_dir\\undo2zip");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   142
  chdir "$lang_wa_dir\\undo2zip" or print ("$!: $lang_wa_dir\\undo2zip\n" );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   143
  $cmd = "zip -r $dest_dir\\$iniH{ 'Platform_Build_ID' }-undo.zip *";  				#Zip them again to Result directory (prefixed by build id)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   144
  print ($cmd."\n"); system ($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   145
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   146
  #Put English as a default
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   147
  my $en_US_zip = glob("$dest_dir\\*-en_US.zip");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   148
	my $cmd = "unzip -o $en_US_zip -d \\sdk_wa";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   149
  print ( $cmd."\n" );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   150
  system ( $cmd );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   151
  foreach my $package (glob("$dest_dir\\*package*.zip")) {          		#Extract the packages (resources) on top of the sdk
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   152
		my $cmd = "unzip -o $package -d \\sdk_wa";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   153
	  print ( $cmd."\n" );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   154
	  system ( $cmd );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   155
		$cmd = "move $package $iniH{Sce_Root}\\sdk_lang_extra";                        	#Move them to extra folder
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   156
	  print ( $cmd."\n" );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   157
	  system ( $cmd );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   158
  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   159
  chdir $curr_dir;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   160
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   161
#Remove the work area
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   162
	$subdir = "$lang_wa_dir";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   163
	#print "Deleted dir  - $subdir\n" if do_rmdir_all($subdir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   164
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   165
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   166
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   167
#This sub will create Rel-$relid-package-$lang_key.zip (Rel200802-package_ja_JP.zip , Rel200802-package_ur_PK.zip)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   168
sub create_lang_package_zip
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   169
{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   170
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   171
	my $lang_code_href=shift @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   172
	my $lang_wa_dir=shift @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   173
	my $S60_Root=shift @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   174
	my $graylist = shift @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   175
	my $blacklist = shift @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   176
	my $language_names=shift @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   177
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   178
	my $assemble_area=$lang_wa_dir."\\PACKAGES";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   179
	my $loc_resource_base=$S60_Root."\\epoc32\\RELEASE\\WINSCW\\udeb\\Z";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   180
	my @loc_resource_dirs=qw (private resource);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   181
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   182
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   183
	my $lang_extra_dest="$iniH{Sce_Root}\\sdk_lang_extra";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   184
	my $lang_code_val; 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   185
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   186
	my $cmd;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   187
	my @out;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   188
	my $sstring;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   189
	my $lang_code_val_rx;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   190
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   191
	my $lang_rs_src;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   192
	my $lang_rs_dest;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   193
	my $lang_rs_dir_name;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   194
	my $S60_Root_Rx=quotemeta($S60_Root);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   195
	my $res;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   196
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   197
	#Create work area,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   198
	mkpath($assemble_area);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   199
	foreach my $lang_code_name ( keys %$lang_code_href)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   200
	{   
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   201
		#Initialize
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   202
		$cmd="";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   203
		@out=();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   204
		$sstring="";  
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   205
		$lang_code_val_rx="";                         
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   206
    	print "\nCreating $lang_code_name package=== started ", scalar localtime(), "\n\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   207
	    	foreach $lang_code_val(@{$lang_code_href->{$lang_code_name}})#$lang_code val is an array, so expand it with @
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   208
	    	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   209
	    		$sstring.=' '.$lang_code_val; #Add for dir
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   210
	    		$sstring.='  *.r'.$lang_code_val; #Add for files
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   211
	    		$lang_code_val_rx.="|$lang_code_val\$";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   212
	    	} 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   213
    	$lang_code_val_rx=~s/^\|//; #Knock off first |
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   214
    	$cmd="dir $sstring  /S /L /B";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   215
    	print "\n Search string for $lang_code_name => $cmd";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   216
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   217
    	#Now go to  $loc_resource_base
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   218
    	chdir $loc_resource_base or print "\n ERROR: Can not chdir to $loc_resource_base";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   219
    	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   220
    	print "\n EXEC: $cmd in ",cwd();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   221
	    	eval
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   222
	    	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   223
	    		@out=`$cmd`;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   224
	    	};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   225
	    	if ($@)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   226
	    	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   227
	    		print "\n ERROR: $cmd failed in $loc_resource_base, $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   228
	    	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   229
    	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   230
    	#Got the list fo files, Now need to copy them to $assemble_src\\$lang_code_name
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   231
    	mkpath($assemble_area."\\".$lang_code_name);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   232
	    	for $lang_rs_src(@out)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   233
	    	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   234
	    		#avoid unwanted file
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   235
	    		chomp($lang_rs_src);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   236
	    		 next if ($lang_rs_src!~m/$lang_code_val_rx/i);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   237
	    		     		
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   238
	    		if (! -d $lang_rs_src)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   239
	    		{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   240
	    			$lang_rs_dir_name=dirname($lang_rs_src)  #if it is a dir , we need to cp as it is
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   241
	    		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   242
	    		else
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   243
	    		{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   244
	    			$lang_rs_dir_name=$lang_rs_src;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   245
	    		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   246
	    		$lang_rs_dir_name=~s/$S60_Root_Rx//io; # Strip the $S60_Root
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   247
	    		$lang_rs_dest=$assemble_area."\\"."$lang_code_name"."\\".$lang_rs_dir_name;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   248
	    		
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   249
	    		#Make dest path
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   250
	    		mkpath($lang_rs_dest);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   251
	    		#Copy it
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   252
	    		$cmd="xcopy $lang_rs_src $lang_rs_dest /F /R /I /S /Y";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   253
	    		
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   254
	    		$res=system($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   255
	    		if($res !=0)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   256
	    		{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   257
	    			  print "\n ERROR: $cmd FAILED, $res";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   258
	    		}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   259
	   			    		
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   260
	    	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   261
	    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   262
	    chdir $assemble_area."\\".$lang_code_name;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   263
    	#Rm read only
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   264
    	print "\n Remove read only attribute in ",cwd();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   265
    	system ("attrib /s *.* -r");   
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   266
    	#Apply gray / balck
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   267
    	apply_blacklist($assemble_area."\\".$lang_code_name, ($blacklist, $common_graylist) ); 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   268
    	#dbgstrip
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   269
    	print "\n Start DBGSTRIPPI in $assemble_area\\$lang_code_name";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   270
    	find \&dbgstrippi, "$assemble_area\\$lang_code_name";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   271
    	#lower case
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   272
    	print "\n Start DBGSTRIPPI in $assemble_area\\$lang_code_name";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   273
    	find \&lowercase, "$assemble_area\\$lang_code_name";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   274
    	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   275
    	chdir $assemble_area."\\".$lang_code_name;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   276
    	#Zip it
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   277
    	print "\n Create lang ZIP package for $lang_code_name in ",cwd();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   278
    	if(defined $language_names)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   279
    	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   280
	    	#Need to create FN specific extra lang zip
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   281
	    	$cmd = "zip -r $lang_extra_dest\\$iniH{'Platform_Abbreviation'}_$iniH{'Edition_number'}_Edition_$$language_names{$lang_code_name}_plug_in.zip *"; 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   282
    	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   283
    	else
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   284
    	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   285
    		$cmd="zip -r  $lang_extra_dest\\$iniH{'Platform_Build_ID'}-package_$lang_code_name.zip *";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   286
    	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   287
    	print "\n EXEC: $cmd";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   288
    	$res=system($cmd);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   289
    	if($res !=0)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   290
    	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   291
    		  print "\n ERROR: $cmd FAILED, $res";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   292
    	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   293
    	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   294
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   295
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   296
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   297
#This sub will create the FN specific extra language packages by doing,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   298
#For example, S60_5th_Edition_Arabic_v1_0_en.zip=S60_5th_Edition_Arabic_plug_in.zip+S60_5th_Edition_Arabic_Switcher.zip+ReadMe_Arabic.txt
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   299
sub create_FN_extralang_zip
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   300
{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   301
	my $lang_codes=shift @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   302
	my $language_names=shift @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   303
	my $lang_extra_dest="$iniH{Sce_Root}\\sdk_lang_extra";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   304
	my $readme_src=	"$iniH{Sce_Root}\\Repository_area\\sdk_lang_extra_readme";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   305
	my $pre_pwd = cwd;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   306
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   307
	print "\n Start Create FORUM NOKIA standard extra language zips";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   308
	my $cmd="";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   309
	my $fn_zip_name="";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   310
	my $includes="";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   311
	chdir $lang_extra_dest or die "\n ERROR: Can not chdir to $lang_extra_dest";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   312
	foreach my $lang(keys %$lang_codes)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   313
	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   314
		#Ex: S60_5th_Edition_Arabic_v1_0_en.zip
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   315
		$fn_zip_name="$iniH{'Platform_Abbreviation'}_$iniH{'Edition_number'}_Edition_$$language_names{$lang}_v1_0_en.zip";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   316
		#Copy Read me
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   317
		copy("$readme_src\\ReadMe_$$language_names{$lang}.txt","ReadMe_$$language_names{$lang}.txt");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   318
		#Ex: S60_5th_Edition_Arabic_plug_in.zip + S60_5th_Edition_Arabic_Switcher.zip+ReadMe_Arabic.txt
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   319
		$includes="$iniH{'Platform_Abbreviation'}_$iniH{'Edition_number'}_Edition_$$language_names{$lang}_Switcher.zip  $iniH{'Platform_Abbreviation'}_$iniH{'Edition_number'}_Edition_$$language_names{$lang}_plug_in.zip ReadMe_$$language_names{$lang}.txt";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   320
		
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   321
		$cmd = "zip $lang_extra_dest\\$fn_zip_name  $includes"; 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   322
		print $cmd."\n";  system ( $cmd );	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   323
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   324
	chdir $pre_pwd or die ("\n ERROR: Can not chdir to $pre_pwd");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   325
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   326
sub create_lang_zips 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   327
{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   328
	my ( $lang_codes, $lang_dir, $lang_wa_dir, $dest_dir,$language_names) = @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   329
  enter_sub($lang_dir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   330
  my $curr_dir = cwd;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   331
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   332
  my @localisation_zips = glob("$lang_dir\\*localisation.zip");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   333
  print "Deleted dir  - $dest_dir\n" if do_rmdir_all($dest_dir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   334
  mkpath($dest_dir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   335
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   336
  foreach my $lang ( keys %$lang_codes ){                                #Handle all languages, see SDK_vars.pm for %lang_codes
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   337
    print "\nCreating $lang === started ", scalar localtime(), "\n\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   338
    chdir "$lang_wa_dir" or die "chdir for $lang_wa_dir failed: $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   339
    my ($lang_emu_wa, $lang_resource_wa) = ("$lang_wa_dir\\$lang\\emu","$lang_wa_dir\\$lang\\resource");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   340
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   341
     mkpath ($lang_emu_wa);#Create the directory for $lang_emu_wa
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   342
    if (-e "$lang.zip" ){                                               		#We have delta for this language
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   343
    	my $cmd = "unzip -o $lang.zip $emu_dirs -d $lang_emu_wa";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   344
      print ( $cmd."\n" );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   345
      system ( $cmd );                                                  		#Unzip delta to $lang directory
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   346
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   347
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   348
    #Apply the language patches
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   349
    #It extracts the languages patches resides on filerblr to $lang_wa_dir
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   350
    if (-e "$iniH{S60_Root}\\Languages\\Patch_$lang.zip") 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   351
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   352
      $cmd = "unzip -o $iniH{S60_Root}\\Languages\\Patch_$lang.zip $emu_dirs -d $lang_emu_wa";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   353
      system ($cmd)==0 or print "$cmd\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   354
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   355
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   356
    foreach my $lang_code ( @{$$lang_codes{$lang}} ){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   357
      #Get the localization packages from the localisation zip
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   358
      for my $localisation_zip ( @localisation_zips ){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   359
        $cmd = "unzip -o -j -C $localisation_zip $lang_dir\\package_${lang_code}.zip -d $lang_wa_dir";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   360
        print ( $cmd."\n" ); system ( $cmd );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   361
        #$cmd = "unzip -o -C package_${lang_code}.zip $emu_dirs -d $lang_resource_wa";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   362
        $cmd = "unzip -o -C $iniH{S60_Root}\\s60\\misc\\release\\S60LocFiles\\data\\${lang_code}.zip $emu_dirs -d $lang_resource_wa";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   363
        do {print "$cmd\n"; system ($cmd)} if (-e "${lang_code}.zip");            #Unzip resource to $lang_resource_wa directory
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   364
      }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   365
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   366
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   367
	if (chdir ("$lang_wa_dir\\$lang")) {                                  #If the dir exists => we had the delta for this language
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   368
      system ("attrib /s *.* -r");                                        #Remove read-only attributes
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   369
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   370
      apply_blacklist($lang_emu_wa, ($blacklist, $common_graylist) );  				#Apply graylist
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   371
      apply_blacklist($lang_resource_wa, ($blacklist, $common_graylist) );  	#Apply graylist
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   372
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   373
      print ("Dgbstrippi started on ", cwd(), " === ", scalar localtime(), "\n");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   374
      find \&dbgstrippi, ".";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   375
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   376
      print "Filenames to lowercase started on ", cwd()," === ", scalar localtime(), "\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   377
      find \&lowercase, qw(.);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   378
      print "Filenames to lowercase === finished ", scalar localtime(), "\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   379
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   380
      # zap_files_from_lang_zips("$lang_wa_dir\\$lang");  	 #Remove files which are supposed to be patched, ie. do not overwrite patches
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   381
      # create_101f876d_ini("$lang");                        #Perhaps not needed anymore, this puts the initial input language on, I presume
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   382
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   383
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   384
	  mkpath("$lang_wa_dir\\$lang") unless (-e "$lang_wa_dir\\$lang");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   385
	  chdir ("$lang_wa_dir\\$lang");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   386
    #Perhaps not needed anymore, the zips already contain this
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   387
    create_language_txt($lang_emu_wa, $lang, $lang_codes);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   388
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   389
    create_lang_properties_file ( $lang_emu_wa, $lang );             	                  #This must go to the zip. Do not zap!
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   390
		#Zip the work areas
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   391
    chdir "$lang_emu_wa" or die "chdir for $lang_emu_wa failed: $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   392
    if(defined $language_names)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   393
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   394
    	#Need to create FN specific extra lang zip
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   395
    	$cmd = "zip -r $dest_dir\\$iniH{'Platform_Abbreviation'}_$iniH{'Edition_number'}_Edition_$$language_names{$lang}_Switcher.zip *"; 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   396
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   397
    else
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   398
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   399
    	$cmd = "zip -r $dest_dir\\$iniH{ 'Platform_Build_ID' }-$lang.zip *";          			#Zip them again to Result directory (prefixed by build id)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   400
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   401
    print $cmd."\n";  system ( $cmd );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   402
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   403
  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   404
  chdir $curr_dir or die "Couldn't chdir to $curr_dir: $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   405
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   406
  print "Create undo zip === started ", scalar localtime(), "\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   407
  my $undo_dir = "$lang_wa_dir\\undo2zip";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   408
  foreach (<$dest_dir\\*.zip>){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   409
    next if /package/i;                         					#Do not consider packages
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   410
		my $cmd = "unzip -l $_";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   411
    print ( $cmd."\n" );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   412
    for ( `$cmd` ) {																			#Get the filelisting of the zip
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   413
			next if /\/$/;                            					#Skip the path lines. They end with /
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   414
	    next unless (s/.+\d   //);                					#Devour anything before path
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   415
	    chomp;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   416
	    s[/][\\]g;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   417
	    next unless ( -e "$iniH{Sce_Root}\\sdk_wa\\$_");    #The file is not in SDK
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   418
	    m/(.*\\)/;       																		#Take the directory part -> $1
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   419
	    $cmd = "xcopy \"$iniH{Sce_Root}\\sdk_wa\\$_\" \"$lang_wa_dir\\undo2zip\\$1\" /F /I /Y";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   420
	    system ($cmd)==0 or print "$cmd\n";                 #Copy the file from sdk_wa to be "undozipped"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   421
	  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   422
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   423
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   424
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   425
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   426
sub create_101f876d_ini {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   427
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   428
#Unicode file!
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   429
  my $lang = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   430
  my $file = "$lang_wa_dir\\$lang\\epoc32\\release\\winscw\\udeb\\z\\private\\10202be9\\101f876d.txt";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   431
  open(INI, "<:encoding(utf16le)", $file) or die "can't open $file: $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   432
  open(TMP, ">:raw:encoding(utf16le)", "tmp.txt") or die "can't open tmp.txt: $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   433
  while (<INI>){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   434
    s/0x5 int \p{IsDigit}+/0x5 int $$lang_codes{$lang}[0]/;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   435
    print TMP $_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   436
  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   437
  close(INI);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   438
  close(TMP);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   439
  rename("tmp.txt", $file)     or die "can't rename tmp.txt to $file: $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   440
  print <<KORV5;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   441
$file: 0x5 int 0 -> 0x5 int $$lang_codes{$lang}[0]
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   442
KORV5
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   443
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   444
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   445
sub create_lang_properties_file {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   446
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   447
  my ($lang_wa_dir, $lang) = @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   448
  my @array = split(/_/, $lang);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   449
  enter_sub($lang);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   450
  print "Create language.properties $array[0] === started in $lang_wa_dir ", scalar localtime(), "\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   451
  my $dest_dir = "$lang_wa_dir\\epoc32\\data";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   452
   mkpath($dest_dir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   453
  open (LPF, ">$dest_dir\\language.properties") or die "Can't create $dest_dir\\language.properties: $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   454
  print LPF <<LANG_PROP;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   455
#language.properties
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   456
language=$array[0]
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   457
country=$array[1]
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   458
version=$iniH{ 'Platform_Build_ID' }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   459
LANG_PROP
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   460
  close LPF;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   461
  print "Create language.properties $array[0] === finished ", scalar localtime(), "\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   462
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   463
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   464
sub create_language_txt {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   465
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   466
  my ($lang_wa_dir, $lang, $lang_codes) = @_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   467
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   468
  enter_sub();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   469
  #Check if already exists
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   470
  if (-e "$lang_wa_dir\\epoc32\\release\\winscw\\udeb\\z\\resource\\bootdata\\languages.txt") {print "languages.txt already exists!\n"; return};
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   471
  #Unicode file!
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   472
  my $src_file = "$iniH{S60_Root}\\epoc32\\release\\winscw\\udeb\\z\\resource\\bootdata\\languages.txt";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   473
  open(LANG_SRC, "<:encoding(utf16le)", $src_file) or warn "can't open $src_file: $!" and return;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   474
  open(TMP, ">:raw:encoding(utf16le)", "languages.txt") or die "can't open languages.txt: $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   475
  while (<LANG_SRC>){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   476
    my $cnt=0;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   477
    $cnt = s/\p{IsDigit}+,d/$$lang_codes{$lang}[0],d/;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   478
    print "$src_file:  $& --> $$lang_codes{$lang}[0],d\n" if ($cnt);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   479
    print TMP $_;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   480
  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   481
  close(LANG_SRC);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   482
  close(TMP);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   483
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   484
  #Move the languages.txt to proper place
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   485
  $cmd = "xcopy languages.txt $lang_wa_dir\\epoc32\\release\\winscw\\udeb\\z\\resource\\bootdata\\ /F /R /I /Y";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   486
  system ($cmd)==0 or print "$cmd\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   487
  unlink ("languages.txt");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   488
  exit_sub();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   489
}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   490
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   491
#Remove files that we are going to patch
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   492
#I.e. prevent the patches being overwritten
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   493
sub zap_files_from_lang_zips {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   494
  my $lang = shift;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   495
  enter_sub($lang);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   496
  foreach $patch_dir (qw(Common_Patch CPP_Patch Java_Patch)) {   #These directories are included
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   497
    next unless (-e "$repository_area\\$patch_dir");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   498
    #We create a file (=FH) containing the filenames
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   499
    open( PATCH_FILES, "dir /s /a-d /b $repository_area\\$patch_dir |" ) or die "Cannot open dir $repository_area\\$patch_dir: $!";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   500
    while (<PATCH_FILES>){
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   501
      chomp;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   502
      my $patch_path = "$repository_area\\$patch_dir\\";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   503
      s/\Q$patch_path\E/$lang\\/;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   504
      $target_item = "$_";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   505
      next unless ( -e );    #The file is not in language zip
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   506
      #Delete directories
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   507
      if( -d  ) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   508
				print "Deleted dir  - $target_item\n" if do_rmdir_all($target_item);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   509
      }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   510
      #Notify that (upper)directory does not exist  (One level up from item)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   511
      elsif  ( not(-d (substr($target_item,0,rindex($target_item,'\\'))))) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   512
        print "Could Not Delete $target_item\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   513
      }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   514
      # Delete files that exist or has a star in the name
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   515
      elsif (-e "$target_item" or /\*/ ) {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   516
        system ("del /q /s $target_item")==0 or print " $target_item\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   517
      }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   518
      else {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   519
        system ("del /q /s $target_item")==0 or print " $target_item\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   520
      }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   521
   }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   522
    close( PATCH_FILES );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   523
  }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   524
  print "zap_files_from_lang_zips $lang  === finished ", scalar localtime(), "\n";
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   525
  exit_sub();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   526
  1;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   527
}