|
1 #! perl |
|
2 |
|
3 # Copyright (c) 2009 Symbian Foundation Ltd |
|
4 # This component and the accompanying materials are made available |
|
5 # under the terms of the License "Eclipse Public License v1.0" |
|
6 # which accompanies this distribution, and is available |
|
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 # |
|
9 # Initial Contributors: |
|
10 # Symbian Foundation Ltd - initial contribution. |
|
11 # |
|
12 # Contributors: |
|
13 # |
|
14 # Description: |
|
15 # Perl script to clone or update all of the Foundation MCL repositories |
|
16 |
|
17 use strict; |
|
18 |
|
19 my @clone_options = (); # use ("--noupdate") to clone without extracting the source |
|
20 my $hostname = "prod.foundationhost.org"; |
|
21 |
|
22 # Important: This script uses http access to the repositories, so |
|
23 # the username and password will be stored as cleartext in the |
|
24 # .hg/hgrc file in each repository. |
|
25 |
|
26 my $username = ""; |
|
27 my $password = ""; |
|
28 |
|
29 if ($username eq "" || $password eq "") |
|
30 { |
|
31 print "Must edit this script to supply your username and password\n"; |
|
32 exit 1; |
|
33 } |
|
34 |
|
35 my @sf_packages = ( |
|
36 "sfl/MCL/sf/adaptation/stubs", |
|
37 "sfl/MCL/sf/app/camera", |
|
38 "sfl/MCL/sf/app/commonemail", |
|
39 "sfl/MCL/sf/app/conntools", |
|
40 "sfl/MCL/sf/app/contacts", |
|
41 "sfl/MCL/sf/app/contentcontrol", |
|
42 "sfl/MCL/sf/app/conversations", |
|
43 "sfl/MCL/sf/app/devicecontrol", |
|
44 "sfl/MCL/sf/app/dictionary", |
|
45 "sfl/MCL/sf/app/files", |
|
46 "sfl/MCL/sf/app/gallery", |
|
47 "sfl/MCL/sf/app/graphicsuis", |
|
48 "sfl/MCL/sf/app/helps", |
|
49 "sfl/MCL/sf/app/homescreen", |
|
50 "sfl/MCL/sf/app/im", |
|
51 "sfl/MCL/sf/app/imgeditor", |
|
52 "sfl/MCL/sf/app/imgvieweruis", |
|
53 "sfl/MCL/sf/app/iptelephony", |
|
54 "sfl/MCL/sf/app/java", |
|
55 "sfl/MCL/sf/app/location", |
|
56 "sfl/MCL/sf/app/messaging", |
|
57 "sfl/MCL/sf/app/mmsharinguis", |
|
58 "sfl/MCL/sf/app/musicplayer", |
|
59 "sfl/MCL/sf/app/organizer", |
|
60 "sfl/MCL/sf/app/phone", |
|
61 "sfl/MCL/sf/app/photos", |
|
62 "sfl/MCL/sf/app/poc", |
|
63 "sfl/MCL/sf/app/printing", |
|
64 "sfl/MCL/sf/app/profile", |
|
65 "sfl/MCL/sf/app/radio", |
|
66 "sfl/MCL/sf/app/screensaver", |
|
67 "sfl/MCL/sf/app/settingsuis", |
|
68 "sfl/MCL/sf/app/speechsrv", |
|
69 "sfl/MCL/sf/app/techview", |
|
70 # "sfl/MCL/sf/app/test", - removed in 7 May 09 delivery |
|
71 "sfl/MCL/sf/app/utils", |
|
72 "sfl/MCL/sf/app/videocenter", |
|
73 "sfl/MCL/sf/app/videoeditor", |
|
74 "sfl/MCL/sf/app/videoplayer", |
|
75 "sfl/MCL/sf/app/videotelephony", |
|
76 "sfl/MCL/sf/app/voicerec", |
|
77 "oss/MCL/sf/app/webuis", |
|
78 "sfl/MCL/sf/mw/accesssec", |
|
79 "sfl/MCL/sf/mw/appinstall", |
|
80 "sfl/MCL/sf/mw/appsupport", |
|
81 "sfl/MCL/sf/mw/camerasrv", |
|
82 "sfl/MCL/sf/mw/classicui", |
|
83 "sfl/MCL/sf/mw/dlnasrv", |
|
84 "sfl/MCL/sf/mw/drm", |
|
85 "sfl/MCL/sf/mw/hapticsservices", |
|
86 "sfl/MCL/sf/mw/homescreensrv", |
|
87 "sfl/MCL/sf/mw/imghandling", |
|
88 "sfl/MCL/sf/mw/imsrv", |
|
89 "sfl/MCL/sf/mw/inputmethods", |
|
90 "sfl/MCL/sf/mw/ipappprotocols", |
|
91 "sfl/MCL/sf/mw/ipappsrv", |
|
92 "sfl/MCL/sf/mw/ipconnmgmt", |
|
93 "sfl/MCL/sf/mw/legacypresence", |
|
94 "sfl/MCL/sf/mw/locationsrv", |
|
95 "sfl/MCL/sf/mw/mds", |
|
96 "sfl/MCL/sf/mw/messagingmw", |
|
97 "sfl/MCL/sf/mw/metadatasrv", |
|
98 "sfl/MCL/sf/mw/mmappfw", |
|
99 "sfl/MCL/sf/mw/mmmw", |
|
100 "sfl/MCL/sf/mw/mmuifw", |
|
101 "sfl/MCL/sf/mw/mobiletv", |
|
102 "sfl/MCL/sf/mw/netprotocols", |
|
103 "sfl/MCL/sf/mw/networkingdm", |
|
104 "sfl/MCL/sf/mw/opensrv", |
|
105 "sfl/MCL/sf/mw/phonesrv", |
|
106 "sfl/MCL/sf/mw/remoteconn", |
|
107 "sfl/MCL/sf/mw/remotemgmt", |
|
108 "sfl/MCL/sf/mw/remotestorage", |
|
109 "sfl/MCL/sf/mw/securitysrv", |
|
110 "oss/MCL/sf/mw/serviceapi", |
|
111 "oss/MCL/sf/mw/serviceapifw", |
|
112 "sfl/MCL/sf/mw/shortlinkconn", |
|
113 "sfl/MCL/sf/mw/svgt", |
|
114 "sfl/MCL/sf/mw/uiaccelerator", |
|
115 "sfl/MCL/sf/mw/uiresources", |
|
116 "sfl/MCL/sf/mw/uitools", |
|
117 "sfl/MCL/sf/mw/videoutils", |
|
118 "sfl/MCL/sf/mw/vpnclient", |
|
119 "oss/MCL/sf/mw/web", |
|
120 "sfl/MCL/sf/mw/websrv", |
|
121 "sfl/MCL/sf/mw/wirelessacc", |
|
122 "sfl/MCL/sf/os/boardsupport", |
|
123 "sfl/MCL/sf/os/buildtools", |
|
124 "sfl/MCL/sf/os/cellularsrv", |
|
125 "sfl/MCL/sf/os/commsfw", |
|
126 "sfl/MCL/sf/os/deviceplatformrelease", |
|
127 "sfl/MCL/sf/os/devicesrv", |
|
128 "sfl/MCL/sf/os/graphics", |
|
129 "sfl/MCL/sf/os/imagingext", |
|
130 "sfl/MCL/sf/os/kernelhwsrv", |
|
131 "sfl/MCL/sf/os/lbs", |
|
132 # "sfl/MCL/sf/os/misc", - removed in 7 May 09 delivery |
|
133 "sfl/MCL/sf/os/mm", |
|
134 "sfl/MCL/sf/os/networkingsrv", |
|
135 "sfl/MCL/sf/os/osrndtools", # added 7 Mar 09 |
|
136 "sfl/MCL/sf/os/ossrv", |
|
137 "sfl/MCL/sf/os/persistentdata", |
|
138 "sfl/MCL/sf/os/security", |
|
139 "sfl/MCL/sf/os/shortlinksrv", |
|
140 "sfl/MCL/sf/os/textandloc", |
|
141 "sfl/MCL/sf/os/unref", |
|
142 "sfl/MCL/sf/os/wlan", |
|
143 "sfl/MCL/sf/os/xmlsrv", |
|
144 "sfl/MCL/sf/ostools/osrndtools", |
|
145 "sfl/MCL/sf/tools/build_s60", |
|
146 "sfl/MCL/sf/tools/buildplatforms", |
|
147 "sfl/MCL/sf/tools/homescreentools", |
|
148 "sfl/MCL/sf/tools/makefile_templates", |
|
149 "sfl/MCL/sf/tools/platformtools", |
|
150 "sfl/MCL/sf/tools/rndtools", |
|
151 "sfl/MCL/sf/tools/swconfigtools", |
|
152 ); |
|
153 |
|
154 my @sftools_packages = ( |
|
155 "sfl/MCL/sftools/ana/compatanaapps", |
|
156 "sfl/MCL/sftools/ana/compatanamdw", |
|
157 "sfl/MCL/sftools/ana/dynaanaapps", |
|
158 "sfl/MCL/sftools/ana/dynaanactrlandcptr", |
|
159 "sfl/MCL/sftools/ana/dynaanamdw/analysistools", |
|
160 "sfl/MCL/sftools/ana/dynaanamdw/crashmdw", |
|
161 "sfl/MCL/sftools/ana/staticanaapps", |
|
162 "sfl/MCL/sftools/ana/staticanamdw", |
|
163 "sfl/MCL/sftools/ana/testcreationandmgmt", |
|
164 "sfl/MCL/sftools/ana/testexec", |
|
165 "sfl/MCL/sftools/ana/testfw", |
|
166 # "sfl/MCL/sftools/depl/sdkcreationapps", - removed in 7 May 09 delivery |
|
167 "sfl/MCL/sftools/depl/sdkcreationmdw/packaging", |
|
168 # "sfl/MCL/sftools/depl/sdkcreationmdw/sdkbuild", - removed in 7 May 09 delivery |
|
169 # "sfl/MCL/sftools/depl/sdkcreationmdw/sdkdelivery", - removed in 7 May 09 delivery |
|
170 # "sfl/MCL/sftools/depl/sdkcreationmdw/sdktest", - removed in 7 May 09 delivery |
|
171 "sfl/MCL/sftools/depl/swconfigapps/configtools", |
|
172 "sfl/MCL/sftools/depl/swconfigapps/swmgnttoolsguides", |
|
173 "sfl/MCL/sftools/depl/swconfigapps/sysmodeltools", |
|
174 "sfl/MCL/sftools/depl/swconfigmdw", |
|
175 # "sfl/MCL/sftools/depl/sysdocapps", - removed in 7 May 09 delivery |
|
176 # "sfl/MCL/sftools/depl/sysdocmdw", - removed in 7 May 09 delivery |
|
177 # "sfl/MCL/sftools/depl/toolsplatrelease", - removed in 7 May 09 delivery |
|
178 "sfl/MCL/sftools/dev/build", |
|
179 "sfl/MCL/sftools/dev/dbgsrvsmdw", |
|
180 "sfl/MCL/sftools/dev/devicedbgsrvs", |
|
181 "oss/MCL/sftools/dev/eclipseenv/buildlayout34", |
|
182 "oss/MCL/sftools/dev/eclipseenv/eclipse", |
|
183 "oss/MCL/sftools/dev/hostenv/compilationtoolchains", |
|
184 "oss/MCL/sftools/dev/hostenv/cpptoolsplat", |
|
185 "oss/MCL/sftools/dev/hostenv/dist", |
|
186 "oss/MCL/sftools/dev/hostenv/javatoolsplat", |
|
187 "oss/MCL/sftools/dev/hostenv/makeng", |
|
188 "oss/MCL/sftools/dev/hostenv/pythontoolsplat", |
|
189 "oss/MCL/sftools/dev/ide/carbidecpp", |
|
190 "sfl/MCL/sftools/dev/ide/carbidecppplugins", |
|
191 "sfl/MCL/sftools/dev/iss", |
|
192 "sfl/MCL/sftools/dev/ui", |
|
193 ); |
|
194 |
|
195 foreach my $package (@sf_packages, @sftools_packages) |
|
196 { |
|
197 my @dirs = split /\//, $package; |
|
198 my $license = shift @dirs; |
|
199 my $repotree = shift @dirs; # remove the MCL or FCL repo tree information |
|
200 my $destdir = pop @dirs; # ignore the package name, because Mercurial will create that |
|
201 |
|
202 # Ensure the directories already exist as far as the parent of the repository |
|
203 my $path = ""; |
|
204 foreach my $dir (@dirs) |
|
205 { |
|
206 $path = ($path eq "") ? $dir : "$path/$dir"; |
|
207 if (!-d $path) |
|
208 { |
|
209 mkdir $path; |
|
210 } |
|
211 } |
|
212 |
|
213 $path .= "/$destdir"; # this is where the repository will go |
|
214 |
|
215 my $repo_url = "http://$username:$password\@$hostname/$package/"; |
|
216 if ($license ne "sfl") |
|
217 { |
|
218 # user registration is not required for reading public package repositories |
|
219 $repo_url = "http://developer.symbian.org/$package/"; |
|
220 } |
|
221 |
|
222 if (-d "$path/.hg") |
|
223 { |
|
224 # The repository already exists, so just do an update |
|
225 |
|
226 print "Updating $destdir from $package...\n"; |
|
227 system("hg", "pull", "-R", $path, $repo_url); |
|
228 } |
|
229 else |
|
230 { |
|
231 # Clone the repository |
|
232 |
|
233 print "Cloning $destdir from $package...\n"; |
|
234 system("hg", "clone", @clone_options, $repo_url, $path); |
|
235 } |
|
236 |
|
237 } |