office-gobmx/solenv/bin/cwscheckapi
Rüdiger Timm 0989179f60 INTEGRATION: CWS qadev32 (1.1.2); FILE ADDED
2008/06/04 10:44:17 cn 1.1.2.10: #i85368# add possibility to check OpenOffice.org also
2008/06/01 19:41:47 cn 1.1.2.9: #i85368# some fixes
2008/05/14 07:08:28 cn 1.1.2.8: #i87389# handle LD_LIBRARY_PATH
2008/05/05 11:16:11 cn 1.1.2.7: #i85368# bugfixing, header change
2008/04/16 18:18:34 cn 1.1.2.6: #i85368# add parameter -m MODULENAMES
2008/03/24 19:09:27 cn 1.1.2.5: #i85368# enhancements
2008/03/18 21:12:28 cn 1.1.2.4: #i85368# bugfixing and help parameter
2008/03/05 14:53:04 cn 1.1.2.3: #i85368# update and fix some issues
2008/03/03 22:18:28 cn 1.1.2.2: #i85368# enhancements and updates for automatic office installation
2008/02/25 16:06:25 cn 1.1.2.1: #i85368 new scripts to execute cwscheckapi
2008-06-13 11:29:05 +00:00

187 lines
No EOL
5.6 KiB
Bash
Executable file

#!/bin/sh
#*************************************************************************
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# $RCSfile: cwscheckapi,v $
#
# $Revision: 1.2 $
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#***********************************************************************/
EXIT_SUCCESS=0
EXIT_FAILURE=1
EXIT_ERROR=2
EXIT_BUG=10
usage() {
echo "Usage: $SCRIPTNAME [-m MODULE1[,MODULEn]] [-o] [-h] [-d] [-i] [-t] [-s] [-a]" >&2
echo "" >&2
echo "[-m] list of modules to test like: '-m sw,sc,sd' or '-m all' for all modules" >&2
echo "" >&2
echo "[-o] force OpenOffice.org installation instead of StarOffice" >&2
echo "" >&2
echo "[-d] debug installation and UnoAPI-Tests" >&2
echo "" >&2
echo "[-i] debug installation" >&2
echo "" >&2
echo "[-t] debug UnoAPI-Tests" >&2
echo "" >&2
echo "[-s] skip installation of Office" >&2
echo "" >&2
echo "[-a] NoCwsAttach: do not attach UnoAPI-Test result to EIS database" >&2
echo "" >&2
echo "further informations: http://wiki.services.openoffice.org/wiki/Cwscheckapi" >&2
echo "" >&2
exit $EXIT_FAILURE
}
DEBUG_I=false
DEBUG_T=false
INSTALL=true
ATTACH=ture
MODULES="auto"
OOO=false
while getopts ':m:ditsaho' OPTION ; do
case $OPTION in
d) DEBUG_I=true
DEBUG_T=true
;;
m) MODULES="$OPTARG"
;;
o) OOO=true
;;
i) DEBUG_I=true
;;
t) DEBUG_T=true
;;
s) INSTALL=false
;;
a) ATTACH=false
;;
h) usage $EXIT_SUCCESS
;;
\?) echo "unkown option \"-$OPTARG\"." >&2
usage $EXIT_ERROR
;;
*) echo "this is not possible...">&2
usage $EXIT_BUG
;;
esac
done
shift `expr $OPTIND - 1`
DESTPATH=/tmp/$USER/cwscheckapi
LOCALINSTALLDIR=$DESTPATH/office
LOCALUNPACKDIR=$DESTPATH/unpack
export LOCALINSTALLDIR
export LOCALUNPACKDIR
date 2>&1
if [ $INSTALL = true ]; then
if [ $DEBUG_I = true ]; then
echo "start installation: `date`"
echo call "$SOLARENV/bin/installoffice.pl -cwscheckapi true -dest $LOCALINSTALLDIR -debug $DEBUG_I"
fi
perl -w $SOLARENV/bin/installoffice.pl -cwscheckapi true -dest $LOCALINSTALLDIR -ooo $OOO -debug $DEBUG_I
EXITVAL=$?
if [ $EXITVAL -ne 0 ]; then
echo "ERROR: could not install office"
exit $EXITVAL
fi
echo "`date` installation successfull, start testing...."
fi
if [ $DEBUG_T = true ]; then
echo find $LOCALINSTALLDIR -name soffice
fi
OFFICEBIN=`find $LOCALINSTALLDIR -name soffice`
if [ ! -f "$OFFICEBIN" ]; then
echo "could not find 'soffice' in subfolders of $LOCALINSTALLDIR";
exit 1
fi
JARFOLDER=$SOLARVERSION/$INPATH/bin$UPDMINOREXT
SOLVER_LIB=$SOLARVERSION/$INPATH/lib$UPDMINOREXT
myCLASSPATH=$JARFOLDER/OOoRunner.jar:$JARFOLDER/ridl.jar:$JARFOLDER/unoil.jar:$JARFOLDER/jurt.jar:$JARFOLDER/juh.jar:$JARFOLDER/java_uno.jar
myCLASSPATH=$myCLASSPATH:$JARFOLDER/ridl.jar:$JARFOLDER/unoil.jar:$JARFOLDER/jurt.jar:$JARFOLDER/juh.jar:$JARFOLDER/java_uno.jar
myCLASSPATH=$myCLASSPATH:/net/unoapi/export/unoapi/bin/mysql.jar:$SOLVER_LIB
PARAM=""
if [ -n "$JAVAI" ]; then
JAVABIN=$JAVAI
elif [ -n "$JAVA_HOME" ]; then
JAVABIN=$JAVA_HOME/bin/java
else
echo "please set environment variable JAVA_HOME"
exit 1
fi
if [ -n "$WORK_STAMP" ]; then
if [ -n "$CWS_WORK_STAMP" ]; then
PARAM="$PARAM -Version cws_${CWS_WORK_STAMP}"
else
echo "######"
echo CAUTION! You\'re working on the MWS
echo "######"
PARAM="$PARAM -Version ${WORK_STAMP}_${UPDMINOR}"
fi
fi
PARAM="$PARAM -cmd '$OFFICEBIN -norestore -nocrashreport -nolockcheck -accept=pipe,name=$USER;urp;'"
PARAM="$PARAM -cs pipe,name=$USER"
PARAM="$PARAM -NoOffice true"
PARAM="$PARAM -OOO_EnvSet setsolar"
PARAM="$PARAM -SRC_ROOT $SRC_ROOT"
PARAM="$PARAM -COMP_ENV $INPATH"
PARAM="$PARAM -Shell /usr/bin/tcsh"
PARAM="$PARAM -tb java_complex"
PARAM="$PARAM -TimeOut 90000"
PARAM="$PARAM -o complex.unoapi.CheckModuleAPI::module($MODULES)"
if [ $ATTACH = false ]; then
PARAM="$PARAM -nca true"
fi
if [ $DEBUG_T = true ]; then
PARAM="$PARAM -debug true -log true"
fi
#XDEBUG=" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8001 "
COMMAND="$JAVABIN -Xmx120m $XDEBUG -cp $myCLASSPATH org.openoffice.Runner $PARAM $*"
echo "( unset LD_LIBRARY_PATH ; $COMMAND )"
LOGFILE=$DESTPATH/cwscheckapi.log
( unset LD_LIBRARY_PATH ; $COMMAND | tee $LOGFILE)
echo
echo A logfile could be found here: $LOGFILE
date 2>&1