From 42973da8d1acaeb0ff172434fa866b1715d3ef2e Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Fri, 21 Dec 2007 18:25:37 +0000
Subject: [PATCH] Fix for Issue 2782: New - Fail to launch upgrade CLI.

---
 opendj-sdk/opends/resource/bin/_script-util.bat |    2 +-
 opendj-sdk/opends/resource/upgrade              |    4 ++--
 opendj-sdk/opends/resource/upgrade.bat          |   13 ++++++-------
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/opendj-sdk/opends/resource/bin/_script-util.bat b/opendj-sdk/opends/resource/bin/_script-util.bat
index 89da6a2..08ff39e 100644
--- a/opendj-sdk/opends/resource/bin/_script-util.bat
+++ b/opendj-sdk/opends/resource/bin/_script-util.bat
@@ -118,7 +118,7 @@
 
 :setEnvironmentVars
 if %SET_ENVIRONMENT_VARS_DONE% == "true" goto end
-set PATH=%SystemRoot%
+set PATH=%SystemRoot%;%PATH%
 set SCRIPT_NAME_ARG=-Dorg.opends.server.scriptName=%SCRIPT_NAME%
 set SET_ENVIRONMENT_VARS_DONE=true
 goto scriptBegin
diff --git a/opendj-sdk/opends/resource/upgrade b/opendj-sdk/opends/resource/upgrade
index c615a19..9af8961 100644
--- a/opendj-sdk/opends/resource/upgrade
+++ b/opendj-sdk/opends/resource/upgrade
@@ -123,8 +123,8 @@
 then
   # Copy jars to a temporary place from which to run the reverter
   # in order to avoid potential file lock issues.
-  mkdir -p tmp/revert
-  cp -R lib tmp/revert
+  mkdir -p ${INSTANCE_ROOT}/tmp/revert
+  cp -R ${INSTANCE_ROOT}/lib ${INSTANCE_ROOT}/tmp/revert
   if test ${?} -ne 0
   then
     echo "ERROR:  Failed to initialize reversion."
diff --git a/opendj-sdk/opends/resource/upgrade.bat b/opendj-sdk/opends/resource/upgrade.bat
index 56560be..e2399b5 100644
--- a/opendj-sdk/opends/resource/upgrade.bat
+++ b/opendj-sdk/opends/resource/upgrade.bat
@@ -32,13 +32,6 @@
 
 :checkNewVersion
 if exist "upgrade.bat.NEW" goto newVersion
-goto checkOpenDSJavaBin
-
-: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
 
 set SCRIPT_NAME=upgrade
 
@@ -59,6 +52,12 @@
 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 "%INSTANCE_ROOT%\lib\setcp.bat" %%x

--
Gitblit v1.10.0