mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

lutoff
10.00.2007 d805a36cc67fa38d11eda2f09f661ba21c6add70
fix for issue #1865 (upgrade -V error)
In case on -V option, BuildExtractor will exit with a pre-defined return code defined in QuickSetupCli.java (let's say 50). Script will test this specific return value to check if the non-null return code is an error. In case of none null return code, the upgradeLauncher will not be called.
8 files modified
54 ■■■■■ changed files
opends/resource/setup 9 ●●●●● patch | view | raw | blame | history
opends/resource/setup.bat 7 ●●●●● patch | view | raw | blame | history
opends/resource/uninstall 9 ●●●●● patch | view | raw | blame | history
opends/resource/uninstall.bat 7 ●●●●● patch | view | raw | blame | history
opends/resource/upgrade 7 ●●●● patch | view | raw | blame | history
opends/resource/upgrade.bat 5 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/Launcher.java 5 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/QuickSetupCli.java 5 ●●●●● patch | view | raw | blame | history
opends/resource/setup
@@ -120,3 +120,12 @@
# Launch the setup process.
"${JAVA_BIN}" org.opends.quicksetup.installer.InstallLauncher -P setup "${@}"
# return part
RETURN_CODE=$?
if test ${RETURN_CODE} -eq 50
then
  # Version info was on requested
  exit 0
else
  exit ${RETURN_CODE}
fi
opends/resource/setup.bat
@@ -77,7 +77,14 @@
:callJava
"%JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.installer.InstallLauncher -P setup.bat %*
rem return part
if %errorlevel% == 50 goto version
goto end
:version
rem version information was requested. Return code should be 0.
exit /B 0
:end
opends/resource/uninstall
@@ -118,3 +118,12 @@
# Launch the uninstall process.
"${JAVA_BIN}" org.opends.quicksetup.uninstaller.UninstallLauncher "${@}"
RETURN_CODE=$?
if test ${RETURN_CODE} -eq 50
then
  # Version info was on requested
  exit 0
else
  exit ${RETURN_CODE}
fi
opends/resource/uninstall.bat
@@ -77,6 +77,13 @@
:callJava
"%JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.uninstaller.UninstallLauncher %*
rem return part
if %errorlevel% == 50 goto version
goto end
:version
rem version information was requested. Return code should be 0.
exit /B 0
:end
opends/resource/upgrade
@@ -136,7 +136,8 @@
done
export CLASSPATH
"${JAVA_BIN}" org.opends.quicksetup.upgrader.BuildExtractor "${@}"
if test $? -eq 0
RETURN_CODE=$?
if test ${RETURN_CODE} -eq 0
then
  # Configure the appropriate CLASSPATH.
  # Unlike BuildExtractor, the Upgrader uses
@@ -148,6 +149,10 @@
  done
  # Launch the upgrade process.
  "${JAVA_BIN}" org.opends.quicksetup.upgrader.UpgradeLauncher "${@}"
elif test ${RETURN_CODE} -eq 50
then
  # Version info was on requested
  exit 0
else
  exit 101
fi
opends/resource/upgrade.bat
@@ -70,6 +70,7 @@
FOR %%x in ("%INSTANCE_ROOT%\lib\*.jar") DO call "%INSTANCE_ROOT%\lib\setcp.bat" %%x
set CLASSPATH=%DIR_HOME%\classes;%CLASSPATH%
"%JAVA_BIN%" org.opends.quicksetup.upgrader.BuildExtractor %*
if %errorlevel% == 50 goto version
if not %errorlevel% == 0 goto end
goto upgrader
@@ -79,4 +80,8 @@
"%JAVA_BIN%" org.opends.quicksetup.upgrader.UpgradeLauncher %*
goto end
:version
rem version information was requested. Return code should be 0.
exit /B 0
:end
opends/src/quicksetup/org/opends/quicksetup/Launcher.java
@@ -70,7 +70,8 @@
    boolean printUsage = false;
    if ((args != null) && (args.length > 0)) {
      for (String arg : args) {
        if (arg.equalsIgnoreCase("-H") ||
        if (arg.equals("-?") ||
          arg.equalsIgnoreCase("-H") ||
          arg.equalsIgnoreCase("--help")) {
          printUsage = true;
        }
@@ -310,7 +311,7 @@
    if (shouldPrintVersion())
    {
      printVersion();
      System.exit(QuickSetupCli.SUCCESSFUL);
      System.exit(QuickSetupCli.PRINT_VERSION);
    }
    else if (shouldPrintUsage()) {
      printUsage(false);
opends/src/quicksetup/org/opends/quicksetup/QuickSetupCli.java
@@ -70,6 +70,11 @@
  static public int BUG = 5;
  /**
   * Return code: Bug.
   */
  static public int PRINT_VERSION = 50;
  /**
   * Return code for errors that are non-specified.
   */
  static public int UNKNOWN = 100;