Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / sysui / util / checksize.pl
blobda4104b29a9582aa70817edc0f4b2277b2461b44
2 eval 'exec perl -wS $0 ${1+"$@"}'
3 if 0;
5 # This file is part of the LibreOffice project.
7 # This Source Code Form is subject to the terms of the Mozilla Public
8 # License, v. 2.0. If a copy of the MPL was not distributed with this
9 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 # This file incorporates work covered by the following license notice:
13 # Licensed to the Apache Software Foundation (ASF) under one or more
14 # contributor license agreements. See the NOTICE file distributed
15 # with this work for additional information regarding copyright
16 # ownership. The ASF licenses this file to you under the Apache
17 # License, Version 2.0 (the "License"); you may not use this file
18 # except in compliance with the License. You may obtain a copy of
19 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
26 $is_debug=0;
27 my $err = 0;
28 my $path = "../" . $ENV{'INPATH'} . "/";
30 #Path of the directory from which the recursion starts (must have ending '/').
31 print "Checking:$path\n";
32 # Initiate the recursion
33 &RecurseDirs($path);
34 if ($err > 0)
36 print "Error: $err damaged files encountered\n";
37 exit(1); # stop dmake
38 } else
40 print "ok.\n";
42 exit;
44 #### SUBROUTINES SECTION ####
46 # Function that recurses through the directory tree calling FileFunction on all files
47 sub RecurseDirs {
48 my ($path) = @_;
49 my $file; #Variable for a file
51 opendir (DIRECTORY, $path) or
52 die "Error: Can't read $path\n";
53 my @all_files = grep (!/^\.\.?$/, readdir (DIRECTORY)); #Read all the files except for '.' and '..'
54 closedir (DIRECTORY);
56 foreach $file (@all_files) {
57 if (-d "$path$file/") {
58 &RecurseDirs("$path$file/");
59 } else {
60 &check($path, $file);
65 ############################################################################
66 sub check #04.02.2005 13:40
67 ############################################################################
69 my $path = shift;
70 my $file = shift;
71 print "$path$file\n" if ((-e "$path$file") && $is_debug);
72 # don't check dpc,flag,rpmflag,sdf [obj for UNX] files, or etc subdirectory
73 return if ( ($file =~ /.+\.(dpc|\w*?flag)/) || ($file =~ /.+\.obj/ && $ENV{GUI} eq 'UNX') || ($path =~ /.+etc/) || ($path =~ /.+logs/) || ($file =~ /.+sdf/) );
74 if ( -z "$path$file" ) {
75 print "Error: $path$file 0 Bytes!\n";
76 $err++;