engine-wrapper revision ada1678a4262b208a7b87391f520a7767d25287c
# obtain a copy of the License at # language governing permissions and limitations under the License. # When distributing the software, include this License Header Notice in each # GPL Classpath Exception: # Oracle designates this particular file as subject to the "Classpath" # exception as provided by Oracle in the GPL Version 2 section of the License # file that accompanied this code. # If applicable, add the following below the License Header, with the fields # enclosed by brackets [] replaced by your own identifying information: # "Portions Copyright [year] [name of copyright owner]" # If you wish your version of this file to be governed by only the CDDL or # only the GPL Version 2, indicate your decision by adding "[Contributor] # elects to include this software in this distribution under the [CDDL or GPL # Version 2] license." If you don't indicate a single choice of license, a # recipient has the option to distribute your version of this file under # either the CDDL, the GPL Version 2 or to extend the choice of license to # its licensees as provided above. However, if you add GPL Version 2 code # and therefore, elected the GPL Version 2 license, then the option applies # only if the new code is made subject to such option by the copyright # Sun Install engine wrapper script # binaries needed on both Solaris, Linux, etc. _PWD=/
bin/
pwd # "${PWD}" is defined as a built-in variable in some shells #------------------------------------------------------------------------------- # usage only: define what parameters are available here #------------------------------------------------------------------------------- -a <path>, --answerfile=<path> Supply a file containing install configuration. Can be used multiple times for multiple answer files. -n <file>, --dry-run=<file>: Dry run mode. Do not install anything. Configuration answers written to <file> -R <path>, --altroot=<path> Operation with respect to an alternate root display version of install engine. -l <level>, --level=<level> Debug level. One of FATAL, WARNING, INFO, CONFIG, FINE, FINER, FINEST -m <url>, --media-location=<url> Specify location of metadata used to drive install. If blank, -s <dir>, --configstate=<dir> Directory where the config data is persisted as xcu files. -i <path>, --installables=<path> Root directory containing installable units for support of install and repair. -j <javahome>, --javahome=<javahome> : use this java vm instead of searching for suitable one -J <joptions>, --jvmoptions=<joptions> : specify java vm options. For example -J "-verbose -Dhttp.proxy=foo.com:3434" -C <classpaths>, --classpaths=<classpaths> : specify a colon-separated list of additional classpaths -c <file>, --config-file=<file> : Specify extra properties in a file -p <props>, --properties=<props> : specify 1 or more config properties options, separated by comma, to the install engine. For example: --properties=Logs-Location=/tmp,Platform-Plugin-Path=c:\\Sun\\ppp #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- if [ -n "${ADDITIONALCLASSPATHS}" ]; then theCP="${theCP}:${ADDITIONALCLASSPATHS}" if [ -n "${CLASSPATH}" ]; then theCP="${theCP}:${CLASSPATH}" if [ -n "${DRYRUN}" ]; then if [ -n "${CONFIGSTATE}" ]; then INSTALLPROPS="${INSTALLPROPS} -p Config-State=${CONFIGSTATE}" if [ -n "${ANSWERFILE}" ]; then INSTALLPROPS="${INSTALLPROPS} -p Answer-Files=${ANSWERFILE}" if [ -n "${ALTROOT}" ]; then if [ -n "${DEBUGLEVEL}" ]; then if [ -n "${MEDIALOC}" ]; then INSTALLPROPS="${INSTALLPROPS} -p Media-Location=${MEDIALOC}" if [ -n "${INSTALLABLES}" ]; then INSTALLPROPS="${INSTALLPROPS} -p Installable-Unit-Path=${INSTALLABLES}" # Uninstalls typically remove the files that make up the installer, # which can cause problems on unix, so as a precautionary measure, #------------------------------------------------------------------------------- # ****************************** MAIN THREAD *********************************** #------------------------------------------------------------------------------- LONGOPT=
"h(help)V(version)n:(dry-run)s:(configstate)a:(answerfile)R:(altroot)l:(level)m:(media-location)i:(installables)j:(javahome)J:(jvmoptions)C:(classpaths)c:(config-file)p:(properties)" echo `${GETTEXT} "openInstaller is only supported on Solaris 9 or later"` # Linux has no built-in support for long-style getopts so we use the short style only while getopts "${OPTSTRING}" opt ;
do # The engine knows how to deal with a leading "," so we can use this with no problems: # Answer file is a URL or contains substitutions, so don't try and parse it # Answer file is not a URL, so resolve relative paths if [ ! -d
"${ANSDIR}" -o ! -w
"${ANSDIR}" ];
then ${
PRINTF}
"`${GETTEXT} '%s is not a directory or is not writable'`\n" "${ANSDIR}" ${
PRINTF}
"`${GETTEXT} '%s is not a valid alternate root'`\n" "${ALTROOT}" # Dry-Run file is a URL or contains substitutions, so don't try and parse it # Dry-Run file is not a URL, so resolve relative paths if [ ! -d
"${DRYDIR}" -o ! -w
"${DRYDIR}" ];
then ${
PRINTF}
"`${GETTEXT} '%s is not a directory or is not writable'`\n" "${DRYDIR}" ${
PRINTF}
"`${GETTEXT} '%s must be the root directory of a valid JVM installation'`\n" "${JAVAHOME}"if [ -n
"${VERSIONFLAG}" ] ;
then ${
ECHO}
"openInstaller Install Framework 0.9.5" echo `${GETTEXT} "Copyright (c) 2006-2010 Oracle and/or its affiliates. All rights reserved."` echo `${GETTEXT} "Use is subject to license terms."` ${
PRINTF}
"`${GETTEXT} 'Assembled on : %s'`\n" "Fri, Apr 4, 2008 02:24 PM PDT"# If its a dry-run and answer file is specified # Verify if it already exists. if so, inform the user to choose a different if [ -n
"${DRYRUN}" -a -f
"${DRYRUN}" ] ;
then ${
PRINTF}
"`${GETTEXT} 'Dry Run File %s already exists. Please choose a non-existing file path'`\n" "${DRYRUN}"if [ -z
"${JAVAHOME}" ] ;
then ${
PRINTF}
"`${GETTEXT} 'Must specify a java installation using %s'`\n" -j