|
1 use strict; |
|
2 |
|
3 my $SYSDEFTOOLS_PATH = "packages\\sysdeftools"; |
|
4 my $XALAN_J = "java -jar $SYSDEFTOOLS_PATH\\xalan.jar"; |
|
5 my $XALAN_C = "packages\\sysmodelgen\\rsc\\installed\\Xalan\\Xalan.exe"; |
|
6 |
|
7 system("rmdir /S /Q tmp") if (-d "tmp"); |
|
8 mkdir("tmp"); |
|
9 chdir("tmp"); |
|
10 |
|
11 print "\n\n### CLONE MCL/sftools/fbf/projects/packages REPO ###\n"; |
|
12 system("hg clone -r default http://developer.symbian.org/oss/MCL/sftools/fbf/projects/packages"); |
|
13 my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); |
|
14 my $timestamp = sprintf "%4d%02d%02d%02d%02d%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec; |
|
15 #print "\n\n### CLONE MCL/sf/os/buildtools REPO ###\n"; |
|
16 #system("hg clone -r RCL_3 http://developer.symbian.org/oss/MCL/sf/os/buildtools"); |
|
17 print "\n\n### CLONE MCL/sftools/fbf/projects/platforms REPO ###\n"; |
|
18 system("hg clone -r default http://developer.symbian.org/oss/MCL/sftools/fbf/projects/platforms"); |
|
19 |
|
20 # get the codelines from the packages repo |
|
21 opendir(DIR, "packages"); |
|
22 my @codelines = grep(($_ !~ /^\.\.?$/ and $_ =~ /^symbian/), readdir(DIR)); |
|
23 close(DIR); |
|
24 |
|
25 # get the changeset from the platform repo |
|
26 my $platform_changeset = `hg -R platforms identify -i`; |
|
27 chomp $platform_changeset; |
|
28 print "-->$platform_changeset<--\n"; |
|
29 |
|
30 # loop over codelines |
|
31 for my $codeline (@codelines) |
|
32 { |
|
33 mkdir($codeline); |
|
34 |
|
35 # Split model into package models |
|
36 print "\n\n### SPLIT MODEL INTO PACKAGE MODELS ###\n"; |
|
37 my $updatedefault_cmd = "hg -R packages update -r default"; |
|
38 print "$updatedefault_cmd\n"; |
|
39 system($updatedefault_cmd); |
|
40 my $rmdir_cmd = "del /S packages\\$codeline\\package_definition.xml >nul"; |
|
41 print "$rmdir_cmd\n"; |
|
42 system($rmdir_cmd); |
|
43 my $splitmodel_cmd = "perl ..\\split_sysdef.pl -s platforms\\$codeline\\single\\sysdefs\\system_model.xml -o packages\\$codeline"; |
|
44 print "$splitmodel_cmd\n"; |
|
45 system($splitmodel_cmd); |
|
46 if ($codeline eq 'symbian3') # also update CompilerCompatibility |
|
47 { |
|
48 my $rmdir2_cmd = "del /S packages\\CompilerCompatibility\\package_definition.xml >nul"; |
|
49 print "$rmdir2_cmd\n"; |
|
50 system($rmdir2_cmd); |
|
51 my $splitmodel2_cmd = "perl ..\\split_sysdef.pl -s platforms\\$codeline\\single\\sysdefs\\system_model.xml -o packages\\CompilerCompatibility"; |
|
52 print "$splitmodel2_cmd\n"; |
|
53 system($splitmodel2_cmd); |
|
54 } |
|
55 my $addremove_cmd = "hg -R packages addremove"; |
|
56 print "$addremove_cmd\n"; |
|
57 system($addremove_cmd); |
|
58 my $diff_cmd = "hg -R packages diff --stat"; |
|
59 print "$diff_cmd\n"; |
|
60 my @diff_output = `$diff_cmd`; |
|
61 if (@diff_output) |
|
62 { |
|
63 my $commit_cmd = "hg -R packages commit -m \"Update package models from latest system model (platform\@$platform_changeset)\" -u\"Dario Sestito <darios\@symbian.org>\""; |
|
64 print "$commit_cmd\n"; |
|
65 system($commit_cmd); |
|
66 my $push_cmd = "hg -R packages push http://darios:symbian696b\@developer.symbian.org/oss/MCL/sftools/fbf/projects/packages"; |
|
67 print "$push_cmd\n"; |
|
68 system($push_cmd); |
|
69 } |
|
70 } |
|
71 |