From 882e51b3ada821426c91aabc085d21e3fe2e0b03 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Tue, 04 Mar 2014 09:55:16 +0000
Subject: [PATCH] Backport CR-3127 OPENDJ-1098 – Upgrading must disable old patches

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

diff --git a/opends/resource/upgrade.bat b/opends/resource/upgrade.bat
index 8bb51e8..72e019d 100644
--- a/opends/resource/upgrade.bat
+++ b/opends/resource/upgrade.bat
@@ -22,11 +22,25 @@
 rem CDDL HEADER END
 rem
 rem
-rem      Copyright 2013 ForgeRock AS
+rem      Copyright 2013-2014 ForgeRock AS
 
 setlocal
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.upgrade.UpgradeCli"
 set SCRIPT_NAME=upgrade
+
+set DIR_CLASSES="classes"
+rem The upgrade is not compatible with patches. If the folder is not empty
+rem we renamed it as "classes.disabled", and the upgrade process should be launched properly.
+IF EXIST "%DIR_CLASSES%" (
+  for /F %%i in ('dir /b %DIR_CLASSES%\*.*') do goto renamePatchesFolder 
+)
+goto end
+
+:renamePatchesFolder
+rename %DIR_CLASSES% "classes.disabled"
+mkdir %DIR_CLASSES%
+
+:end
 for %%i in (%~sf0) do call "%%~dPsi\lib\_server-script.bat" %*
 

--
Gitblit v1.10.0