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