290N/A#!/bin/sh
290N/A#
290N/A# CDDL HEADER START
290N/A#
290N/A# The contents of this file are subject to the terms of the
290N/A# Common Development and Distribution License (the "License").
290N/A# You may not use this file except in compliance with the License.
290N/A#
290N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
290N/A# or http://www.opensolaris.org/os/licensing.
290N/A# See the License for the specific language governing permissions
290N/A# and limitations under the License.
290N/A#
290N/A# When distributing Covered Code, include this CDDL HEADER in each
290N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
290N/A# If applicable, add the following below this CDDL HEADER, with the
290N/A# fields enclosed by brackets "[]" replaced with your own identifying
290N/A# information: Portions Copyright [yyyy] [name of copyright owner]
290N/A#
290N/A# CDDL HEADER END
290N/A#
3177N/A# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
3177N/A#
290N/A
290N/A# Resolve a symbolic link to the true file location
290N/Aresolve_symlink () {
290N/A file="$1"
290N/A while [ -h "$file" ]; do
290N/A ls=`ls -ld "$file"`
290N/A link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
290N/A if expr "$link" : '^/' 2> /dev/null >/dev/null; then
290N/A file="$link"
290N/A else
290N/A file=`dirname "$1"`"/$link"
290N/A fi
290N/A done
290N/A echo "$file"
290N/A}
290N/A
290N/A# Take a relative path and make it absolute. Pwd -P will
290N/A# resolve any symlinks in the path
290N/Amake_absolute () {
290N/A save_pwd=`pwd`
290N/A cd $1;
290N/A full_path=`pwd -P`
290N/A cd $save_pwd
290N/A echo "$full_path"
290N/A}
290N/A
290N/Acmd=`resolve_symlink $0`
290N/Amy_home_relative=`dirname $cmd`
290N/Amy_home=`make_absolute $my_home_relative`
290N/A
290N/Amy_base=`cd ${my_home}/../../..; pwd`
290N/Amy_ips_base=`cd ${my_home}/../..; pwd`
290N/ALD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${my_ips_base}/usr/lib
290N/APYTHONHOME=${my_base}/python
3177N/APYTHONPATH=${PYTHONPATH}:${my_ips_base}/usr/lib/python2.7/vendor-packages
290N/APKG_HOME=${my_ips_base}/usr
290N/Aexport LD_LIBRARY_PATH PYTHONHOME PYTHONPATH PKG_HOME
3177N/Aif [ -x ${my_base}/python/bin/python2.7 ] ; then
3177N/A PYEXE=${my_base}/python/bin/python2.7
290N/Aelse
290N/A PYEXE=`which python`
290N/A unset PYTHONHOME
290N/Afi
290N/A
290N/Aexec ${PYEXE} ${my_home}/publish.py "$@"
290N/A