upgrade revision 3cedecd5ea21cca5d9709abf320a2082cd3694e5
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# CDDL HEADER START
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# The contents of this file are subject to the terms of the
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Common Development and Distribution License, Version 1.0 only
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# (the "License"). You may not use this file except in compliance
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# with the License.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# You can obtain a copy of the license at
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# trunk/opends/resource/legal-notices/OpenDS.LICENSE
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# See the License for the specific language governing permissions
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# and limitations under the License.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# When distributing Covered Code, include this CDDL HEADER in each
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# file and include the License file at
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# add the following below this CDDL HEADER, with the fields enclosed
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# by brackets "[]" replaced with your own identifying information:
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Portions Copyright [yyyy] [name of copyright owner]
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# CDDL HEADER END
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Copyright 2006-2008 Sun Microsystems, Inc.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Capture the current working directory so that we can change to it later.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Then capture the location of this script and the Directory Server instance
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# root so that we can use them to create appropriate paths.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynccd "${WORKING_DIR}"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Set java home
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync. "${INSTANCE_ROOT}/lib/_script-util.sh"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Set environment variables
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync. "${INSTANCE_ROOT}/lib/_script-util.sh"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Configure the appropriate CLASSPATH to test.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Test the java installation
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync. "${INSTANCE_ROOT}/lib/_script-util.sh"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncif [ -r "${INSTANCE_ROOT}/tmp/upgrade" ]
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Launch the build extractor.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Configure the appropriate CLASSPATH.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# BuildExtractor uses the existing install's
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# Run the build extractor first. An exit code of 99 from the extractor
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# means that this is indeed an upgrade (as opposed to a reversion) and
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# that the upgrade should continue. An exit code of 98 means that this
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# operation is a reversion. An exit code of 50 means that the usage
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync# statement was printed and there is nothing else to do
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync"${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} org.opends.quicksetup.upgrader.BuildExtractor "${@}"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # Configure the appropriate CLASSPATH.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # Unlike BuildExtractor, the Upgrader uses
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # the newly extracted build's jars.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # Launch the upgrade process.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} org.opends.quicksetup.upgrader.UpgradeLauncher "${@}"
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # Copy jars to a temporary place from which to run the reverter
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # in order to avoid potential file lock issues.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync cp -R ${INSTANCE_ROOT}/lib ${INSTANCE_ROOT}/tmp/revert
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync echo "ERROR: Failed to initialize reversion."
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync # Launch the upgrade process.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} org.opends.quicksetup.upgrader.ReversionLauncher "${@}"
8a5e0b7c43d7ee861689984edc2abd86b9ed4456vboxsync # Version info was on requested
8a5e0b7c43d7ee861689984edc2abd86b9ed4456vboxsync # Usage printed
8a5e0b7c43d7ee861689984edc2abd86b9ed4456vboxsync # Some unknown return code returned