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.
| | |
| | | # 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 |
| | |
| | | |
| | | :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 |
| | | |
| | |
| | | |
| | | # 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 |
| | |
| | | |
| | | :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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | 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 |
| | | |
| | |
| | | "%JAVA_BIN%" org.opends.quicksetup.upgrader.UpgradeLauncher %* |
| | | goto end |
| | | |
| | | :version |
| | | rem version information was requested. Return code should be 0. |
| | | exit /B 0 |
| | | |
| | | :end |
| | |
| | | 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; |
| | | } |
| | |
| | | if (shouldPrintVersion()) |
| | | { |
| | | printVersion(); |
| | | System.exit(QuickSetupCli.SUCCESSFUL); |
| | | System.exit(QuickSetupCli.PRINT_VERSION); |
| | | } |
| | | else if (shouldPrintUsage()) { |
| | | printUsage(false); |
| | |
| | | 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; |