Cross Reference: /pkg/src/scripts/pkgsend.sh
pkgsend.sh revision 290
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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#
290N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
290N/A# Use is subject to license terms.
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
290N/APYTHONPATH=${PYTHONPATH}:${my_ips_base}/usr/lib/python2.4/vendor-packages
290N/APKG_HOME=${my_ips_base}/usr
290N/Aexport LD_LIBRARY_PATH PYTHONHOME PYTHONPATH PKG_HOME
290N/Aif [ -x ${my_base}/python/bin/python2.4 ] ; then
290N/A PYEXE=${my_base}/python/bin/python2.4
290N/Aelse
290N/A PYEXE=`which python`
290N/A unset PYTHONHOME
290N/Afi
290N/A
290N/Aexec ${PYEXE} ${my_home}/publish.py "$@"
290N/A