From 2e08d2c0e9bede644be993ddaa28157c9f156c10 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Tue, 07 May 2013 13:50:59 +0000
Subject: [PATCH] svn merge https://svn.forgerock.org/opendj/trunk/opends@8851 https://svn.forgerock.org/opendj/branches/native-packaging@8851 .

---
 opends/resource/upgrade.bat |   65 +-------------------------------
 1 files changed, 3 insertions(+), 62 deletions(-)

diff --git a/opends/resource/upgrade.bat b/opends/resource/upgrade.bat
index df37efb..31074ec 100644
--- a/opends/resource/upgrade.bat
+++ b/opends/resource/upgrade.bat
@@ -23,70 +23,11 @@
 rem CDDL HEADER END
 rem
 rem
-rem      Copyright 2006-2008 Sun Microsystems, Inc.
-rem      Portions Copyright 2011-2012 ForgeRock AS
+rem      Copyright 2013 ForgeRock AS
 
 setlocal
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.
 
-set INSTALL_ROOT=%DIR_HOME%
-set INSTANCE_DIR=
-for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
-  set INSTANCE_DIR=%%a
-)
-set CUR_DIR=%CD%
-cd /d %INSTALL_ROOT%
-cd /d %INSTANCE_DIR%
-set INSTANCE_ROOT=%CD%
-cd /d %CUR_DIR%
-
-:checkNewVersion
-if exist "upgrade.bat.NEW" goto newVersion
-
+set OPENDJ_INVOKE_CLASS="org.opends.server.tools.upgrade.UpgradeCli"
 set SCRIPT_NAME=upgrade
+for %%i in (%~sf0) do call "%%~dPsi\lib\_server-script.bat" %*
 
-rem Set environment variables and test java
-set SCRIPT_UTIL_CMD=set-full-environment-and-test-java
-call "%INSTALL_ROOT%\lib\_script-util.bat"
-if NOT %errorlevel% == 0 exit /B %errorlevel%
-
-:callExtractor
-if EXIST "%INSTANCE_ROOT%\tmp\upgrade" rd "%INSTANCE_ROOT%\tmp\upgrade" /s /q
-set CLASSPATH=""
-FOR %%x in ("%INSTALL_ROOT%\lib\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x
-set CLASSPATH=%INSTANCE_ROOT%\classes;%CLASSPATH%
-"%OPENDJ_JAVA_BIN%" %SCRIPT_NAME_ARG% org.opends.quicksetup.upgrader.BuildExtractor %*
-if %errorlevel% == 99 goto upgrader
-if %errorlevel% == 98 goto reverter
-if %errorlevel% == 50 goto version
-if %errorlevel% == 0 goto end
-goto error
-
-:newVersion
-echo A new version of this script was made available by the last upgrade
-echo operation.  Delete this old version and rename file 'upgrade.bat.NEW'
-echo to 'upgrade.bat' before continuing.
-goto end
-
-:upgrader
-set CLASSPATH=""
-FOR %%x in ("%INSTANCE_ROOT%\tmp\upgrade\lib\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x
-"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% %SCRIPT_NAME_ARG% -DINSTALL_ROOT=%INSTALL_ROOT% org.opends.quicksetup.upgrader.UpgradeLauncher %*
-goto end
-
-:reverter
-if EXIST "%INSTANCE_ROOT%\tmp\revert" rd "%INSTANCE_ROOT%\tmp\revert" /s /q
-xcopy "%INSTALL_ROOT%\lib\*.*" "%INSTANCE_ROOT%\tmp\revert\lib\" /E /Q /Y
-set CLASSPATH=""
-FOR %%x in ("%INSTANCE_ROOT%\tmp\revert\lib\*.jar") DO call "%INSTALL_ROOT%\lib\setcp.bat" %%x
-"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% %SCRIPT_NAME_ARG% -DINSTALL_ROOT=%INSTALL_ROOT% org.opends.quicksetup.upgrader.ReversionLauncher %*
-goto end
-
-:version
-rem version information was requested. Return code should be 0.
-exit /B 0
-
-:error
-exit /B 101
-
-:end

--
Gitblit v1.10.0