update dev300-m58
[ooovba.git] / smoketestoo_native / check_setup.pl
blob633c42188d17a9c48d2eee56e4c7227b4bb253f0
2 eval 'exec perl -wS $0 ${1+"$@"}'
3 if 0;
4 #*************************************************************************
6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 #
8 # Copyright 2008 by Sun Microsystems, Inc.
10 # OpenOffice.org - a multi-platform office productivity suite
12 # $RCSfile: check_setup.pl,v $
14 # $Revision: 1.3 $
16 # This file is part of OpenOffice.org.
18 # OpenOffice.org is free software: you can redistribute it and/or modify
19 # it under the terms of the GNU Lesser General Public License version 3
20 # only, as published by the Free Software Foundation.
22 # OpenOffice.org is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU Lesser General Public License version 3 for more details
26 # (a copy is included in the LICENSE file that accompanied this code).
28 # You should have received a copy of the GNU Lesser General Public License
29 # version 3 along with OpenOffice.org. If not, see
30 # <http://www.openoffice.org/license.html>
31 # for a copy of the LGPLv3 License.
33 #*************************************************************************
35 sub checkLogDat {
36 my ($setuplogfile) = shift;
37 my ($errorfound) = 0;
39 open SETUPLOG, "<$setuplogfile" or die "canĀ“t open file $setuplogfile";
40 while(<SETUPLOG>) {
41 $line = $_;
42 chomp $line;
43 if ($line =~ /^ERR/ ) {
44 print "Error: $line\n";
45 $errorfound = 1;
48 close SETUPLOG;
49 return !$errorfound; #check ok?
52 $idStr = ' $Revision: 1.3 $ ';
53 $idStr =~ /Revision:\s+(\S+)\s+\$/
54 ? ($prg_rev = $1) : ($prg_rev = "-");
56 print "checkSetup -- Version: $prg_rev\n";
58 if ( ($#ARGV >-1) && ($#ARGV < 1) ) {
59 $ARGV[0]=~ s/\"//g;
62 if ( ! ( ($#ARGV >-1) && ($#ARGV < 1) && $ARGV[0] && (-e $ARGV[0] ) ) ) {
63 print "Usage: checkSetup <setuplogfile>\n" ;
64 exit(1);
67 if (checkLogDat ($ARGV[0])) {
68 exit (0);
70 else {
71 print STDERR "ERROR: setup failed\n";
72 exit (2);