upgrade.bat revision 3007
0N/A
0N/A@echo off
0N/Arem CDDL HEADER START
0N/Arem
0N/Arem The contents of this file are subject to the terms of the
0N/Arem Common Development and Distribution License, Version 1.0 only
0N/Arem (the "License"). You may not use this file except in compliance
0N/Arem with the License.
0N/Arem
0N/Arem You can obtain a copy of the license at
0N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/Arem or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/Arem See the License for the specific language governing permissions
0N/Arem and limitations under the License.
0N/Arem
0N/Arem When distributing Covered Code, include this CDDL HEADER in each
0N/Arem file and include the License file at
873N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
0N/Arem add the following below this CDDL HEADER, with the fields enclosed
0N/Arem by brackets "[]" replaced with your own identifying information:
0N/Arem Portions Copyright [yyyy] [name of copyright owner]
0N/Arem
0N/Arem CDDL HEADER END
733N/Arem
0N/Arem
0N/Arem Portions Copyright 2006-2007 Sun Microsystems, Inc.
0N/A
0N/Asetlocal
0N/Afor %%i in (%~sf0) do set DIR_HOME=%%~dPsi.
0N/A
0N/Aset INSTANCE_ROOT=%DIR_HOME%
0N/A
0N/A:checkNewVersion
0N/Aif exist "upgrade.bat.NEW" goto newVersion
0N/A
0N/Aset SCRIPT_NAME=upgrade
0N/A
0N/Arem Set environment variables and test java
0N/Aset SCRIPT_UTIL_CMD=set-full-environment-and-test-java
0N/Acall "%INSTANCE_ROOT%\lib\_script-util.bat"
0N/Aif NOT %errorlevel% == 0 exit /B %errorlevel%
0N/A
0N/A:callExtractor
0N/Aif EXIST "%INSTANCE_ROOT%\tmp\upgrade" rd "%INSTANCE_ROOT%\tmp\upgrade" /s /q
0N/Aset CLASSPATH=""
0N/AFOR %%x in ("%INSTANCE_ROOT%\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x
0N/Aset CLASSPATH=%DIR_HOME%\classes;%CLASSPATH%
0N/A"%OPENDS_JAVA_BIN%" %SCRIPT_NAME_ARG% org.opends.quicksetup.upgrader.BuildExtractor %*
0N/Aif %errorlevel% == 99 goto upgrader
0N/Aif %errorlevel% == 98 goto reverter
0N/Aif %errorlevel% == 50 goto version
0N/Aif %errorlevel% == 0 goto end
0N/Agoto error
0N/A
0N/A:newVersion
0N/Aecho A new version of this script was made available by the last upgrade
0N/Aecho operation. Delete this old version and rename file 'upgrade.bat.NEW'
0N/Aecho to 'upgrade.bat' before continuing.
0N/Agoto end
0N/A
0N/A:upgrader
0N/Aset CLASSPATH=""
0N/AFOR %%x in ("%INSTANCE_ROOT%\tmp\upgrade\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x
0N/A"%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.upgrader.UpgradeLauncher %*
0N/Agoto end
0N/A
0N/A:reverter
0N/Aif EXIST "%INSTANCE_ROOT%\tmp\revert" rd "%INSTANCE_ROOT%\tmp\revert" /s /q
0N/Axcopy "%INSTANCE_ROOT%\lib\*.*" "%INSTANCE_ROOT%\tmp\revert\lib\" /E /Q /Y
0N/Aset CLASSPATH=""
0N/AFOR %%x in ("%INSTANCE_ROOT%\tmp\revert\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x
0N/A"%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.quicksetup.upgrader.ReversionLauncher %*
0N/Agoto end
0N/A
0N/A:version
0N/Arem version information was requested. Return code should be 0.
0N/Aexit /B 0
0N/A
0N/A:error
0N/Aexit /B 101
0N/A
0N/A:end
0N/A