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

jvergara
19.40.2007 ea9b9e87abcf36995a52d271ae34e792653fd696
After some discussions it has been decided to merge the setup and uninstall commands so that we have the behavior that we had before.  So with this changes, in order to work in CLI mode the option --cli must be specified. 
5 files deleted
1 files renamed
18 files modified
699 ■■■■ changed files
opends/build.xml 10 ●●●●● patch | view | raw | blame | history
opends/resource/setup 2 ●●● patch | view | raw | blame | history
opends/resource/setup-gui 131 ●●●●● patch | view | raw | blame | history
opends/resource/setup-gui.bat 89 ●●●●● patch | view | raw | blame | history
opends/resource/setup.bat 10 ●●●●● patch | view | raw | blame | history
opends/resource/uninstall 2 ●●● patch | view | raw | blame | history
opends/resource/uninstall-gui 37 ●●●●● patch | view | raw | blame | history
opends/resource/uninstall-gui.bat 90 ●●●●● patch | view | raw | blame | history
opends/resource/uninstall.bat 10 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/uninstaller/UninstallGuiLauncher.java 178 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/uninstaller/UninstallLauncher.java 7 ●●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/uninstaller/UninstallerArgumentParser.java 7 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/admin_tool.properties 5 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/quicksetup.properties 5 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/tools.properties 4 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/Installation.java 21 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/Launcher.java 4 ●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java 4 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/SetupLauncher.java 60 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java 4 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/InstallDSArgumentParser.java 10 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/ToolConstants.java 5 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/functions/dsadm.xml 1 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/quicksetup/TestUtilities.java 3 ●●●● patch | view | raw | blame | history
opends/build.xml
@@ -863,15 +863,13 @@
      <fileset file="${resource.dir}/README" />
    </copy>
    <fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup,setup-gui,uninstall,uninstall-gui,upgrade"
    <fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup,uninstall,upgrade"
         eol="lf" />
    <fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup.bat,setup-gui.bat,uninstall.bat,uninstall-gui.bat,upgrade.bat"
    <fixcrlf srcDir="${resource.dir}" destDir="${pdir}" includes="setup.bat,uninstall.bat,upgrade.bat"
         eol="crlf" />
    <chmod file="${pdir}/setup" perm="755" />
    <chmod file="${pdir}/setup-gui" perm="755" />
    <chmod file="${pdir}/uninstall" perm="755" />
    <chmod file="${pdir}/uninstall-gui" perm="755" />
    <chmod file="${pdir}/upgrade" perm="755" />
    <chmod perm="755">
      <fileset dir="${pdir}/bin">
