upgrade revision 2976
f80ef15dcf58050fbfbe12b000de043f6ae6ac82pquerna# CDDL HEADER START
38451a13fb80b89e704792ebc0e6f9e5e5877d7dsf# The contents of this file are subject to the terms of the
38451a13fb80b89e704792ebc0e6f9e5e5877d7dsf# Common Development and Distribution License, Version 1.0 only
38451a13fb80b89e704792ebc0e6f9e5e5877d7dsf# (the "License"). You may not use this file except in compliance
38451a13fb80b89e704792ebc0e6f9e5e5877d7dsf# with the License.
505e342aefa9fbccc857f1bc653a310e25511946sf# You can obtain a copy of the license at
505e342aefa9fbccc857f1bc653a310e25511946sf# See the License for the specific language governing permissions
26734c75baf170a492ef6a82f07b24ee1af7d0b1sf# and limitations under the License.
26734c75baf170a492ef6a82f07b24ee1af7d0b1sf# When distributing Covered Code, include this CDDL HEADER in each
dda254ba84bdff5e236917af1b31693ca4360eabcovener# file and include the License file at
dda254ba84bdff5e236917af1b31693ca4360eabcovener# trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
dda254ba84bdff5e236917af1b31693ca4360eabcovener# add the following below this CDDL HEADER, with the fields enclosed
dda254ba84bdff5e236917af1b31693ca4360eabcovener# by brackets "[]" replaced with your own identifying information:
bcb567d8f48f5de8aa84e0b19e93357e0a4d970epquerna# Portions Copyright [yyyy] [name of copyright owner]
3becbd2611ffb2e8391a8eacce765b43dcb1c669wrowe# CDDL HEADER END
8e5e9b2d4c6cbcd21ca182fe1109d59284239515wrowe# Portions Copyright 2006-2007 Sun Microsystems, Inc.
9c78f8d71737dfbbbf4da2f9acb397567a10e88bsf# Capture the current working directory so that we can change to it later.
9c78f8d71737dfbbbf4da2f9acb397567a10e88bsf# Then capture the location of this script and the Directory Server instance
9c78f8d71737dfbbbf4da2f9acb397567a10e88bsf# root so that we can use them to create appropriate paths.
5e1ae35c05125b8b6c6c648c60e576f5796ea061rpluemcd "${WORKING_DIR}"
b115299831a7b4bbec58a88d708d8536e1ecd50csf# Set java home
b9a830d395feaa66ab621841a5cd86e1fa2d184brjung. "${INSTANCE_ROOT}/lib/_script-util.sh"
82e6711dc508d2822d9397f07136ba4ddd8764e1niq# Set environment variables
f43104f173247435cb4ade2b89aa2ca8108aedb7niq. "${INSTANCE_ROOT}/lib/_script-util.sh"
c26aa743a70c2148cdca1e6c637c605d9025b051niq# Configure the appropriate CLASSPATH to test.
d31d6c32262a8d1cbfc63d9f7adccae46002c8f7niq# Test the java installation
bcb567d8f48f5de8aa84e0b19e93357e0a4d970epquerna. "${INSTANCE_ROOT}/lib/_script-util.sh"
11f2c481e1d57bedb3f758565307501e9a2730ddtrawickif [ -r "${INSTANCE_ROOT}/tmp/upgrade" ]
99d46a23c6eac800f327b29f8009f7d7da986230trawick# Launch the build extractor.
99d46a23c6eac800f327b29f8009f7d7da986230trawick# Configure the appropriate CLASSPATH.
99d46a23c6eac800f327b29f8009f7d7da986230trawick# BuildExtractor uses the existing install's
bcb567d8f48f5de8aa84e0b19e93357e0a4d970epquerna# Run the build extractor first. An exit code of 99 from the extractor
bcb567d8f48f5de8aa84e0b19e93357e0a4d970epquerna# means that this is indeed an upgrade (as opposed to a reversion) and
bcb567d8f48f5de8aa84e0b19e93357e0a4d970epquerna# that the upgrade should continue. An exit code of 98 means that this
bcb567d8f48f5de8aa84e0b19e93357e0a4d970epquerna# operation is a reversion. An exit code of 50 means that the usage
bcb567d8f48f5de8aa84e0b19e93357e0a4d970epquerna# statement was printed and there is nothing else to do
bcb567d8f48f5de8aa84e0b19e93357e0a4d970epquerna"${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} org.opends.quicksetup.upgrader.BuildExtractor "${@}"
ba217dc41cebc0976010ee177f8fedac782d1f6fminfrin # Configure the appropriate CLASSPATH.
ab1b172430f2d4e1b222b541bb8c1d431c1a7bc7sf # Unlike BuildExtractor, the Upgrader uses
8315a125b56710a222167e4d65b96c3c891f4b25sf # the newly extracted build's jars.
7f51e5c395d431b8c20226f77de28efe13272bfasf # Launch the upgrade process.
7f51e5c395d431b8c20226f77de28efe13272bfasf "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} org.opends.quicksetup.upgrader.UpgradeLauncher "${@}"
17d64c884a44f5ca72f6901afd3e50991bfc1c63sf # Copy jars to a temporary place from which to run the reverter
17d64c884a44f5ca72f6901afd3e50991bfc1c63sf # in order to avoid potential file lock issues.
68686064650b23222461014a11558593de194bbctrawick echo "ERROR: Failed to initialize reversion."
4f133508c93204c06e1acba9774ff184e5812606niq # Launch the upgrade process.
4f133508c93204c06e1acba9774ff184e5812606niq "${OPENDS_JAVA_BIN}" ${OPENDS_JAVA_ARGS} org.opends.quicksetup.upgrader.ReversionLauncher "${@}"
87587593f1a53030e840acc0dec6cc881022ea40covener # Version info was on requested
52071e4b9f49c3a1c2c767c7ea80ec92cf9032c9covener # Usage printed
89b8bbc89404e7071e573c4f0a17f528996e855djorton # Some unknown return code returned