bump product version to 4.1.6.2
[LibreOffice.git] / odk / util / check.pl
blob5a2df1681dc9afe1051ddc97ad5b13195ae73c74
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 # check - a perl script to check some files and directories if they exists
21 # A first simple check if the SDK was built completely.
24 $return = 0;
26 $SdkDir = "$ARGV[0]";
27 $OperatingSystem = "$ARGV[1]";
28 $ExePrefix = "$ARGV[2]";
30 sub check_file
32 my ($file) = @_;
33 return -e "$SdkDir/$file";
36 sub check_dir
38 my ($dir) = @_;
39 return -d "$SdkDir/$dir";
42 print "Check for $OperatingSystem\n";
44 if (-d "$SdkDir") {
45 # check binaries
46 print "check binaries: ";
47 if (check_dir("bin")) {
48 my @binarylist = ( "idlc","cppumaker","javamaker",
49 "regcompare","autodoc",
50 "unoapploader", "uno-skeletonmaker" );
51 if ($ENV{SYSTEM_UCPP} eq "") {
52 push @binarylist,"ucpp";
55 foreach $i (@binarylist)
57 if (!check_file("bin/$i$ExePrefix")) {
58 $return++;
59 print "\nERROR: \"bin/$i$ExePrefix\" is missing\n";
60 } else {
61 print "+";
65 if ($OperatingSystem eq "windows" || $OperatingSystem eq "mingw") {
66 if ($OperatingSystem eq "windows" && !check_file("bin/climaker.exe")) {
67 $return++;
68 print "\nERROR: \"bin/climaker.exe\" is missing\n";
69 } else {
70 print "+";
73 if ($OperatingSystem eq "macosx") {
74 if (!check_file("bin/addsym-macosx.sh")) {
75 $return++;
76 print "\nERROR: \"bin/addsym-macosx.sh\" is missing\n";
77 } else {
78 print "+";
81 } else {
82 $return++;
84 print "\n";
86 # packaging files
87 print "check packaging files: ";
88 if (check_dir("docs")) {
89 my @filelist = ( "install.html",
90 "notsupported.html","sdk_styles.css","tools.html",
91 "images/arrow-1.gif", "images/arrow-3.gif",
92 "images/odk-footer-logo.gif",
93 "images/bg_table.png","images/bg_table2.png",
94 "images/bg_table3.png", "images/nav_down.png",
95 "images/nav_home.png","images/nav_left.png",
96 "images/nav_right.png","images/nav_up.png",
97 "images/sdk_head-1.png", "images/sdk_head-2.png",
98 "images/sdk_line-1.gif", "images/sdk_line-2.gif",
99 "common/ref/idl.css", "images/nada.gif",
100 "images/arrow-2.gif", "images/bluball.gif",
101 "images/ooo-main-app_32.png");
103 foreach $i (@filelist)
105 if (!check_file("docs/$i")) {
106 $return++;
107 print "\nERROR: \"docs/$i\" is missing\n";
108 } else {
109 print "+";
112 } else {
113 $return++;
115 print "\n";
117 #check configure files
118 print "check config files: ";
119 if ($OperatingSystem eq "windows" || $OperatingSystem eq "mingw") {
120 if (!check_file("setsdkenv_windows.bat")) {
121 print "\nERROR: \"setsdkenv_windows.bat\" is missing\n";
122 $return++;
124 if (!check_file("setsdkenv_windows.template")) {
125 print "\nERROR: \"setsdkenv_windows.template\" is missing\n";
126 $return++;
128 if (!check_file("cfgWin.js")) {
129 print "\nERROR: \"cfgWin.js\" is missing\n";
130 $return++;
132 } else {
133 if (!check_file("configure.pl")) {
134 print "\nERROR: \"configure.pl\" is missing\n";
135 $return++;
137 if (!check_file("config.guess")) {
138 print "\nERROR: \"config.guess\" is missing\n";
139 $return++;
141 if (!check_file("config.sub")) {
142 print "\nERROR: \"config.sub\" is missing\n";
143 $return++;
145 if (!check_file("setsdkenv_unix")) {
146 print "\nERROR: \"setsdkenv_unix\" is missing\n";
147 $return++;
149 if (!check_file("setsdkenv_unix.sh.in")) {
150 print "\nERROR: \"setsdkenv_unix.sh.in\" is missing\n";
151 $return++;
154 print "\n";
156 #check setting files
157 print "check setting files: ";
158 if (check_dir("settings")) {
159 if (!check_file("settings/settings.mk")) {
160 print "\nERROR: \"settings/settings.mk\" is missing\n";
161 $return++;
163 if (!check_file("settings/std.mk")) {
164 print "\nERROR: \"settings/std.mk\" is missing\n";
165 $return++;
167 if (!check_file("settings/stdtarget.mk")) {
168 print "\nERROR: \"settings/stdtarget.mk\" is missing\n";
169 $return++;
171 } else {
172 $return++;
174 print "\n";
176 #check cpp docu, it is only a first and simple check
177 # improvement required
178 if ($ENV{'DOXYGEN'} ne '') {
179 print "check cpp docu: ";
180 if (check_dir("docs/cpp/ref")) {
181 if (!check_file("docs/cpp/ref/index.html")) {
182 print "\nERROR: \"docs/cpp/ref/index.html\" is missing\n";
183 $return++;
185 } else {
186 $return++;
188 print "\n";
191 #check java docu, it is only a first and simple check
192 # improvement required
193 my $solar_java = $ENV{"SOLAR_JAVA"};
194 my $JDK = $ENV{"JDK"};
195 if (defined($solar_java) && $solar_java ne "" && (!defined($JDK) || $JDK ne "gcj")) {
196 print "check java docu: ";
197 if (check_dir("docs/java/ref")) {
198 if (!check_file("docs/java/ref/index.html")) {
199 print "\nERROR: \"docs/java/ref/index.html\" is missing\n";
200 $return++;
203 my @dir_list = ( "lib","lib/uno","lib/uno/helper","lib/uno/helper/class-use",
204 "uno","uno/class-use","comp","comp/helper",
205 "comp/helper/class-use");
207 foreach $i (@dir_list)
209 if (!check_dir("docs/java/ref/com/sun/star/$i")) {
210 $return++;
211 print "\nERROR: \"docs/java/ref/com/sun/star/$i\" is missing\n";
212 } else {
213 print "+";
216 } else {
217 $return++;
219 print "\n";
222 #check idl docu, it is only a first and simple check
223 # improvement required
224 print "check idl docu: ";
225 if (check_dir("docs/common/ref")) {
226 if (!check_file("docs/common/ref/module-ix.html")) {
227 print "\nERROR: \"docs/common/ref/module-ix.html\" is missing\n";
228 $return++;
230 if (!check_dir("docs/common/ref/index-files")) {
231 print "\nERROR: \"docs/common/ref/index-files\" is missing\n";
232 $return++;
234 if (!check_file("docs/common/ref/index-files/index-10.html")) {
235 print "\nERROR: \"docs/common/ref/index-files/index-10.html\" is missing\n";
236 $return++;
239 my @idl_dirlist = ( "accessibility",
240 "animations",
241 "auth",
242 "awt",
243 "awt/tab",
244 "awt/tree",
245 "awt/grid",
246 "beans",
247 "bridge",
248 "bridge/oleautomation",
249 "chart",
250 "chart2",
251 "chart2/data",
252 "configuration",
253 "configuration/backend",
254 "configuration/backend/xml",
255 "configuration/bootstrap",
256 "connection",
257 "container",
258 "cui",
259 "datatransfer",
260 "datatransfer/clipboard",
261 "datatransfer/dnd",
262 "deployment",
263 "deployment/ui",
264 "document",
265 "drawing",
266 "drawing/framework",
267 "embed",
268 "form",
269 "form/binding",
270 "form/component",
271 "form/control",
272 "form/inspection",
273 "form/runtime",
274 "form/submission",
275 "form/validation",
276 "formula",
277 "frame",
278 "frame/status",
279 "gallery",
280 "geometry",
281 "graphic",
282 "i18n",
283 "image",
284 "inspection",
285 "io",
286 "java",
287 "lang",
288 "ldap",
289 "linguistic2",
290 "loader",
291 "logging",
292 "mail",
293 "media",
294 "mozilla",
295 "packages",
296 "packages/manifest",
297 "packages/zip",
298 "plugin",
299 "presentation",
300 "reflection",
301 "registry",
302 "rendering",
303 "report",
304 "report/inspection",
305 "resource",
306 "scanner",
307 "script",
308 "script/browse",
309 "script/provider",
310 "sdb",
311 "sdb/application",
312 "sdb/tools",
313 "sdbc",
314 "sdbcx",
315 "security",
316 "sheet",
317 "smarttags",
318 "style",
319 "svg",
320 "system",
321 "table",
322 "task",
323 "text",
324 "text/fieldmaster",
325 "text/textfield",
326 "text/textfield/docinfo",
327 "ucb",
328 "ui",
329 "ui/dialogs",
330 "uno",
331 "uri",
332 "util",
333 "view",
334 "xforms",
335 "xml",
336 "xml/crypto",
337 "xml/crypto/sax",
338 "xml/csax",
339 "xml/dom",
340 "xml/dom/events",
341 "xml/dom/views",
342 "xml/input",
343 "xml/sax",
344 "xml/wrapper",
345 "xml/xpath",
346 "xsd" );
348 foreach $i (@idl_dirlist)
350 if (!check_dir("docs/common/ref/com/sun/star/$i")) {
351 $return++;
352 print "\nERROR: \"docs/common/ref/com/sun/star/$i\" is missing\n";
353 } else {
354 print "+";
357 } else {
358 $return++;
360 print "\n";
362 } else {
363 $return++;
366 if( $return != 0 )
368 print "ERROR\n";
369 } else {
370 print "OK\n";
372 exit $return;