#!/bin/sh
#
#  tapeinfo
#
#############################################################################
#
#	Copyright (C) Cadence Design Systems, Inc. All rights
#	reserved.  Unpublished -- rights reserved under the
#	copyright laws of the United States of America.
#
#			RESTRICTED RIGHTS LEGEND
#	Use, duplication, or disclosure by the Government is subject
#	to restrictions as set forth in subparagraph (c)(l)(ii) of 
#	the Rights in Technical Data and Computer Software clause 
#	at DFARS 52.227-7013.
#
#			Cadence Design Systems, Inc.
#			555 River Oaks Parkway
#			San Jose, CA 95134	USA
#
#############################################################################
BOURNE=/bin/sh
XTERMPATH=/usr/openwin/bin
XTERMBIN=xterm
XTERMOPTS="-T 'SoftLoad 6.0 Console' -fn 9x15  -sl 200 -g 80x40+0+0 -bg \#e0e0e0 -fg \#800000 -sb -e ${BOURNE} softload_GUI"
sysPATH=/bin:/usr/bin:/usr/ucb:$XTERMPATH

jsr=''

Clear() {
    clear		2>/dev/null	#beware of bad termcap entry
}

Page() {
    MORE=""  more
}

EchoN() {
    echo -n "$*"
}

Beep() {
    $jsr EchoN ""	2>/dev/null
}

OSvendor=sun4
OSarchs=$OSvendor

LegalVendor() {
    OSVER=`/bin/uname -r`
    OSTYPE=`/bin/uname -s`
    test $OSTYPE = "SunOS" && test $OSVER -lt 5
    return $?
}



Dirname() {					#print argument minus leaf, or .
    case $1 in
	*/* )	echo $1 | sed 's@/[^/]*$@/@' ;;
	*)	echo "." ;;
    esac
}

Leafname() {					#print leaf
    case $1 in
	*/* )	echo $1 | sed 's@.*/@@' ;;
	*)	echo $1 ;;
    esac
}

Fullpath() {					#print rooted path to arg dir
    ( cd $1 && /bin/pwd |
	sed 's@^/tmp_mnt/@/@' )			#print automount access dir
}

Dirpath() {					#print rooted path to arg - leaf
    $jsr Fullpath `$jsr Dirname $1`
}

Suffix() {
    echo $1 | sed -n 's@.*\.@@p'
}

Prefix() {
    echo $1 | sed 's@\.[^.]*$@@'
}


PATH=$sysPATH;		export PATH


$jsr LegalVendor || {
    echo "Error: unexpected architecture"			1>&2
    exit 1
}

#
# figure out were install bin is, and thereby the pseudo-root
#
cd `$jsr Dirname $0`		|| exit 1

if [ -z "$bin_dir" ]; then #{
  bin_dir=`pwd`; export bin_dir
fi  #}

Proot=`$jsr Fullpath $bin_dir/../..`; export Proot	# the pseudo-root 

test -z "$Rm" && Rm=/bin/rm; 	export Rm	# for the paranoid...
NL="
"

pkginfo="$Proot/install/tmp/pkginfo.$OSvendor"

$BOURNE inv_tapes -v $pkginfo | $jsr Page
exit $?

