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

jvergara
04.34.2008 ff4e305d09da6752736d0d5a6f50239bc60454cc
Fix for issue 2508: upgrade -a does not work

The fix is similar to the one done for issue 2506: the object describing the user data must be updated properly. In addition to that some changes have been performed in the messages to be more explicit when an error occurs with the directory specified by the user.
4 files modified
24 ■■■■ changed files
opendj-sdk/opends/src/messages/messages/quicksetup.properties 11 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractorCliHelper.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Reverter.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/quicksetup.properties
@@ -796,10 +796,13 @@
 You must specify one of %s
INFO_REVERT_ERROR_NO_HISTORY_DIR=There are no existing backup locations from \
 prior upgrades.  The 'history' directory does not exist.
INFO_REVERT_ERROR_NOT_DIR_FILES_DIR=The reversion archive directory is not a \
 directory.
INFO_REVERT_ERROR_NULL_FILES_DIR=The reversion archive directory is invalid or \
 could not be determined.
INFO_REVERT_ERROR_NOT_DIR_FILES_DIR=The specified reversion archive directory \
 is not a directory.
INFO_REVERT_ERROR_NULL_FILES_DIR=The specified reversion archive directory is \
 invalid or could not be determined.
INFO_REVERT_ERROR_INVALID_FILES_DIR=The contents of the specified reversion \
 archive directory are invalid.
INFO_REVERT_ERROR_NOT_REVERSION_FILES_DIR=The
INFO_REVERT_LAUNCHER_USAGE_DESCRIPTION=This utility reverts the current \
 installation of the Directory Server to a version prior to running the \
 upgrade utility.
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/BuildExtractorCliHelper.java
@@ -137,7 +137,7 @@
        uud.setInstallPackage(
                validateInstallPackFile(upgradeFile));
      }
      if (launcher.isRevertMostRecent())
      if (launcher.isRevertMostRecent() || launcher.isRevertToArchive())
      {
        uud.setOperation(UpgradeUserData.Operation.REVERSION);
      }
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Reverter.java
@@ -706,7 +706,7 @@
              INFO_REVERT_ERROR_NOT_DIR_FILES_DIR.get());
    } else if (!isReversionFilesDirectory(filesDir)) {
      throw new UserDataException(null,
              INFO_REVERT_ERROR_NOT_DIR_FILES_DIR.get());
              INFO_REVERT_ERROR_INVALID_FILES_DIR.get());
    }
    return filesDir;
  }
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java
@@ -283,6 +283,15 @@
  }
  /**
   * Indicates whether the user has specified to revert to an specific archive.
   * @return boolean where true indicates that the user specified to revert to
   * an specific archive.
   */
  public boolean isRevertToArchive() {
    return reversionArchive.isPresent();
  }
  /**
   * Creates an instance.
   *
   * @param args specified on command line