@@ -889,7 +887,7 @@
       description="Package the Directory Server for distribution.">
    <zip destfile="${package.dir}/${SHORT_NAME}-${VERSION_NUMBER_STRING}.zip">
      <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/**/*"
           excludes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/bin/*,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_client-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_server-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/setup,${SHORT_NAME}-${VERSION_NUMBER_STRING}/setup-gui,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall-gui,${SHORT_NAME}-${VERSION_NUMBER_STRING}/upgrade"
           excludes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/bin/*,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_client-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_server-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/setup,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall,${SHORT_NAME}-${VERSION_NUMBER_STRING}/upgrade"
           filemode="644" dirmode="755" />
      <zipfileset dir="${package.dir}"
           includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_client-script.sh,${SHORT_NAME}-${VERSION_NUMBER_STRING}/lib/_server-script.sh"
@@ -899,7 +897,7 @@
           filemode="755" dirmode="755" />
      <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/bin/README_WINDOWS.txt"
           filemode="644" dirmode="755" />
      <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/setup,${SHORT_NAME}-${VERSION_NUMBER_STRING}/setup-gui,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall-gui,${SHORT_NAME}-${VERSION_NUMBER_STRING}/upgrade"
      <zipfileset dir="${package.dir}" includes="${SHORT_NAME}-${VERSION_NUMBER_STRING}/setup,${SHORT_NAME}-${VERSION_NUMBER_STRING}/uninstall,${SHORT_NAME}-${VERSION_NUMBER_STRING}/upgrade"
           filemode="755" dirmode="755" />
    </zip>
    <property name="package.built" value="true"/>
opends/resource/setup
@@ -118,7 +118,7 @@
# Launch the setup process.
"${JAVA_BIN}" -Dorg.opends.server.scriptName=setup org.opends.server.tools.InstallDS "${@}"
"${JAVA_BIN}" -Dorg.opends.server.scriptName=setup org.opends.quicksetup.installer.SetupLauncher "${@}"
# return part
RETURN_CODE=$?
opends/resource/setup-gui
File was deleted
opends/resource/setup-gui.bat
File was deleted
opends/resource/setup.bat
@@ -84,7 +84,15 @@
"%JAVA_BIN%" org.opends.server.tools.InstallDS -t > NUL 2>&1
if not %errorlevel% == 0 goto noValidJavaHome
"%JAVA_BIN%" %JAVA_ARGS% -Dorg.opends.server.scriptName=setup.bat org.opends.server.tools.InstallDS %*
if "%~1" == "" goto callLaunch
goto callJava
:callLaunch
"%DIR_HOME%\lib\winlauncher.exe" launch "%JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.installer.SetupLauncher
goto end
:callJava
"%JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.installer.SetupLauncher %*
rem return part
if %errorlevel% == 50 goto version
opends/resource/uninstall
@@ -26,7 +26,7 @@
#      Portions Copyright 2006-2007 Sun Microsystems, Inc.
# This script may be used to display the status panel.
# This script may be used to uninstall the server.
OPENDS_INVOKE_CLASS="org.opends.guitools.uninstaller.UninstallLauncher"
export OPENDS_INVOKE_CLASS
opends/resource/uninstall-gui
File was deleted
opends/resource/uninstall-gui.bat
File was deleted
opends/resource/uninstall.bat
@@ -68,7 +68,15 @@
"%JAVA_BIN%" org.opends.server.tools.InstallDS -t > NUL 2>&1
if not %errorlevel% == 0 goto noValidJavaHome
set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=uninstall.bat"
if "%~1" == "" goto callLaunch
goto callJava
:callLaunch
"%DIR_HOME%\lib\winlauncher.exe" launch "%JAVA_BIN%" %JAVA_ARGS% org.opends.guitools.uninstaller.UninstallLauncher
goto end
:callJava
set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=uninstall"
"%JAVA_BIN%" %JAVA_ARGS% org.opends.guitools.uninstaller.UninstallLauncher %*
rem return part
opends/src/guitools/org/opends/guitools/uninstaller/UninstallGuiLauncher.java
File was deleted
opends/src/guitools/org/opends/guitools/uninstaller/UninstallLauncher.java
@@ -123,13 +123,6 @@
  /**
   * {@inheritDoc}
   */
  protected boolean isCli() {
    return true;
  }
  /**
   * {@inheritDoc}
   */
  protected void guiLaunchFailed(String logFilePath) {
    if (logFilePath != null)
    {
opends/src/guitools/org/opends/guitools/uninstaller/UninstallerArgumentParser.java
@@ -53,6 +53,7 @@
 */
public class UninstallerArgumentParser extends SecureConnectionCliParser
{
  private BooleanArgument cliArg;
  private BooleanArgument noPromptArg;
  BooleanArgument forceOnErrorArg;
  private BooleanArgument quietArg;
@@ -103,6 +104,12 @@
  throws ArgumentException
  {
    LinkedHashSet<Argument> args = new LinkedHashSet<Argument>();
    cliArg = new BooleanArgument(
        OPTION_LONG_CLI,
        OPTION_SHORT_CLI,
        OPTION_LONG_CLI,
        INFO_UNINSTALLDS_DESCRIPTION_CLI.get());
    args.add(cliArg);
    removeAllArg = new BooleanArgument(
        "remove-all",
        'a',
opends/src/messages/messages/admin_tool.properties
@@ -338,9 +338,10 @@
INFO_SUMMARY_UNINSTALL_NOT_STARTED=Starting Uninstallation...
INFO_UNDEFINED_PROTOCOL_LABEL=-Unknown-
SEVERE_ERR_UNINSTALL_LAUNCHER_GUI_LAUNCHED_FAILED=%n%nThe graphical Uninstall \
 launch failed.
 launch failed.%n%nLaunching command line uninstall...
SEVERE_ERR_UNINSTALL_LAUNCHER_GUI_LAUNCHED_FAILED_DETAILS=%n%nThe graphical \
 Uninstall launch failed.  Check file %s for more details.
 Uninstall launch failed.  Check file %s for more details.%n%nLaunching \
 command line uninstall...
INFO_UNINSTALL_LAUNCHER_LAUNCHING_CLI=Launching command line uninstall...
INFO_UNINSTALL_LAUNCHER_LAUNCHING_GUI=Launching graphical uninstall...
INFO_UNINSTALL_LAUNCHER_USAGE_DESCRIPTION=This utility may be used to \
opends/src/messages/messages/quicksetup.properties
@@ -835,9 +835,10 @@
INFO_SERVER_SETTINGS_PANEL_TITLE=Server Settings
INFO_SERVER_SETTINGS_STEP=Server Settings
INFO_SETUP_LAUNCHER_GUI_LAUNCHED_FAILED=%n%nThe graphical Setup launch \
 failed.
 failed.%n%nLaunching command line setup...
INFO_SETUP_LAUNCHER_GUI_LAUNCHED_FAILED_DETAILS=%n%nThe graphical Setup \
 launch failed.  Check file %s for more details.
 launch failed.  Check file %s for more details.%n%nLaunching command line \
 setup...
INFO_SETUP_LAUNCHER_LAUNCHING_GUI=Launching graphical setup...
INFO_SETUP_LAUNCHER_USAGE_DESCRIPTION=This utility may be used to setup the \
 Directory Server.
opends/src/messages/messages/tools.properties
@@ -903,8 +903,8 @@
INFO_INSTALLDS_PROMPT_ROOT_DN_512=What would you like to use as the initial \
 root user DN for the Directory Server?
SEVERE_ERR_INSTALLDS_NO_ROOT_PASSWORD_513=ERROR:  No password was provided \
 for the initial root user.  When performing a quiet installation, this must \
 be provided using either the %s or the %s argument
 for the initial root user.  When performing a non-interactive installation, \
 this must be provided using either the %s or the %s argument
INFO_INSTALLDS_PROMPT_ROOT_PASSWORD_514=Please provide the password to use \
 for the initial root user:
INFO_INSTALLDS_PROMPT_CONFIRM_ROOT_PASSWORD_515=Please re-enter the password \
opends/src/quicksetup/org/opends/quicksetup/Installation.java
@@ -139,16 +139,6 @@
  public static final String WINDOWS_SETUP_FILE_NAME = "setup.bat";
  /**
   * The UNIX GUI setup script file name.
   */
  public static final String UNIX_SETUP_GUI_FILE_NAME = "setup-gui";
  /**
   * The Windows GUI setup batch file name.
   */
  public static final String WINDOWS_SETUP_GUI_FILE_NAME = "setup-gui.bat";
  /**
   * The UNIX uninstall script file name.
   */
  public static final String UNIX_UNINSTALL_FILE_NAME = "uninstall";
@@ -159,17 +149,6 @@
  public static final String WINDOWS_UNINSTALL_FILE_NAME = "uninstall.bat";
  /**
   * The UNIX uninstall script file name.
   */
  public static final String UNIX_UNINSTALL_GUI_FILE_NAME = "uninstall-gui";
  /**
   * The Windows uninstall batch file name.
   */
  public static final String WINDOWS_UNINSTALL_GUI_FILE_NAME =
    "uninstall-gui.bat";
  /**
   * The UNIX upgrade script file name.
   */
  public static final String UNIX_UPGRADE_FILE_NAME = "upgrade";
opends/src/quicksetup/org/opends/quicksetup/Launcher.java
@@ -31,6 +31,7 @@
import org.opends.server.util.args.ArgumentParser;
import static org.opends.messages.QuickSetupMessages.*;
import static org.opends.server.tools.ToolConstants.*;
import static org.opends.server.util.DynamicConstants.PRINTABLE_VERSION_STRING;
import org.opends.quicksetup.util.Utils;
@@ -171,7 +172,8 @@
  protected boolean isCli() {
    boolean isCli = false;
    for (String arg : args) {
      if (arg.equalsIgnoreCase("--cli") || arg.equalsIgnoreCase("-c")) {
      if (arg.equalsIgnoreCase("--"+OPTION_LONG_CLI) ||
          arg.equalsIgnoreCase("-"+OPTION_SHORT_CLI)) {
        isCli = true;
        break;
      }
opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
@@ -180,8 +180,8 @@
      if (!QuickSetupLog.isInitialized())
        QuickSetupLog.initLogFileHandler(
                File.createTempFile(
                    SetupGuiLauncher.LOG_FILE_PREFIX,
                    SetupGuiLauncher.LOG_FILE_SUFFIX));
                    SetupLauncher.LOG_FILE_PREFIX,
                    SetupLauncher.LOG_FILE_SUFFIX));
    } catch (IOException e) {
      System.err.println("Failed to initialize log");
    }
opends/src/quicksetup/org/opends/quicksetup/installer/SetupLauncher.java
File was renamed from opends/src/quicksetup/org/opends/quicksetup/installer/SetupGuiLauncher.java
@@ -28,9 +28,7 @@
package org.opends.quicksetup.installer;
import static org.opends.messages.QuickSetupMessages.*;
import static org.opends.messages.ToolMessages.INFO_DESCRIPTION_SHOWUSAGE;
import static org.opends.server.tools.ToolConstants.OPTION_LONG_HELP;
import static org.opends.server.tools.ToolConstants.OPTION_SHORT_HELP;
import static org.opends.messages.ToolMessages.*;
import java.io.File;
import java.util.logging.Logger;
@@ -43,31 +41,31 @@
import org.opends.quicksetup.installer.offline.OfflineInstaller;
import org.opends.quicksetup.util.Utils;
import org.opends.messages.Message;
import org.opends.messages.ToolMessages;
import org.opends.server.tools.InstallDS;
import org.opends.server.tools.InstallDSArgumentParser;
import org.opends.server.util.ServerConstants;
import org.opends.server.util.args.ArgumentException;
import org.opends.server.util.args.ArgumentParser;
import org.opends.server.util.args.BooleanArgument;
/**
 * This class is called by the setup GUI command line to launch the setup
 * This class is called by the setup command line to launch the setup
 * of the Directory Server. It just checks the command line arguments and the
 * environment and determines whether the graphical or the command line
 * based setup much be launched.
 */
public class SetupGuiLauncher extends Launcher {
public class SetupLauncher extends Launcher {
  /** Prefix for log files. */
  static public final String LOG_FILE_PREFIX = "opends-setup-gui-";
  static public final String LOG_FILE_PREFIX = "opends-setup-";
  /** Suffix for log files. */
  static public final String LOG_FILE_SUFFIX = ".log";
  static private final Logger LOG =
          Logger.getLogger(SetupGuiLauncher.class.getName());
          Logger.getLogger(SetupLauncher.class.getName());
  /**
   * The main method which is called by the setup GUI command lines.
   * The main method which is called by the setup command lines.
   *
   * @param args the arguments passed by the command lines.  In the case
   * we want to launch the cli setup they are basically the arguments that we
@@ -83,23 +81,23 @@
      System.err.println("Unable to initialize log");
      t.printStackTrace();
    }
    new SetupGuiLauncher(args).launch();
    new SetupLauncher(args).launch();
  }
  private ArgumentParser argParser;
  private InstallDSArgumentParser argParser;
  /**
   * Creates a launcher.
   *
   * @param args the arguments passed by the command lines.
   */
  public SetupGuiLauncher(String[] args) {
  public SetupLauncher(String[] args) {
    super(args);
    String scriptName;
    if (Utils.isWindows()) {
      scriptName = Installation.WINDOWS_SETUP_GUI_FILE_NAME;
      scriptName = Installation.WINDOWS_SETUP_FILE_NAME;
    } else {
      scriptName = Installation.UNIX_SETUP_GUI_FILE_NAME;
      scriptName = Installation.UNIX_SETUP_FILE_NAME;
    }
    System.setProperty(ServerConstants.PROPERTY_SCRIPT_NAME, scriptName);
    initializeParser();
@@ -110,23 +108,15 @@
   */
  protected void initializeParser()
  {
    argParser = new ArgumentParser(getClass().getName(),
        INFO_SETUP_LAUNCHER_USAGE_DESCRIPTION.get(),
        false);
    argParser = new InstallDSArgumentParser(InstallDS.class.getName());
    try
    {
      BooleanArgument showUsageArg = new BooleanArgument("showUsage",
          OPTION_SHORT_HELP,
          OPTION_LONG_HELP, INFO_DESCRIPTION_SHOWUSAGE.get());
      argParser.addArgument(showUsageArg);
      argParser.setUsageArgument(showUsageArg);
      argParser.parseArguments(args);
      argParser.initializeArguments();
    }
    catch (ArgumentException ae)
    {
      System.err.println(org.opends.server.util.StaticUtils.wrapText(
          ToolMessages.ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage()),
          Utils.getCommandLineMaxLineWidth()));
      Message message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
      System.out.println(message);
    }
  }
@@ -148,7 +138,12 @@
        printUsage(false);
      }
      System.exit(ReturnCode.SUCCESSFUL.getReturnCode());
    } else {
    }
    else if (isCli())
    {
      System.exit(InstallDS.mainCLI(args));
    }
    else {
      willLaunchGui();
      int exitCode = launchGui(args);
      if (exitCode != 0) {
@@ -161,7 +156,7 @@
        {
          guiLaunchFailed(null);
        }
        System.exit(exitCode);
        System.exit(InstallDS.mainCLI(args));
      }
    }
  }
@@ -169,13 +164,6 @@
  /**
   * {@inheritDoc}
   */
  protected boolean isCli() {
    return false;
  }
  /**
   * {@inheritDoc}
   */
  public ArgumentParser getArgumentParser() {
    return this.argParser;
  }
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -1209,9 +1209,7 @@
    else if (name.endsWith(".sh"))
    {
      perm = "755";
    } else if (name.endsWith(Installation.UNIX_SETUP_GUI_FILE_NAME) ||
            name.endsWith(Installation.UNIX_SETUP_FILE_NAME) ||
            name.endsWith(Installation.UNIX_UNINSTALL_GUI_FILE_NAME) ||
    } else if (name.endsWith(Installation.UNIX_SETUP_FILE_NAME) ||
            name.endsWith(Installation.UNIX_UNINSTALL_FILE_NAME) ||
            name.endsWith(Installation.UNIX_UPGRADE_FILE_NAME))
    {
opends/src/server/org/opends/server/tools/InstallDSArgumentParser.java
@@ -57,9 +57,10 @@
 * a given port is free) nor the validity of the certificate information
 * provided.
 */
class InstallDSArgumentParser extends ArgumentParser
public class InstallDSArgumentParser extends ArgumentParser
{
  BooleanArgument   testOnlyArg;
  BooleanArgument   cliArg;
  BooleanArgument   addBaseEntryArg;
  BooleanArgument   showUsageArg;
  BooleanArgument   quietArg;
@@ -114,6 +115,13 @@
    testOnlyArg.setHidden(true);
    addArgument(testOnlyArg);
    cliArg = new BooleanArgument(
        OPTION_LONG_CLI,
        OPTION_SHORT_CLI,
        OPTION_LONG_CLI,
        INFO_INSTALLDS_DESCRIPTION_CLI.get());
    addArgument(cliArg);
    configFileArg = new StringArgument(
        "configfile", 'c', "configFile", false,
        false, true, "{configFile}", getDefaultConfigFile(), null,
opends/src/server/org/opends/server/tools/ToolConstants.java
@@ -458,6 +458,11 @@
  public static final String OPTION_LONG_CLI = "cli";
  /**
   * The value for the short option cli.
   */
  public static final char OPTION_SHORT_CLI = 'i';
  /**
   * The value for the short option proxyAs.
   */
  public static final char OPTION_SHORT_PROXYAUTHID = 'Y';
opends/tests/functional-tests/shared/functions/dsadm.xml
@@ -110,6 +110,7 @@
        if dsPath:
          STAFCmd='%s/setup%s' % (dsPath,fileExt)
          STAFCmdParamsList.append('--cli')
          STAFCmdParamsList.append('-n')    
                  
        if dsPort:
opends/tests/unit-tests-testng/src/server/org/opends/quicksetup/TestUtilities.java
@@ -44,7 +44,7 @@
 *
 */
public class TestUtilities {
  /**
   * The name of the system property that specifies the server build root.
   */
@@ -95,6 +95,7 @@
    } else {
      args.add(new File(root, "setup.bat").getPath());
    }
    args.add("--cli");
    args.add("-n");
    args.add("-p");
    args.add(Integer.toString(ldapPort));