2 eval 'exec perl -wS $0 ${1+"$@"}'
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 .
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
36 print "Error: $err damaged files encountered\n";
44 #### SUBROUTINES SECTION ####
46 # Function that recurses through the directory tree calling FileFunction on all files
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 '..'
56 foreach $file (@all_files) {
57 if (-d
"$path$file/") {
58 &RecurseDirs
("$path$file/");
65 ############################################################################
66 sub check
#04.02.2005 13:40
67 ############################################################################
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";