From b9e59589a9d91c6cb520c70e5d51bddccbc3431b Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Thu, 09 Feb 2012 15:18:38 +0000
Subject: [PATCH] Fix for OPENDJ-132: upgrade utility does not accept relative path. Contribution from German Parente (thanks)

---
 opends/resource/bin/stop-ds.bat        |    4 ++--
 opends/resource/bin/_server-script.bat |    4 ++--
 opends/resource/uninstall.bat          |    4 ++--
 opends/resource/bin/_mixed-script.bat  |    4 ++--
 opends/resource/bin/_script-util.bat   |    4 ++--
 opends/resource/bin/control-panel.bat  |    4 ++--
 opends/resource/bin/make-ldif.bat      |   14 +++++---------
 opends/resource/bin/_client-script.bat |    4 ++--
 opends/resource/bin/start-ds.bat       |    4 ++--
 opends/resource/upgrade.bat            |    4 ++--
 opends/resource/setup.bat              |    4 ++--
 11 files changed, 25 insertions(+), 29 deletions(-)

diff --git a/opends/resource/bin/_client-script.bat b/opends/resource/bin/_client-script.bat
index 9d1e724..00505cd 100644
--- a/opends/resource/bin/_client-script.bat
+++ b/opends/resource/bin/_client-script.bat
@@ -24,7 +24,7 @@
 rem
 rem
 rem      Copyright 2006-2010 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 rem This script is used to invoke various client-side processes.  It should not
 rem be invoked directly by end users.
@@ -37,7 +37,7 @@
 for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd /d %INSTALL_ROOT%
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/bin/_mixed-script.bat b/opends/resource/bin/_mixed-script.bat
index 80264a8..5ca00af 100644
--- a/opends/resource/bin/_mixed-script.bat
+++ b/opends/resource/bin/_mixed-script.bat
@@ -24,7 +24,7 @@
 rem
 rem
 rem      Copyright 2006-2010 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 rem This script is used to invoke various server-side processes.  It should not
 rem be invoked directly by end users.
@@ -37,7 +37,7 @@
 for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd /d %INSTALL_ROOT%
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/bin/_script-util.bat b/opends/resource/bin/_script-util.bat
index e1dd5aa..e5a8835 100644
--- a/opends/resource/bin/_script-util.bat
+++ b/opends/resource/bin/_script-util.bat
@@ -23,7 +23,7 @@
 rem
 rem
 rem      Copyright 2008-2010 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 set SET_JAVA_HOME_AND_ARGS_DONE=false
 set SET_ENVIRONMENT_VARS_DONE=false
@@ -48,7 +48,7 @@
 for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd /d %INSTALL_ROOT%
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/bin/_server-script.bat b/opends/resource/bin/_server-script.bat
index 47d8901..6805cc8 100644
--- a/opends/resource/bin/_server-script.bat
+++ b/opends/resource/bin/_server-script.bat
@@ -24,7 +24,7 @@
 rem
 rem
 rem      Copyright 2006-2010 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 rem This script is used to invoke various server-side processes.  It should not
 rem be invoked directly by end users.
@@ -37,7 +37,7 @@
 for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd %INSTALL_ROOT%
 cd %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/bin/control-panel.bat b/opends/resource/bin/control-panel.bat
index 4a28c5b..4606310 100644
--- a/opends/resource/bin/control-panel.bat
+++ b/opends/resource/bin/control-panel.bat
@@ -24,7 +24,7 @@
 rem
 rem
 rem      Copyright 2006-2009 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 setlocal
 for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
@@ -34,7 +34,7 @@
 for /f "delims=" %%a in (%DIR_HOME%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd /d %INSTALL_ROOT%
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/bin/make-ldif.bat b/opends/resource/bin/make-ldif.bat
index e72bc81..9e70fea 100644
--- a/opends/resource/bin/make-ldif.bat
+++ b/opends/resource/bin/make-ldif.bat
@@ -24,28 +24,24 @@
 rem
 rem
 rem      Copyright 2006-2009 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 setlocal
 
 for %%i in (%~sf0) do set NON_ESCAPED=%%~dPsi..
 
-
 FOR /F "tokens=1-2* delims=%%" %%1 IN ("%NON_ESCAPED%") DO (
 if NOT "%%2" == "" goto invalidPath)
 
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.
-
-set CUR_DIR=%~dp0
-cd /d %DIR_HOME%\..
-set INSTALL_ROOT=%CD%
-cd /d %CUR_DIR%
+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=%~dp0
+
+set CUR_DIR=%CD%
 cd /d %INSTALL_ROOT%
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/bin/start-ds.bat b/opends/resource/bin/start-ds.bat
index 91b07f6..dcb9495 100644
--- a/opends/resource/bin/start-ds.bat
+++ b/opends/resource/bin/start-ds.bat
@@ -24,7 +24,7 @@
 rem
 rem
 rem      Copyright 2006-2010 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 setlocal
 for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
@@ -34,7 +34,7 @@
 for /f "delims=" %%a in (%DIR_HOME%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd /d %INSTALL_ROOT%
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/bin/stop-ds.bat b/opends/resource/bin/stop-ds.bat
index 4aeaedb..b434b9d 100644
--- a/opends/resource/bin/stop-ds.bat
+++ b/opends/resource/bin/stop-ds.bat
@@ -24,7 +24,7 @@
 rem
 rem
 rem      Copyright 2006-2010 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 setlocal
 
@@ -45,7 +45,7 @@
 for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd /d%INSTALL_ROOT%
 cd /d%INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/setup.bat b/opends/resource/setup.bat
index 30a5c1c..5338019 100644
--- a/opends/resource/setup.bat
+++ b/opends/resource/setup.bat
@@ -24,7 +24,7 @@
 rem
 rem
 rem      Copyright 2006-2010 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 setlocal
 
@@ -43,7 +43,7 @@
 for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd /d %INSTALL_ROOT%
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/uninstall.bat b/opends/resource/uninstall.bat
index 11d44ab..9c4cda6 100644
--- a/opends/resource/uninstall.bat
+++ b/opends/resource/uninstall.bat
@@ -24,7 +24,7 @@
 rem
 rem
 rem      Copyright 2006-2010 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 setlocal
 for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.
@@ -34,7 +34,7 @@
 for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd /d %INSTALL_ROOT%
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
diff --git a/opends/resource/upgrade.bat b/opends/resource/upgrade.bat
index d46e647..df37efb 100644
--- a/opends/resource/upgrade.bat
+++ b/opends/resource/upgrade.bat
@@ -24,7 +24,7 @@
 rem
 rem
 rem      Copyright 2006-2008 Sun Microsystems, Inc.
-rem      Portions Copyright 2011 ForgeRock AS
+rem      Portions Copyright 2011-2012 ForgeRock AS
 
 setlocal
 for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.
@@ -34,7 +34,7 @@
 for /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
   set INSTANCE_DIR=%%a
 )
-set CUR_DIR=%~dp0
+set CUR_DIR=%CD%
 cd /d %INSTALL_ROOT%
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%

--
Gitblit v1.10.0