author | jake |
Mon, 24 May 2010 12:15:02 +0300 | |
branch | v5backport |
changeset 76 | 62d594099fbe |
parent 67 | 35a198a504a8 |
permissions | -rw-r--r-- |
67
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
1 |
# |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
2 |
# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
3 |
# All rights reserved. |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
4 |
# This component and the accompanying materials are made available |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
5 |
# under the terms of "Eclipse Public License v1.0" |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
6 |
# which accompanies this distribution, and is available |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
8 |
# |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
9 |
# Initial Contributors: |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
10 |
# Nokia Corporation - initial contribution. |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
11 |
# |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
12 |
# Contributors: |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
13 |
# |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
14 |
# Description: A tool that install widgets and dtd files. |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
15 |
# Tool is mainly meant to be used via dtd.mk makefile template, |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
16 |
# but can be run as such also. |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
17 |
# |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
18 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
19 |
use strict; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
20 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
21 |
#Tools path |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
22 |
use constant LIBPATH => '/epoc32/tools'; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
23 |
use lib LIBPATH; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
24 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
25 |
use Cwd; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
26 |
use Getopt::Long; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
27 |
use Convert_file; # for .dtd to .loc file conversion |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
28 |
use File::Copy; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
29 |
use File::Find; # for finding |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
30 |
use File::Path; # mkpath |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
31 |
use File::Basename; # fileparse |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
32 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
33 |
if ( $#ARGV < 1) |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
34 |
{ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
35 |
print <<USAGE; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
36 |
Usage: dtd_installer.pl -n dtd_name [-t type][-l dtd_location] [-s sub_folder_name] [-o output_location] [-a action_type] [-f force_create] [-d debug] |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
37 |
-n: widget or dtd (switch_loc) file name |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
38 |
-t: optional, default type is dtd and other possibility is widget |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
39 |
-l: optional, input path location, |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
40 |
default for widget type is \\epoc32\\data\\z\\resource\\homescreen |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
41 |
default for dtd is \\epoc32\\include\\domain\\<layer>\\loc |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
42 |
-s: optional, for widgets only, default are xuikon and hsps |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
43 |
-o: optional, default is \\epoc32\\release\\winscw\\udeb\\z\\private\\200159c0\\install |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
44 |
-a: optional, default is build other possible are what and clean |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
45 |
-f: optional, for widgets only, themeinstaller is always run for xuikon, even switch loc file don\'t exist |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
46 |
-d: optional, for debugging purposes (e.g. temporary folders aren't deleted) |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
47 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
48 |
Example how to run for dtd files only: |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
49 |
dtd_installer.pl -n matrixmenudata -o \\epoc32\\data\\z\\private\\200113DD\\content |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
50 |
Example how to run for one widget: |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
51 |
dtd_installer.pl -n view -t type widget |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
52 |
Example how to run for all widgets: |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
53 |
dtd_installer.pl -n all_widgets -t type widget -d yes |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
54 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
55 |
USAGE |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
56 |
exit -1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
57 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
58 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
59 |
my ($dtd_name, $dtd_type, $dtd_location, $sub_folder_name, $output_location, $action_type, $force_create, $debug, $what_output_file); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
60 |
my (@all_dirs, @find_files, @files_to_convert); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
61 |
my @sub_folders=("xuikon","hsps"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
62 |
my @layers=("\\epoc32\\include\\domain\\osextensions\\loc", "\\epoc32\\include\\domain\\middleware\\loc", "\\epoc32\\include\\domain\\applications\\loc", "\\epoc32\\include\\platform\\loc", "\\epoc32\\include\\platform\\mw\\loc", "\\epoc32\\include\\platform\\app\\loc"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
63 |
my $themeinstaller_tool = "\\epoc32\\tools\\themeinstaller\\themeinstaller.bat"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
64 |
my $themeinstaller_property_file = "\\epoc32\\tools\\themeinstaller\\data\\widgetinstaller.prop"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
65 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
66 |
# Set this to 1 if you need to debug the script |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
67 |
# $debug = 1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
68 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
69 |
GetOptions( |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
70 |
'n=s' => \$dtd_name, |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
71 |
't=s' => \$dtd_type, |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
72 |
'l=s' => \$dtd_location, |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
73 |
's=s' => \$sub_folder_name, |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
74 |
'o=s' => \$output_location, |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
75 |
'a=s' => \$action_type, |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
76 |
'd=s' => \$debug, |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
77 |
'f=s' => \$force_create ); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
78 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
79 |
check_options(); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
80 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
81 |
if (($action_type eq "what") && (-e $what_output_file)) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
82 |
open( WHAT, $what_output_file) or die $!; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
83 |
while( <WHAT> ){ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
84 |
print ; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
85 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
86 |
close WHAT; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
87 |
exit; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
88 |
} elsif (($action_type eq "clean") && (-e $what_output_file)) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
89 |
unlink $what_output_file; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
90 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
91 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
92 |
if ($dtd_type eq "widget") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
93 |
if ((lc $dtd_name) eq "all_widgets") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
94 |
# read all widget names from given directory |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
95 |
opendir(SDIR, $dtd_location) or die("ERROR: dtd_installer.pl, can not open $dtd_location\n"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
96 |
@all_dirs = grep !/^\.\.?$/, readdir SDIR; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
97 |
closedir(SDIR); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
98 |
if (!@all_dirs) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
99 |
warn"ERROR: dtd_installer.pl, couldn't find any widgets:\n"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
100 |
die; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
101 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
102 |
foreach my $temp_dtd_name (@all_dirs) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
103 |
$dtd_name = $temp_dtd_name; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
104 |
my $dir = "${dtd_location}\\${dtd_name}"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
105 |
if (-d $dir) { # Calling process_widget sub routine for every directory |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
106 |
process_widget(); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
107 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
108 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
109 |
} else { # Only one widget processed |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
110 |
process_widget(); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
111 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
112 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
113 |
# Run only .loc to .dtd conversion for non widgets |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
114 |
process_dtd($output_location, $dtd_name); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
115 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
116 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
117 |
sub process_widget |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
118 |
{ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
119 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
120 |
foreach my $sub_f (@sub_folders) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
121 |
my @lang_dirs; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
122 |
if ($debug) { print "Current subfolder:\n $sub_f\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
123 |
${sub_folder_name} = $sub_f; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
124 |
if ($debug) { print "Processing widget:\n${dtd_location}\\${dtd_name}\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
125 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
126 |
my $current_time = time; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
127 |
my $full_dtd_input_path = "${dtd_location}\\${dtd_name}\\${sub_folder_name}"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
128 |
my $full_dtd_output_path = "${output_location}\\${dtd_name}\\${sub_folder_name}"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
129 |
my $temp_path = "${dtd_location}\\${dtd_name}\\temp"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
130 |
my $temp_loc_path = "${dtd_location}\\${dtd_name}\\${sub_folder_name}\\temp"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
131 |
my $temp_dtd_path = "${temp_path}\\$current_time"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
132 |
my $temp_loc_files_path = "${temp_loc_path}\\$current_time"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
133 |
my $no_success = 1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
134 |
my $count = 0; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
135 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
136 |
while ($no_success) { # make sure that temporary directory isn't already in the use |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
137 |
undef $no_success; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
138 |
$current_time = time; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
139 |
$temp_dtd_path = "${temp_path}\\$current_time"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
140 |
mkpath $temp_dtd_path or $no_success=1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
141 |
sleep 1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
142 |
$count++; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
143 |
if ($count > 100 ) { warn: "ERROR: dtd_installer.pl, couldn't create temp directory $temp_dtd_path !!!\nDtd_installer\.pl script stopped\n"; die;} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
144 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
145 |
$count = 0; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
146 |
$no_success = 1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
147 |
while ($no_success) { # make sure that temporary directory isn't already in the use |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
148 |
undef $no_success; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
149 |
$current_time = time; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
150 |
$temp_loc_files_path = "${temp_loc_path}\\$current_time"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
151 |
mkpath $temp_loc_files_path or $no_success=1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
152 |
sleep 1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
153 |
$count++; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
154 |
if ($count > 100 ) { warn: "ERROR: dtd_installer.pl, couldn't create temp directory $temp_loc_files_path!!!\nDtd_installer\.pl script stopped\n"; die;} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
155 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
156 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
157 |
if ($debug) { print "Full dtd input path:\n$full_dtd_input_path\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
158 |
if ($debug) { print "Full dtd output path:\n$full_dtd_output_path\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
159 |
opendir(SDIR, $full_dtd_input_path) or die("ERROR: dtd_installer.pl, can not open $full_dtd_input_path\n"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
160 |
@lang_dirs = grep !/^\.\.?$/, readdir SDIR; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
161 |
closedir(SDIR); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
162 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
163 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
164 |
if (${sub_folder_name} eq "xuikon") { # Copy engineering english files always to 00 folder |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
165 |
copy_files($full_dtd_input_path,"${temp_loc_files_path}\\00"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
166 |
} else{ #hsps folder |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
167 |
copy_files($full_dtd_input_path,"${full_dtd_output_path}\\00"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
168 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
169 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
170 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
171 |
foreach my $lang_id (@lang_dirs) { # generate localized .dtd files |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
172 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
173 |
my $dtd_temp = "${full_dtd_input_path}\\${lang_id}"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
174 |
if ((-f $dtd_temp) && ($lang_id =~ /.dtd/i) ) { # running loc to dtd for all .dtd files |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
175 |
if ($debug) { print "Dtd file found:\n$dtd_temp\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
176 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
177 |
if (${sub_folder_name} eq "xuikon") { # generate xuikon .dtd files to temp path |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
178 |
if ($debug) { print "Widget type DTD, xuikon subfolder\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
179 |
process_dtd($temp_loc_files_path, $lang_id); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
180 |
} else{ #hsps folder |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
181 |
if ($debug) { print "Widget type DTD, hsps subfolder\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
182 |
process_dtd($full_dtd_output_path, $lang_id); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
183 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
184 |
} elsif ((${sub_folder_name} eq "xuikon") && ($force_create ne "") && (-d $dtd_temp)) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
185 |
copy_files($dtd_temp,"${temp_loc_files_path}\\${lang_id}"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
186 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
187 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
188 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
189 |
if (${sub_folder_name} eq "xuikon") { # generate localized files |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
190 |
if (!(-f $themeinstaller_tool)) { die("ERROR: dtd_installer.pl, can not find themeinstaller: $themeinstaller_tool\n"); } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
191 |
if (!(-f $themeinstaller_property_file)) { die("ERROR: dtd_installer.pl, can not find themeinstaller property file: $themeinstaller_property_file\n"); } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
192 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
193 |
if (-d $temp_loc_files_path) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
194 |
opendir(SDIR, $temp_loc_files_path) or die("ERROR: dtd_installer.pl, can not open $temp_loc_files_path\n"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
195 |
@lang_dirs = grep !/^\.\.?$/, readdir SDIR; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
196 |
closedir(SDIR); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
197 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
198 |
foreach my $lang_id (@lang_dirs) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
199 |
my $lang_dir = "$temp_loc_files_path\\$lang_id"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
200 |
if ($debug) { print"Language directory:\n$lang_dir\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
201 |
if (-d $lang_dir) { # Running themeinstaller for all language folders in temp path |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
202 |
my $temp_dir = "$temp_dtd_path\\$lang_id"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
203 |
copy_files($full_dtd_input_path, "$temp_dir"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
204 |
my $lang_temp_dir = "$full_dtd_input_path\\$lang_id"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
205 |
if (-d $lang_temp_dir) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
206 |
copy_files("$lang_temp_dir", "$temp_dir"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
207 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
208 |
copy_files("$temp_loc_files_path\\$lang_id", "$temp_dir"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
209 |
if (($action_type eq "build") || ($debug)) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
210 |
print ("Calling themeinstaller: \n$themeinstaller_tool $temp_dtd_path\\${lang_id}\\${dtd_name}.dat $temp_dtd_path\\${lang_id} -prop:${themeinstaller_property_file}\n"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
211 |
system ("$themeinstaller_tool","$temp_dtd_path\\${lang_id}\\${dtd_name}.dat","$temp_dtd_path\\${lang_id}", "-prop:${themeinstaller_property_file}"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
212 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
213 |
system ("$themeinstaller_tool","$temp_dtd_path\\${lang_id}\\${dtd_name}.dat","$temp_dtd_path\\${lang_id}", "-prop:${themeinstaller_property_file}", ">$temp_dtd_path\\${lang_id}\\themeinstaller.log", "2>&1" ); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
214 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
215 |
copy_files("$temp_dir", "$full_dtd_output_path\\$lang_id", "recursive"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
216 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
217 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
218 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
219 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
220 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
221 |
if ($debug) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
222 |
print "Widget processed: ${dtd_name} \n"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
223 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
224 |
# Remove all temporary directories |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
225 |
if (-d $temp_dtd_path) { rmtree ($temp_dtd_path); } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
226 |
if (-d $temp_loc_files_path) { rmtree ($temp_loc_files_path); } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
227 |
rmdir $temp_path; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
228 |
rmdir $temp_loc_path; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
229 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
230 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
231 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
232 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
233 |
sub process_dtd { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
234 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
235 |
my $output_path = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
236 |
my $switch_loc_name = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
237 |
$switch_loc_name =~ s/.dtd//i;; # remove the .dtd extension |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
238 |
my $input_path = $dtd_location; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
239 |
my ($found, $loc_file); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
240 |
if ($action_type eq "build") { print "Used switch loc file name:\n${switch_loc_name}\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
241 |
if ($debug) { print "Used input path:\n${input_path}\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
242 |
if ($debug) { print "Used output path:\n${output_path}\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
243 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
244 |
foreach (@layers) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
245 |
$input_path = $_; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
246 |
if ($debug) { print("Used switch loc file path:\n${input_path}\n"); } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
247 |
my $loc_file = "${input_path}\\${switch_loc_name}.loc"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
248 |
if (! -e $loc_file) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
249 |
$loc_file = "${input_path}\\sc\\${switch_loc_name}.loc"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
250 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
251 |
if (-e $loc_file) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
252 |
convert_locs_to_dtds($loc_file, $input_path, $output_path); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
253 |
$found = "yes"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
254 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
255 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
256 |
if ($found ne "yes") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
257 |
warn "ERROR: dtd_installer.pl, no .loc file found:\n${switch_loc_name}.loc\n"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
258 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
259 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
260 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
261 |
sub check_options { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
262 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
263 |
if ($dtd_name eq "") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
264 |
warn: "ERROR: dtd_installer.pl, no widget name given!!!\nDtd_installer\.pl script stopped\n"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
265 |
die; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
266 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
267 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
268 |
if ($dtd_type eq "") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
269 |
$dtd_type = "dtd"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
270 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
271 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
272 |
if ($dtd_location eq "") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
273 |
if ($dtd_type eq "widget") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
274 |
$dtd_location = "\\epoc32\\data\\z\\resource\\homescreen"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
275 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
276 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
277 |
if ($dtd_type eq "dtd") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
278 |
undef @layers; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
279 |
@layers[0]=${dtd_location}; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
280 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
281 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
282 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
283 |
if ($output_location eq "") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
284 |
$output_location = "\\epoc32\\release\\winscw\\udeb\\z\\private\\200159c0\\install"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
285 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
286 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
287 |
if (${sub_folder_name} ne ""){ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
288 |
undef @sub_folders; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
289 |
@sub_folders[0]=${sub_folder_name}; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
290 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
291 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
292 |
if ($action_type eq "") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
293 |
$action_type = "build"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
294 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
295 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
296 |
$dtd_location =~ s/\//\\/g; #Change / marks to \ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
297 |
$output_location =~ s/\//\\/g; #Change / marks to \ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
298 |
$what_output_file = $output_location; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
299 |
$what_output_file =~ s/\\/_/g; #Change \ marks to _ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
300 |
$what_output_file = "\\epoc32\\build\\dtd_installer\\" . $what_output_file . $dtd_name . ".txt"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
301 |
if ( !-d "/epoc32/build/dtd_installer") { mkdir("/epoc32/build/dtd_installer"); } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
302 |
if ($debug) { print "Output what file: $what_output_file\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
303 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
304 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
305 |
# This subroutine moves files to/from temporary themeinstaller location. |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
306 |
sub copy_files { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
307 |
my $in_path = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
308 |
my $out_path = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
309 |
my $recursive = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
310 |
if ($debug) { print "Copying from: $in_path\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
311 |
if ($debug) { print "To: $out_path\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
312 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
313 |
if ($recursive) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
314 |
find( \&getFiles, $in_path ); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
315 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
316 |
opendir(SDIR, $in_path) or die("ERROR: dtd_installer.pl, can not open $in_path\n"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
317 |
@find_files = grep !/^\.\.?$/, readdir SDIR; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
318 |
closedir(SDIR); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
319 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
320 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
321 |
foreach my $file (@find_files) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
322 |
my $in_file = "${in_path}\\${file}"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
323 |
my $out_file= "${out_path}\\${file}"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
324 |
if ($recursive) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
325 |
$in_file = $file; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
326 |
$file =~ /.*\\(.*)\\.*\\.*\\.*\\(.*)\\(.*)/i; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
327 |
my $temp=$1; # lang code |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
328 |
my $temp2=$3; # file name |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
329 |
if ((lc $2) eq "sources") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
330 |
$out_file = "${out_path}\\$2\\$3"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
331 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
332 |
if (length($temp) > 4) { #skip extra files |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
333 |
next; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
334 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
335 |
while (length($temp) < 4){ $temp = "0".$temp; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
336 |
$temp2 =~ s/\d{4}/$temp/g; # change .odt filename for correct lang |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
337 |
$out_file = "${out_path}\\$temp2"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
338 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
339 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
340 |
if ($debug) { print "Copying file from: $in_file\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
341 |
if ($debug) { print "To: $out_file\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
342 |
if (-f $in_file){ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
343 |
if ($action_type eq "build") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
344 |
if ((!($out_file =~ /\\temp\\/i))) {write_what_file("$out_file")}; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
345 |
xcopy($in_file,$out_file); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
346 |
} elsif ($action_type eq "clean") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
347 |
if (!($out_file =~ /\\temp\\/i)) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
348 |
unlink $out_file; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
349 |
my $temp_dir_path = $out_file; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
350 |
$temp_dir_path =~ /(.*)\\.*/; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
351 |
$temp_dir_path = $1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
352 |
rmdir $temp_dir_path; # Try to remove empty language directories |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
353 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
354 |
xcopy($in_file,$out_file); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
355 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
356 |
} elsif ($action_type eq "what") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
357 |
if (!($out_file =~ /\\temp\\/i)) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
358 |
write_what_file("$out_file"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
359 |
print("$out_file\n"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
360 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
361 |
xcopy($in_file,$out_file); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
362 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
363 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
364 |
warn ("ERROR: dtd_installer.pl, unknown action type"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
365 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
366 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
367 |
if ($debug) { print "Not file found: $in_file\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
368 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
369 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
370 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
371 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
372 |
# This subroutine converts LOC files to DTD files. Files that are |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
373 |
# listed in the switch_loc file are converted to DTD files. |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
374 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
375 |
sub convert_locs_to_dtds { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
376 |
my $switch_loc_file = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
377 |
my $in_path = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
378 |
my $out_path = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
379 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
380 |
open(my $switch_loc_file_handle, "$switch_loc_file") |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
381 |
or die "Can't open `$switch_loc_file' for reading: $!"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
382 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
383 |
# Read localised .loc file names from used input switch loc file |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
384 |
while (my $line = <$switch_loc_file_handle>) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
385 |
chomp($line); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
386 |
if (($line =~ "include") && (!($line =~ /\<sc\//i)) && (!($line =~ /\<00\//i)) ){ # Read all lines that contains include, except sc and 00 |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
387 |
$line=~ /.*\<(.*)\>.*/; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
388 |
$line=$1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
389 |
$line =~ s/\//\\/g; #Change / marks to \ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
390 |
if ($debug) { print"Adding localised file to conversion list:\n$line\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
391 |
push @files_to_convert, $line; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
392 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
393 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
394 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
395 |
close $switch_loc_file_handle; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
396 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
397 |
# Process all the .loc files. |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
398 |
foreach (@files_to_convert) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
399 |
my $loc_file = "$in_path\\$_"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
400 |
my $out_file = "$out_path\\$_"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
401 |
$out_file =~ s/_\d{2,5}(.{4})$/$1/i; # remove the language code from the file name. |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
402 |
if ($debug) { print"Trying to convert file:\n$loc_file\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
403 |
if ($debug) { print"To out file:\n$out_file\n"; } |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
404 |
if (-f $loc_file) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
405 |
if (($action_type eq "build") || ((${dtd_type} eq "widget") && (${sub_folder_name} eq "xuikon")) ) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
406 |
#old if ((!($out_file =~ /\\temp\\/i))) {write_what_file("$out_file")}; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
407 |
xcopy($loc_file,$out_file); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
408 |
Convert_file::convert_file($out_file); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
409 |
if ((!($out_file =~ /\\temp\\/i))) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
410 |
my $convert_out_file = $out_file; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
411 |
$convert_out_file =~ s/\.loc/\.dtd/; # replace .loc with .dtd |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
412 |
write_what_file("$convert_out_file"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
413 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
414 |
if (!($debug)) { unlink $out_file; } # Delete the copied .loc file |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
415 |
$out_file =~ s/\.loc/\.log/; # replace .loc with .log |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
416 |
if (!($debug)) { unlink $out_file; } # Delete the conversion .log file |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
417 |
} elsif ($action_type eq "clean") { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
418 |
$out_file =~ s/\.loc/\.dtd/; # replace .loc with .dtd |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
419 |
unlink $out_file; # delete the output file |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
420 |
my $temp_dir_path = $out_file; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
421 |
$temp_dir_path =~ /(.*)\\.*/; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
422 |
$temp_dir_path = $1; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
423 |
rmdir $temp_dir_path; # Try to remove empty language directories |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
424 |
} elsif (($action_type eq "what") && (!($out_file =~ /\\temp\\/i))) { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
425 |
$out_file =~ s/\.loc/\.dtd/; # replace .loc with .dtd |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
426 |
print("$out_file\n"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
427 |
write_what_file("$out_file"); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
428 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
429 |
} else { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
430 |
warn "ERROR: dtd_installer.pl, no .loc file found: $loc_file\n"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
431 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
432 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
433 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
434 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
435 |
# This subroutine is for file copying |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
436 |
sub xcopy |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
437 |
{ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
438 |
my $source = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
439 |
my $dist = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
440 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
441 |
# if distination file exist then clear read flag |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
442 |
if (-f $dist) |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
443 |
{ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
444 |
chmod ($dist , 0755); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
445 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
446 |
else |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
447 |
{ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
448 |
my($n, $d, $ext) = fileparse($dist, '\..*'); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
449 |
# check weather distination directory exist or not. If directory doesn't exist then create it. |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
450 |
-d $d || mkpath($d, 0, 0x755); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
451 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
452 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
453 |
# copy source to distination |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
454 |
copy($source,$dist); |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
455 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
456 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
457 |
# read files from given path to filelist |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
458 |
sub getFiles { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
459 |
my $file_name = $File::Find::name; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
460 |
$file_name =~ s/\//\\/g; #Change / marks to \ |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
461 |
chomp $file_name; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
462 |
next if ( -d $file_name ); # Skip directories |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
463 |
next if ((!($file_name =~ /o0000/i)) && (!($file_name =~ /\/sources\//i))); # Skip other then resource and source files |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
464 |
push @find_files, $file_name; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
465 |
} |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
466 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
467 |
sub write_what_file { |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
468 |
my $out = shift; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
469 |
open( WHAT, ">>$what_output_file") or die $!; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
470 |
print WHAT "$out\n"; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
471 |
close WHAT; |
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
472 |
|
35a198a504a8
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff
changeset
|
473 |
} |