From 724dc38dfdca4df6b5426d1feba964aa3892a417 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Thu, 20 Sep 2007 19:31:21 +0000
Subject: [PATCH] Fix for issue 2227 in which unpredictable behavior results from an upgrade or reversion process replacing the upgrade script while the upgrade process is running on Windows.  This code will compare the running version of the script with the new version to see whether or not the script actually needs replacing.  If so the script is copied with an extension NEW.  When the script starts it checks for the existence of upgrade.bat.NEW and if exists prints a message informing the user that they must replace the old version of the script with the new version before continuing.

---
 opends/resource/upgrade.bat |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/opends/resource/upgrade.bat b/opends/resource/upgrade.bat
index 36908c5..a585001 100644
--- a/opends/resource/upgrade.bat
+++ b/opends/resource/upgrade.bat
@@ -30,6 +30,16 @@
 
 set INSTANCE_ROOT=%DIR_HOME%
 
+:checkNewVersion
+if exist "upgrade.bat.NEW" goto newVersion
+goto checkJavaBin
+
+: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
+
 :checkJavaBin
 if "%JAVA_BIN%" == "" goto noJavaBin
 goto callExtractor

--
Gitblit v1.10.0