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